Hello -
When a wizard button is marked as “run multiple actions” and one of the steps is “Save Models” and if there is more than one model selected to be saved, error messages are not displaying. If only one model is selected for save, error message display properly.
Analysis
In wizard.step.button case “multi”, step.editor.models.length = 0 when multiple models are involved but when only a single model is involved, step.editor.models.length = 1.
Steps to Reproduce
- Create Account “new” page
- Remove all default components
- Change model name of Account to “AccountOne”
- Add another account model (don’t load, create new, add Name & Id) called “AccountTwo”
- Add wizard with single step
- Add two fields editors with single field for “Name” using AccountOne and AccountTwo
- Add wizard button - Run Multiple, Save Models including AccountOne and AccountTwo
- Preview page
- Click wizard button
Actual Result
Save does not occur but no error messages
Expected Result
Save does not occur and error messages are displayed
Notes:
- The sample page contains two wizards - One as described above and the other configured identical but with “save models” only specifying a single model. Pressing the button on this wizard properly displays error messages
- If another button is added to the wizard that saves multiple models and that button contains only a single model to save (or uses the standard save instead of run multi), error messages are displayed when clicking the button added in Step #6. This appears to be due to the fact that step.editor.models.length = 1 due to the 2nd button
- A couple of posts that might be related
a) https://community.skuid.com/t/standard-error-messages-are-not-displaying-when-data-mod… - This one solved the problem by using stock “save” but that is not an option in my case unfortunately. Need to be able to run multi.
b) https://community.skuid.com/t/not-able-to-see-required-field-error-message-when-clicki…, - This one appears similar but never had a solution.
Sample Page XML
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account"> <models>
<model id="AccountOne" limit="1" query="false" createrowifnonefound="true" sobject="Account">
<fields>
<field id="Id"/>
<field id="Name"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="AccountTwo" limit="1" query="false" createrowifnonefound="true" sobject="Account">
<fields>
<field id="Id"/>
<field id="Name"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="AccountThree" limit="1" query="false" createrowifnonefound="true" sobject="Account">
<fields>
<field id="Id"/>
<field id="Name"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<wizard deferstepcontentsrendering="false">
<steps>
<step stepid="step1" steplabel="Step 1">
<components>
<basicfieldeditor showsavecancel="false" showheader="true" model="AccountOne" mode="edit" buttonposition="" layout="">
<columns>
<column width="100%">
<sections>
<section title="Basics">
<fields>
<field id="Name"/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
<basicfieldeditor showsavecancel="false" showheader="true" model="AccountTwo" mode="edit" buttonposition="" layout="">
<columns>
<column width="100%">
<sections>
<section title="Basics">
<fields>
<field id="Name"/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<actions>
<action type="multi" label="Save Account One &amp; Two" stepid="step1" window="self">
<actions>
<action type="blockUI" message="Saving..."/>
<action type="save" rollbackonanyerror="true">
<models>
<model>AccountOne</model>
<model>AccountTwo</model>
</models>
<onerroractions>
<action type="blockUI" message="There was an error" timeout="3000"/>
</onerroractions>
</action>
<action type="unblockUI"/>
</actions>
</action>
</actions>
</step>
</steps>
</wizard>
<wizard deferstepcontentsrendering="false">
<steps>
<step stepid="step1" steplabel="Step 1">
<components>
<basicfieldeditor showsavecancel="false" showheader="true" model="AccountThree" mode="edit" buttonposition="" layout="">
<columns>
<column width="100%">
<sections>
<section title="Basics">
<fields>
<field id="Name"/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<actions>
<action type="multi" label="Save Account Three" stepid="step1" window="self">
<actions>
<action type="blockUI" message="Saving..."/>
<action type="save" rollbackonanyerror="true">
<models>
<model>AccountThree</model>
</models>
<onerroractions>
<action type="blockUI" message="There was an error" timeout="3000"/>
</onerroractions>
</action>
<action type="unblockUI"/>
</actions>
</action>
</actions>
</step>
</steps>
</wizard>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
</skuidpage>
Thanks!