raj,
Here is a page that demonstrates what I am trying to tell you. This page creates a new Task. You select an Account first. Then click on the button ‘Select Child Contact’. This loads a model with a list of the contacts whose parent is the select account. Click the row action next to the contact’s name to ‘select them’ for the WhoId field on the Task. This is what you are trying to do with the CL Product field on your page.
Take a look at the row action on the table in the pop up.
<actions> <action type="updateRow" sourcemodel="Task" targetmodel="Task" affectedrows="context" fieldmodel="Task" field="WhoId" fieldtargetobjects="Contact,Lead" enclosevalueinquotes="true" value="{{Id}}"/> <action type="updateRow" fieldmodel="Task" affectedrows="context" field="Who.Name" enclosevalueinquotes="true" value="{{Name}}"/> <action type="closeTopmostPopup"/> </actions>
Thanks,
Bill
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
<models>
<model id="Task" limit="1" query="false" createrowifnonefound="true" datasource="salesforce" type="" sobject="Task">
<fields>
<field id="AccountId"/>
<field id="Account.Name"/>
<field id="WhoId"/>
<field id="Who.Name"/>
<field id="Subject"/>
<field id="WhatId"/>
<field id="What.Name"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="LookupContacts" limit="200" query="false" createrowifnonefound="false" datasource="salesforce" type="" sobject="Contact">
<fields>
<field id="Id"/>
<field id="Name"/>
</fields>
<conditions>
<condition type="fieldvalue" value="" enclosevalueinquotes="true" field="AccountId" fieldtargetobjects="Account" state="filterableoff" inactive="true" name="AccountId"/>
</conditions>
<actions/>
</model>
</models>
<components>
<pagetitle model="Task" uniqueid="sk-3xF69b-152">
<maintitle>
<template>{{Subject}}</template>
</maintitle>
<subtitle>
<template>{{Model.label}}</template>
</subtitle>
<actions>
<action type="multi" label="Select Child Contact" uniqueid="sk-3xF8E--164" icon="sk-icon-search">
<renderconditions logictype="and"/>
<enableconditions logictype="and">
<condition type="blank" operator="!=" fieldmodel="Task" sourcetype="fieldvalue" field="WhatId" fieldtargetobjects="Account,Asset,Campaign,Case,Contract,Ghost__c,Goal,LiveAgentSession,LiveChatTranscript,Metric,Opportunity,Order,Product2,Quote,Solution,Store__c,WorkCoaching" value="null" enclosevalueinquotes="false"/>
</enableconditions>
<actions>
<action type="setCondition" sourcemodel="Task" targetmodel="Task" affectedrows="context" model="LookupContacts" condition="AccountId" value="{{WhatId}}"/>
<action type="requeryModel" model="LookupContacts" behavior="standard"/>
<action type="showPopup">
<popup title="Select Contact" width="40%">
<components>
<skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" alwaysresetpagination="false" createrecords="false" model="LookupContacts" buttonposition="" mode="readonly" allowcolumnreordering="false" responsive="true" uniqueid="sk-3xG7UL-345">
<fields>
<field id="Name" hideable="true" uniqueid="fi-3xG97p-360"/>
</fields>
<rowactions>
<action type="multi" label="Select Contact" icon="sk-icon-magic">
<actions>
<action type="updateRow" sourcemodel="Task" targetmodel="Task" affectedrows="context" fieldmodel="Task" field="WhoId" fieldtargetobjects="Contact,Lead" enclosevalueinquotes="true" value="{{Id}}"/>
<action type="updateRow" fieldmodel="Task" affectedrows="context" field="Who.Name" enclosevalueinquotes="true" value="{{Name}}"/>
<action type="closeTopmostPopup"/>
</actions>
</action>
</rowactions>
<massactions usefirstitemasdefault="true"/>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
</popup>
</action>
</actions>
</action>
<action type="savecancel" label="New Button" uniqueid="sk-3xF6ay-157"/>
</actions>
</pagetitle>
<basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="Task" buttonposition="" uniqueid="sk-3xF2Dp-130" mode="edit">
<columns>
<column width="100%">
<sections>
<section title="Details" collapsible="no">
<fields>
<field uniqueid="sk-3xFX-z-232" id="WhatId" valuehalign="" type="">
<label>Select Account</label>
</field>
<field uniqueid="sk-3xFHXQ-187" id="WhoId" valuehalign="" type="">
<renderconditions logictype="and" onhidedatabehavior="keep"/>
<enableconditions logictype="and">
<condition type="blank" operator="!=" fieldmodel="Task" sourcetype="fieldvalue" field="WhatId" fieldtargetobjects="Account,Asset,Campaign,Case,Contract,Ghost__c,Goal,LiveAgentSession,LiveChatTranscript,Metric,Opportunity,Order,Product2,Quote,Solution,Store__c,WorkCoaching" value="null" enclosevalueinquotes="false"/>
</enableconditions>
<label>Selected Contact</label>
</field>
<field uniqueid="sk-3xFHXP-186" id="Subject" valuehalign="" type=""/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<resources>
<labels/>
<javascript/>
<css/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>