first model update action doesn't run (11.1.7)

  • 1
  • Problem
  • Updated 7 months ago
  • Acknowledged
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 8 months ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Same error happens when cancelling the same model. Click Cancel once and nothing. Click Cancel a second time and it works.
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Thanks for posting a video explaining what you're seeing. From it, I have a few questions.

1. What is the behavior if you have no custom javascript? Does seeing this error require your custom code?
2. I noticed you first tried Jan 2 then tried Jan 3. What happens if you try Jan 2 twice instead of changing to Jan 3? Is it Jan 2 that is throwing the error or is it truly a first time / second time problem? I don't know if Jan 2 is a company holiday.
3. What happens if you start with End and then switch to Start? Do you still see the same behavior? I'm not sure if the model action will be fired until you change both. The model action requires some form of trigger. I'm wondering if the trigger starts after both start and end are selected. Thus, maybe your snippet won't fire until the second is chosen.

Hope to solve this soon!
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
  1. Works with and without snippet depending on if the record exists already.  On new records it works without issue. On existing records the issue occurs.
  2. Clicking on Jan. 2 twice doesn't do anything. It starts working on the second change. Strange.
  3. Switching between Start/End in any way makes no difference. It's the second change that triggers.
The issue seems isolated to Model Update on my custom Start__c/End__c fields using a snippet action on existing records.
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
The custom isolation has me puzzled as to what more I can do. Can you paste any XML of a repro page?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Have you attempted to recreate the issue? A simple snippet w/ console.log('test snippet has run') in the snippet should do reproduce.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
To reproduce skip to here on the video to reproduce.

Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
WOW!!! This is a super weird bug. A pain to find it.

To reproduce you'll need to create a custom object  called Time_Off__c. No need to add any fields.

Toggling "Hide Footer" in Table component within drawer exposes the bug. It's the code behind this checkbox as using CSS to hide the same footer doesn't affect the functionality.


<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models>
        <model id="Staff" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="User">
            <fields>
                <field id="Id"/>
                <field id="Name"/>
            </fields>
            <conditions>
                <condition type="fieldvalue" value="true" enclosevalueinquotes="false" field="IsActive"/>
            </conditions>
            <actions/>
        </model>
        <model id="TimeOff" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Time_Off__c">
            <fields>
                <field id="OwnerId"/>
                <field id="Owner.Name"/>
                <field id="Subject__c"/>
                <field id="Id"/>
            </fields>
            <conditions>
                <condition type="modelmerge" value="" field="OwnerId" fieldtargetobjects="Group,User" operator="in" model="Staff" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="deactivate"/>
            </conditions>
            <actions/>
        </model>
    </models>
    <components>
        <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="false" model="Staff" buttonposition="" mode="readonly" allowcolumnreordering="true" responsive="true" uniqueid="sk-2Mg2-361">
            <fields>
                <field id="Name" uniqueid="sk-2Mg2-369"/>
            </fields>
            <rowactions>
                <action type="drawer" label="Run multiple actions" icon="sk-icon-magic">
                    <drawer title="Drawer Area" width="90%" closehandle="true">
                        <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="TimeOff" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-2Mg2-406">
                                <fields>
                                    <field id="Subject__c" hideable="true" uniqueid="fi-2Mg2-479"/>
                                    <field id="OwnerId" hideable="true" uniqueid="fi-2Mg2-480"/>
                                </fields>
                                <rowactions>
                                    <action type="edit"/>
                                    <action type="delete"/>
                                </rowactions>
                                <massactions usefirstitemasdefault="true">
                                    <action type="massupdate"/>
                                    <action type="massdelete"/>
                                </massactions>
                                <views>
                                    <view type="standard"/>
                                </views>
                                <conditions>
                                    <condition type="contextrow" field="OwnerId" mergefield="Id" operator="=" fieldtargetobjects="Group,User"/>
                                </conditions>
                                <actions defaultlabel="Global Actions" defaulticon="sk-icon-magic" usefirstitemasdefault="true">
                                    <action type="multi" label="Add Paid Time Off" icon="sk-webicon-font-awesome:plus-circle">
                                        <actions>
                                            <action type="createRow" model="TimeOff" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context"/>
                                            <action type="showPopup">
                                                <popup title="Time Off Request" width="800px">
                                                    <components>
                                                        <basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="TimeOff" uniqueid="sk-2Mg2-573" mode="edit">
                                                            <columns>
                                                                <column width="100%">
                                                                    <sections>
                                                                        <section title="Section A" collapsible="no" showheader="false">
                                                                            <fields>
                                                                                <field uniqueid="sk-2Mg2-603" id="Subject__c"/>
                                                                                <field uniqueid="sk-2Mg2-604" id="OwnerId"/>
                                                                            </fields>
                                                                        </section>
                                                                    </sections>
                                                                </column>
                                                            </columns>
                                                            <conditions>
                                                                <condition type="contextrow" field="Id" mergefield="Id"/>
                                                            </conditions>
                                                        </basicfieldeditor>
                                                    </components>
                                                    <afterclose>
                                                        <action type="cancel">
                                                            <models>
                                                                <model>TimeOff</model>
                                                            </models>
                                                        </action>
                                                    </afterclose>
                                                </popup>
                                            </action>
                                        </actions>
                                    </action>
                                </actions>
                            </skootable>
                        </components>
                    </drawer>
                </action>
            </rowactions>
            <massactions usefirstitemasdefault="true"/>
            <views>
                <view type="standard"/>
            </views>
        </skootable>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css>
            <cssitem location="inline" name="newcss" cachelocation="false">/*.nx-list-footer {*/
/*    display:none;*/
/*}*/</cssitem>
        </css>
        <actionsequences uniqueid="sk-2Mg2-236"/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
(Edited)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
^^^ bump ^^^
Photo of Matthew Leahy

Matthew Leahy, Employee

  • 592 Points 500 badge 2x thumb
Pat,

I'm a bit late to the conversation, but I'll set up your situation to see if I can get an issue reported. I'll contact Stephen first.

Thank you for your patience.
Photo of Matthew Leahy

Matthew Leahy, Employee

  • 592 Points 500 badge 2x thumb
Well, I double checked and do have the footer hidden. Just for grins, I created a new page with the XML shared above. Still works.

I am with you on this one as your video is clearly showing the behavior.

Let me get some other eyes and/or suggestions on next steps.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Did you copy/paste the XML? Just remove the Subject__c field.
Photo of Matthew Leahy

Matthew Leahy, Employee

  • 592 Points 500 badge 2x thumb
Finally. I see the bad behavior AND I will report it. Thanks for bearing with me.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
No worries.
Photo of Matthew Leahy

Matthew Leahy, Employee

  • 592 Points 500 badge 2x thumb
FYI: Issue reported and slated for review.