Bug creating new row when action type selected is Run Multiple Action

  • 1
  • Problem
  • Updated 2 months ago
  • In Progress
I'm trying to add a set of row from one model to another by using massactions. Basically from one object to another object. I have an opportunity and to that opportunity i have selected a 'Program' and later I want to select deliverable(s)  associated to the program. I'm using a Popup to do that. When I use Action type Multi (as I want to pass some condition before loading the pop up screen) instead of popup directly, I'm not able to add the row selected but if I use action type popup then I'm able to do so. I thought it might be because of the condition that I'm passing and hence the error. So I decided to use Action type Mutli to Popup the screen without passing on any condition and I'm still having the error. 

Error: I clicked Add D but only a single row is created in the screen behind.


Also, Including the XML for reference. The difference in this one and the one that works is the action type for the below xml is " Run Multiple Action" while the other one is "Popup". Let me if this a bug or Am I missing something?.

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true" theme="Ice Age">
    <models>
        <model id="OpportunityPrg" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity_Program__c">
            <fields>
                <field id="Name"/>
                <field id="Id"/>
                <field id="Program__c"/>
                <field id="Program__r.Name"/>
                <field id="Opportunity__c"/>
                <field id="Opportunity__r.Name"/>
                <field id="Program__r.Id"/>
                <field id="Oppty_Agreement_Date__c"/>
                <field id="Deliverables__c"/>
                <field id="Project_Size__c"/>
            </fields>
            <conditions>
                <condition type="fieldvalue" value="a0N1D000000RSrvUAG" field="Id" operator="=" mergefield="Id" novaluebehavior="deactivate" enclosevalueinquotes="true"/>
            </conditions>
            <actions/>
        </model>
        <model id="ProgramDeliverable" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Program_Deliverable__c">
            <fields>
                <field id="RecordTypeId"/>
                <field id="Id"/>
                <field id="Deliverable_Name__c"/>
                <field id="Deliverable_Category__c"/>
                <field id="Program__c"/>
                <field id="Program__r.Name"/>
                <field id="Deliverable__c"/>
                <field id="Deliverable__r.Name"/>
                <field id="Process__c"/>
                <field id="Acronym__c"/>
                <field id="Standard__c"/>
            </fields>
            <conditions>
                <condition type="fieldvalue" value="true" enclosevalueinquotes="false" field="Standard__c"/>
                <condition type="modelmerge" value="" field="Program__c" fieldtargetobjects="Program__c" operator="=" model="OpportunityPrg" enclosevalueinquotes="true" mergefield="Program__r.Id" novaluebehavior="deactivate" inactive="false"/>
            </conditions>
            <actions>
                <action>
                    <actions>
                        <action type="createRow" model="OpportunityprgDeliverable" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
                            <defaults>
                                <default type="fieldvalue" field="Deliverable__r.Name" fieldtargetobjects="Opportunity_Program__c" enclosevalueinquotes="true" value="Final PSDM Depth-Interval Velocity Model"/>
                                <default type="fieldvalue" field="Deliverable_Category__c" fieldtargetobjects="Opp_Program_Deliverable__c" enclosevalueinquotes="true" value="Non-Standard"/>
                            </defaults>
                        </action>
                        <action type="showPopup">
                            <popup title="New Popup" width="90%">
                                <components>
                                    <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="OpportunityprgDeliverable" buttonposition="" mode="edit" allowcolumnreordering="true" responsive="true" uniqueid="sk-24Ej-457">
                                        <fields>
                                            <field id="Deliverable__c" hideable="true" uniqueid="fi-24Eq-492"/>
                                            <field id="Deliverable__r.Name" hideable="true" uniqueid="fi-24Es-504"/>
                                            <field id="Deliverable_Category__c" hideable="true" uniqueid="fi-24Et-516"/>
                                            <field id="Opportunity_Program__c" hideable="true" uniqueid="fi-24Et-527"/>
                                        </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>
                            </popup>
                        </action>
                    </actions>
                    <events>
                        <event>models.loaded</event>
                    </events>
                </action>
            </actions>
        </model>
        <model id="OpportunityprgDeliverable" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opp_Program_Deliverable__c" limit="100">
            <fields>
                <field id="Name"/>
                <field id="Deliverable__c"/>
                <field id="Deliverable__r.Name"/>
                <field id="Deliverable_Category__c"/>
                <field id="Opportunity_Program__c"/>
                <field id="Opportunity_Program__r.Name"/>
                <field id="Program_Deliverable__c"/>
                <field id="Program_Deliverable__r.Name"/>
                <field id="Opportunity_Program__r.Program__r.Id"/>
                <field id="Opportunity_Program__r.Id"/>
                <field id="Opportunity_Program__r.Program__c"/>
                <field id="Opportunity_Program__r.Program__r.Name"/>
                <field id="Deliverable__r.Id"/>
            </fields>
            <conditions>
                <condition type="modelmerge" value="" field="Opportunity_Program__c" fieldtargetobjects="Opportunity_Program__c" operator="=" model="OpportunityPrg" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="deactivate" inactive="false"/>
            </conditions>
            <actions/>
        </model>
    </models>
    <components>
        <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="OpportunityPrg" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-1DLh-606">
            <fields>
                <field id="Name" uniqueid="fi-1DLh-607"/>
                <field id="Id" uniqueid="fi-1DLh-608"/>
                <field id="Program__c" uniqueid="fi-1DLh-609"/>
                <field id="Program__r.Name" uniqueid="fi-1DLh-610"/>
                <field id="Opportunity__c" uniqueid="fi-1DLh-611"/>
                <field id="Opportunity__r.Name" uniqueid="fi-1DLh-612"/>
                <field id="Oppty_Agreement_Date__c" hideable="true" uniqueid="fi-1PLP-432"/>
                <field id="Project_Size__c" hideable="true" uniqueid="fi-24FL-613"/>
            </fields>
            <rowactions>
                <action type="edit"/>
                <action type="multi" label="View record details" icon="sk-icon-popup">
                    <actions>
                        <action type="showPopup">
                            <popup width="80%" title="Viewing {{Model.label}}: {{Name}}">
                                <components>
                                    <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="OpportunityprgDeliverable" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-23Ap-322">
                                        <fields>
                                            <field id="Name" hideable="true" uniqueid="fi-23At-366"/>
                                            <field id="Opportunity_Program__c" hideable="true" uniqueid="fi-23Av-401"/>
                                            <field id="Deliverable__c" hideable="true" uniqueid="fi-23At-378"/>
                                            <field id="Deliverable__r.Name" hideable="true" uniqueid="fi-23Au-389"/>
                                            <field id="Deliverable_Category__c" hideable="true" uniqueid="fi-23B0-419"/>
                                        </fields>
                                        <rowactions>
                                            <action type="edit"/>
                                            <action type="delete"/>
                                        </rowactions>
                                        <massactions usefirstitemasdefault="true"/>
                                        <views>
                                            <view type="standard"/>
                                        </views>
                                        <conditions>
                                            <condition type="contextrow" field="Opportunity_Program__c" mergefield="Id" autocreated="true" operator="="/>
                                        </conditions>
                                        <actions defaultlabel="Global Actions" defaulticon="sk-icon-magic" usefirstitemasdefault="true">
                                            <action type="multi" label="Add Deli" icon="sk-icon-magic">
                                                <actions>
                                                    <action type="showPopup">
                                                        <popup title="New Popup" width="90%">
                                                            <components>
                                                                <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="ProgramDeliverable" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-23BE-485">
                                                                    <fields>
                                                                        <field id="Id" hideable="true" uniqueid="fi-23BJ-516"/>
                                                                        <field id="Deliverable__c" hideable="true" uniqueid="fi-23BL-529"/>
                                                                        <field id="Deliverable__c" hideable="true" uniqueid="fi-23BM-541"/>
                                                                        <field id="Deliverable_Name__c" hideable="true" uniqueid="fi-23BT-584"/>
                                                                        <field id="Standard__c" hideable="true" uniqueid="fi-23Bi-647"/>
                                                                    </fields>
                                                                    <rowactions>
                                                                        <action type="edit"/>
                                                                        <action type="delete"/>
                                                                    </rowactions>
                                                                    <massactions usefirstitemasdefault="true">
                                                                        <action type="multi" label="add d">
                                                                            <actions>
                                                                                <action type="createRow" model="OpportunityprgDeliverable" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
                                                                                    <defaults>
                                                                                        <default type="fieldvalue" field="Deliverable__c" fieldtargetobjects="Deliverables__c" enclosevalueinquotes="true" value="{{Deliverable__c}}"/>
                                                                                        <default/>
                                                                                    </defaults>
                                                                                </action>
                                                                            </actions>
                                                                        </action>
                                                                    </massactions>
                                                                    <views>
                                                                        <view type="standard"/>
                                                                    </views>
                                                                </skootable>
                                                            </components>
                                                        </popup>
                                                    </action>
                                                </actions>
                                            </action>
                                        </actions>
                                    </skootable>
                                </components>
                            </popup>
                        </action>
                    </actions>
                </action>
            </rowactions>
            <massactions usefirstitemasdefault="true"/>
            <views>
                <view type="standard"/>
            </views>
        </skootable>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
        <actionsequences uniqueid="sk-1DL5-262"/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
    <interactions/>
</skuidpage>

Photo of Toms Vineeth John

Toms Vineeth John

  • 428 Points 250 badge 2x thumb
  • frustrated

Posted 2 months ago

  • 1
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Thank you for posting the XML. It's very helpful. However, because the models are on custom objects, I can't test it. If you could post a repro of all standard objects and fields, we could test and use that.

I can see your row actions and your global actions. All these actions do is create a pop up. I don't see anything that triggers a requery to where the model actions on ProgramDeliverable will happen. I don't see a proper set up that would seem to create new row. All the models are queried on page load and launching a pop up won't necessarily do anything separate.
Photo of Toms Vineeth John

Toms Vineeth John

  • 428 Points 250 badge 2x thumb
Is there way, we could have call and I can show the issue or do I need to communicate with you here on the post?  

With regards to the global action only doing the popup, I had removed all the other actions like 'activate and set conditions' and then do the 'query' action. Currently, in this setup I will only have a single opportunity program/project  and other other two model will look into the opportunity program model for information. But, in reality I will have multiple Opportunity Program/Projects and I will have to use "Run Multiple Action" before creating a Pop Up.  With regards to  create row, 

 <action type="createRow" model="OpportunityprgDeliverable" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
                                                                                    <defaults>
                                                                                        <default type="fieldvalue" field="Deliverable__c" fieldtargetobjects="Deliverables__c" enclosevalueinquotes="true" value="{{Deliverable__c}}"/>
                                                                                       
Photo of Toms Vineeth John

Toms Vineeth John

  • 428 Points 250 badge 2x thumb
Also, I want to point out that the reason I used Action Type Run Multiple Action vs Pop up was to show that, when I use Run Multiple Action to create pop up I have this issue but if I use Pop up directly then it works perfectly fine. The reason I want to use Run Multiple Action is, to use Activate and Set Condition and Query action since I'm using table. 
Photo of Matt Davis

Matt Davis, Employee

  • 654 Points 500 badge 2x thumb
One trick that may help with mass actions - figuring out context can make things difficult. What I've done in a similar use case in the past is this....

ModelFrom = Taking rows from here
ModelTo = Adding rows here

  • On ModelFrom, create a UI-only checkbox
  • Create a model action for when the checkbox is updated, in this model action do your create row and default fields to {{whateverfield}}
  • In the mass action, just have the action to update the UI-only checkbox (if users could do multiple times, you'll need a branch that checks it if its unchecked and unchecks it if its checked
So when a user selects 5 rows and runs the mass action, each row individually starts running the model action. This helps keep things in context, since they are each running on their own.