Natively, salesforce includes Notes directly related to the Account, as well as those related to child objects (at least Contacts as well).
Is this possible, using a condition to include Notes with the same Account ID as well as those associated with Contacts of that account?
Thanks,
Jacob
Yes, this is possible by having 2 Conditions on your Notes object, and combining them with Condition Logic of “1 OR 2”. The first Condition is Field from another Model, where ParentId = (Account)(Id), the 2nd Condition is Field from another Model where ParentId is one of the Ids of related Contacts for that Account — so you will have to have a 2nd Contacts Model that retrieves Contacts for that Account.
Here’s what your Conditions on the Notes model should look like:
And here’s a screenshot of what an example page would look like. Notice that its showing Notes that are associated to both Genepoint Contacts, as well as for Genepoint itself:
Here is the XML for this sample page:
<skuidpage showsidebar="true" showheader="true" tabtooverride="Account"> <models>
<model id="Account" limit="1" query="true" createrowifnonefound="false" sobject="Account">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
</fields>
<conditions>
<condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
</conditions>
</model>
<model id="Contacts" limit="100" query="true" createrowifnonefound="false" sobject="Contact">
<fields>
<field id="FirstName"/>
<field id="LastName"/>
</fields>
<conditions>
<condition type="modelmerge" value="" field="AccountId" operator="=" model="Account" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
</conditions>
</model>
<model id="Notes" limit="100" query="true" createrowifnonefound="false" sobject="Note">
<fields>
<field id="Title"/>
<field id="Body"/>
<field id="ParentId"/>
<field id="Parent.Name"/>
<field id="OwnerId"/>
<field id="Owner.Name"/>
</fields>
<conditions logic="1 OR 2">
<condition type="modelmerge" value="" field="ParentId" operator="=" model="Account" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
<condition type="modelmerge" value="" field="ParentId" operator="in" model="Contacts" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="deactivate"/>
</conditions>
</model>
</models>
<components>
<pagetitle model="Account">
<maintitle>
<template>{{Name}}</template>
</maintitle>
<subtitle>
<template>{{Model.label}}</template>
</subtitle>
<actions>
<action type="delete"/>
<action type="clone"/>
<action type="share"/>
<action type="savecancel" window="self"/>
</actions>
</pagetitle>
<basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read">
<columns>
<column width="50%">
<sections>
<section title="Basics">
<fields>
<field id="Name"/>
</fields>
</section>
</sections>
</column>
<column width="50%">
<sections>
<section title="System Info">
<fields>
<field id="CreatedDate"/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
<tabset rememberlastusertab="true" defertabrendering="true">
<tabs>
<tab name="Contacts">
<components>
<skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Contacts" buttonposition="" mode="read">
<fields>
<field id="FirstName"/>
<field id="LastName"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
</tab>
<tab name="Notes" loadlazypanels="true">
<components>
<skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Notes" buttonposition="" mode="read">
<fields>
<field id="Title"/>
<field id="Body"/>
<field id="ParentId"/>
<field id="OwnerId"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
</tab>
</tabs>
</tabset>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
</skuidpage>
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.