Skip to main content
Nintex Community Menu Bar

We have some products where we can add child lines. We want to update the child line anytime there is update on parent line with start date. I have used UI model which did not work. Used branch on parent line to update child line it is updating all child line. If I add (parent line id = id) on this branch it does not update child line at all. need help with this.

Hey @msandhu,


I’m looking into this now with the team and will get back to you as soon as I can.


Thanks,


Hey @msandhu


  • ,

    Just got work back from the team with a solution for you:


    I think you can achieve this effect using model actions, branch logic, and a couple of models. It looks like what you’re missing is that you will want to use a separate (possibly hidden from the UI) model to do the childline updating so you don’t end up updating all child lines.


    Here’s the suggested setup:


    Parent line: add a model action that runs when any field in the parent model is updated. In the list of actions, do the branch logic NOT(ISBLANK({{StartDate}})). If true, activate/set condition of the childline model and query it to get the child lines for this product. Then you can update the field.




Childline: Add a model condition where you can pass the Id of the parent line. Note that you may need 2 child line models, one to show in the UI (you’ll refresh this after all the updating is completed), one to do the update.

Attached is an example XML of my repro of your scenario based on your description (instead of product and childline, I’m using Opp and OppLineItems).


I hope this helps and let me know if you have any questions.


update-child-lines.gif


XML:


<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" showheader="false" theme="Ink">
<models>
<model id="Opp" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity" orderby="Name">
<fields>
<field id="AccountId"/>
<field id="Account.Name"/>
<field id="Name"/>
<field id="CloseDate"/>
</fields>
<conditions/>
<actions>
<action>
<actions>
<action type="branch" whenfinished="stop" model="Opp" label="Update child lines if the Close Date isn't blank">
<formula>NOT(ISBLANK({{CloseDate}}))</formula>
<iftrueactions>
<action type="action-sequence" action-sequence-id="cc860328-e843-4004-9e44-811967c7742b">
<inputs>
<input name="OppId" value="{{Id}}"/>
<input name="CloseDate" value="{{CloseDate}}"/>
</inputs>
</action>
</iftrueactions>
</action>
</actions>
<events>
<event>row.updated</event>
</events>
<fields>
<field>CloseDate</field>
</fields>
</action>
</actions>
</model>
<model id="OppLineItems_Context" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="OpportunityLineItem">
<fields>
<field id="OpportunityId"/>
<field id="Opportunity.Name"/>
<field id="Name"/>
<field id="ServiceDate"/>
</fields>
<conditions>
<condition type="fieldvalue" value="" enclosevalueinquotes="true" field="OpportunityId" fieldtargetobjects="Opportunity" clientorserver="server" state="filterableoff" inactive="true" name="OpportunityId"/>
</conditions>
<actions>
<action>
<actions>
<action type="requeryModels" behavior="standard">
<models>
<model>OppLineItems_All</model>
</models>
</action>
</actions>
<events>
<event>models.saved</event>
</events>
</action>
</actions>
</model>
<model id="OppLineItems_All" limit="200" query="true" createrowifnonefound="false" datasource="salesforce" sobject="OpportunityLineItem">
<fields>
<field id="OpportunityId"/>
<field id="Opportunity.Name"/>
<field id="Name"/>
<field id="ServiceDate"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<skuid__grid uniqueid="sk-3i9m-11645" flexDirection="row" justifyContent="flex-start" alignItems="flex-start" columnGutter="2">
<divisions>
<division minWidth="100px" ratio="1">
<components>
<skuid__table allowColumnFreezing="dragDrop" model="Opp" uniqueid="sk-3i9o-13266" mode="read" title="Opps" pageSize="Infinity" showPageSizeSelect="false" resetPaginationOnQuery="false" showListFooter="false">
<fields>
<field id="Name" uniqueid="fi-3i9v-17882"/>
<field id="CloseDate" uniqueid="fi-3i9v-17883"/>
</fields>
<filtering enableSearch="false"/>
<actions/>
<rowActions/>
<massActions/>
<exportProperties useTableColumns="true"/>
<sorting enable="false"/>
</skuid__table>
</components>
</division>
<division alignSelf="auto" minWidth="100px" ratio="1">
<components>
<skuid__table allowColumnFreezing="dragDrop" model="OppLineItems_Context" uniqueid="sk-3iAK-24303" mode="read" title="{{Opportunity.Name}} - Opp Line Items" pageSize="10" showListFooter="false">
<fields>
<field id="OpportunityId" uniqueid="sk-3iAK-24304"/>
<field id="ServiceDate" uniqueid="sk-3iAK-24305"/>
</fields>
<filtering enableSearch="false"/>
<actions/>
<rowActions/>
<massActions/>
<exportProperties useTableColumns="true"/>
<sorting enable="false"/>
<styles>
<spacing bottom="3"/>
</styles>
</skuid__table>
<skuid__table allowColumnFreezing="dragDrop" model="OppLineItems_All" uniqueid="sk-3i9p-13888" mode="read" title="All Opp Line Items" pageSize="10" showListFooter="false">
<fields>
<field id="OpportunityId" uniqueid="fi-3iAD-20833"/>
<field id="ServiceDate" uniqueid="fi-3iAD-20834"/>
</fields>
<filtering enableSearch="false"/>
<actions/>
<rowActions/>
<massActions/>
<exportProperties useTableColumns="true"/>
<sorting enable="false"/>
</skuid__table>
</components>
</division>
</divisions>
<styles>
<spacing left="3" right="3"/>
</styles>
<background/>
</skuid__grid>
</components>
<resources>
<labels/>
<javascript/>
<css/>
<actionsequences>
<actionsequence id="cc860328-e843-4004-9e44-811967c7742b" label="Update child lines" type="reusable">
<actions>
<action type="updateCondition" model="OppLineItems_Context" behavior="set" valuesource="fieldvalue" value="{{$Input.OppId}}" condition="OpportunityId"/>
<action type="requeryModels" behavior="standard">
<models>
<model>OppLineItems_Context</model>
</models>
</action>
<action type="updateRow" fieldmodel="OppLineItems_Context" affectedrows="all">
<updates>
<update valuesource="fieldvalue" field="ServiceDate" enclosevalueinquotes="false" sourcemodel="Opp" value="{{$Input.CloseDate}}"/>
</updates>
</action>
</actions>
<description/>
<inputs>
<input type="value" name="OppId"/>
<input type="value" name="CloseDate"/>
</inputs>
</actionsequence>
</actionsequences>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
<interactions/>
<background/>
</skuid__page>

Reply