Skip to main content

Hey Skuid Product team,


You know I have much love for all the great work you do. However, I want to emphatically shine light on a bug that is 3 years overdue.


https://community.skuid.com/t/no-error-on-blank-required-field-with-add-none-option

If a field is marked as required in the Page Composer (not on SFDC object level), the save action should not execute. 

This is proving extremely difficult and costly to build workarounds for…e.g. JS snippets to validate if fields on page have values, custom error handling branch actions, etc.

In the most recent Nautilus Notes, you said you wanted feedback…even the hard stuff, so here it is:

Required fields should throw a required error message upon save. Please patch.

Thanks,

Conlan

Conlan, I really appreciate the feedback. I just went and tested and it seems to be working for me - fields marked as required at the Skuid level stop a Save action in a wizard. Am I understanding the problem correctly? I’m in Spark V1, rendered in VF.



This is what the action sequence looks like:


What’s the field type of the field you’re making required?


Thanks Matt. I’ve got some 20+ fields (text, date, picklist, etc.) on this particular step, and experienced it on other steps of this page, and in other environments (spent the weekend putting in a workaround in another environment), and seen other users report it here in the community (here for example).

This particular environment is running 11.2.6. Specifically, the issue occurs when no changes are made to the fields in that model. So if a user clicks too fast through the wizard without filling out any questions/fields, the save error does not throw. If however the user updates at least one of the fields, then the system detects changes, and will throw the error upon saving.


Matt - I just tested this on Skuid platform (v1 page) and same result. See screencast here: http://recordit.co/7h7yOr9m3r



Ok, interesting. If they click through slowly but don’t make any changes, does the error still throw? I’m wondering if it’s an issue with the UI ‘catching up’ to a fast clicker, or something related to default values and the model state.


Hmm, I just tested on V1 Platform, same result as before. Did you check “Roll Back Entire Save on Any Error” on your model save action?


No a catching up issue…I can let the page sit there for over a minute, and still click through. Yes, I’ve got rollback entire save checked. 

I think it could be a default values and model state thing…I often like to use UI-Only Checkboxes in Branch Action Formulas, and I always have to Check and then Uncheck the box in a Event-Triggered Page Load action sequence to get the page to recognize the value.


What are the field properties for that Vanity Label field? If it’s a number, is it possible that it’s showing as blank, but in the data it’s “0”? Boolean fields can be difficult, as they really have three options: True, False and null (which is often the default state). For conditions around checkboxes, I will often set logic to be = Not True (as opposed to = False) to account for a default null state. 


Still no luck recreating this - tried a number field, a UI-only field, tested default values, and the rules are being enforced every time. If you can share those field properties, it may help identify the issue.


Good to know for default states of UI-Only checkboxes…back to issue at hand though…


Here is another example in the screencast link below, again from Skuid Platform (v1) where I have a handful of different field types, and the save error message only throws when a change is detected to any of these value:


http://recordit.co/3AWrawnF80


Could you paste the XML? Thanks!


Number (Double) Field String/Text Field Date Field Picklist Field Eng



Number (Double) Field String/Text Field Date Field Picklist Field Eng


<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">
<models>
<model id="Eng" query="true" createrowifnonefound="false" datasource="SalesforcePACT" processonclient="true" limit="1" sobject="Engineering_Services__c">
<fields>
<field id="AFE_Qty__c" accessible="true" createable="true" editable="true" filterable="true" sortable="true" scale="2" precision="18" displaytype="DOUBLE" label="AFE_Qty"/>
<field id="AFE_Type__c" accessible="true" createable="true" editable="true" filterable="true" groupable="true" sortable="true" length="50" displaytype="STRING" label="AFE_Type"/>
<field id="AR_Hand_Off_Date_rev_x_Actual__c" accessible="true" createable="true" editable="true" filterable="true" groupable="true" sortable="true" displaytype="DATE" label="AR Hand Off Date rev x Actual"/>
<field id="AR_Hand_Off_Risk_rev_x__c" accessible="true" createable="true" editable="true" filterable="true" groupable="true" sortable="true" length="255" defaultvalue="Low" displaytype="PICKLIST" label="AR Hand Off Risk rev x"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<grid uniqueid="sk-1DYd-600">
<divisions>
<division behavior="flex" minwidth="100px" ratio="1">
<components/>
</division>
<division behavior="flex" verticalalign="top" minwidth="100px" ratio="1">
<components>
<wizard deferstepcontentsrendering="false" buttonslocation="top" uniqueid="sk-1DYb-582">
<steps>
<step stepid="step1" steplabel="Step 1">
<components>
<basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="Eng" uniqueid="sk-1DYa-555" mode="edit">
<columns>
<column width="100%" uniqueid="sk-1DYa-551">
<sections>
<section title="Section A" uniqueid="sk-1DYa-552" collapsible="no" showheader="false">
<fields>
<field uniqueid="sk-1DYa-556" id="AFE_Qty__c" required="true">
<label>Number (Double) Field</label>
</field>
<field uniqueid="sk-1DYa-557" id="AFE_Type__c" required="true">
<label>String/Text Field</label>
</field>
<field uniqueid="sk-1DYa-558" id="AR_Hand_Off_Date_rev_x_Actual__c" required="true">
<label>Date Field</label>
</field>
<field uniqueid="sk-1DYa-559" id="AR_Hand_Off_Risk_rev_x__c" required="true" addnoneoption="true">
<label>Picklist Field</label>
</field>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<actions>
<action uniqueid="sk-1DYb-579" type="multi" stepid="step2" label="Next Step" icon="sk-icon-arrow-right" window="self">
<actions>
<action type="save" rollbackonanyerror="true">
<models>
<model>Eng</model>
</models>
<onerroractions>
<action type="blockUI" message="There was an error" timeout="3000"/>
</onerroractions>
</action>
<action type="navigateToStep" stepid="step2"/>
</actions>
</action>
</actions>
</step>
<step stepid="step2" steplabel="Step 2">
<components/>
<actions>
<action uniqueid="sk-1DYb-580" type="navigate" stepid="step1" label="Previous Step" icon="sk-icon-arrow-left" secondary="true"/>
<action uniqueid="sk-1DYb-581" type="navigate" label="Next Step" icon="sk-icon-arrow-right"/>
</actions>
</step>
</steps>
</wizard>
</components>
</division>
<division behavior="flex" verticalalign="top" minwidth="100px" ratio="1">
<components/>
</division>
</divisions>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</grid>
</components>
<resources>
<labels/>
<javascript/>
<css/>
<actionsequences uniqueid="sk-1DYU-509">
<actionsequence id="023462f8-ed68-4812-82ed-047693898fd1" label="Page Load" type="event-triggered" event-scope="component" event-name="page.rendered">
<description/>
<actions>
<action type="updateRow" fieldmodel="Eng" affectedrows="context">
<updates>
<update valuesource="fieldvalue" field="AFE_Type__c" enclosevalueinquotes="true" value="x"/>
</updates>
</action>
<action type="updateRow" fieldmodel="Eng" affectedrows="context">
<updates>
<update valuesource="fieldvalue" field="AFE_Type__c" enclosevalueinquotes="true"/>
</updates>
</action>
</actions>
</actionsequence>
</actionsequences>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

Hey Matt, have you been able to reproduce? If not, I can try and grab some examples from other environments where I have experienced this issue. Let me know if that would be helpful. Thanks!


<skuidpage unsavedchangeswarning="yes"> <models> <model id="PRC_Form_Employment__Item" limit="1" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Track_Item__c"> <fields> <field id="RecordTypeId"/> <field id="Id"/> <field id="Name"/> <field id="Track__c"/> <field id="Track__r.Name"/> <field id="Track__r.Client__c"/> <field id="Track__r.Client__r.Name"/> <field id="Status__c"/> </fields> <conditions> <condition type="param" value="id" field="Id" operator="=" enclosevalueinquotes="true" novaluebehavior="noquery"/> </conditions> <actions/> </model> <model id="PRC_Form_Employment__Contact" limit="1" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Contact"> <fields> <field id="RecordTypeId"/> <field id="Id"/> <field id="Name"/> <field id="Employment_Status__c"/> <field id="Employer_Name__c"/> <field id="Employer_Phone__c"/> <field id="Part_Owner_of_Business__c"/> <field id="Occupation__c"/> <field id="Business_Name__c"/> <field id="OtherAddress"/> <field id="Years_in_Current_Primary_Occupation__c"/> <field id="Percent_Business_Ownership__c"/> <field id="Number_of_Full_Time_Employees__c"/> <field id="Number_of_Partners_in_Partnership__c"/> <field id="Occupational_Duty_1_Description__c"/> <field id="Occupational_Duty_2_Description__c"/> <field id="Occupational_Duty_3_Description__c"/> <field id="Occupational_Duty_1_Percent__c"/> <field id="Occupational_Duty_2_Percent__c"/> <field id="Occupational_Duty_3_Percent__c"/> <field id="Percent_of_Work_Spent_in_Bending__c"/> <field id="Percent_of_Work_Spent_in_Carrying__c"/> <field id="Percent_of_Work_Spent_in_Climbing_Ramps__c"/> <field id="Percent_of_Work_Spent_in_Stairs__c"/> <field id="Percent_of_Work_Spent_in_Climbing_Ropes__c"/> <field id="Percent_of_Work_Spent_in_Climbing_Ladder__c"/> <field id="Percent_of_Work_Spent_in_Crawling__c"/> <field id="Percent_of_Work_Spent_in_Crouching__c"/> <field id="Percent_of_Work_Spent_in_Kneeling__c"/> <field id="Percent_of_Work_Spent_in__c"/> <field id="Percent_of_Work_Spent_in_Pushing_Pulling__c"/> <field id="Percent_of_Work_Spent_Reaching_Overhead__c"/> <field id="Percent_of_Work_Spent_in_Sitting__c"/> <field id="Percent_of_Work_Spent_in_Stooping__c"/> <field id="Percent_of_Other_Work_Spent__c"/> <field id="Worked_Full_Continuously_in_Last_50_Days__c"/> <field id="Plan_to_Change_Occupation_within_2_Years__c"/> <field id="Details_of_Planned_Occupation_Change__c"/> <field id="OtherCity"/> <field id="OtherState"/> <field id="OtherPostalCode"/> <field id="Years_with_Current_Employer__c"/> <field id="Second_Job__c"/> <field id="Second_Employer__c"/> <field id="New_Job_Start_Date__c"/> <field id="Months_with_Current_Employer__c"/> <field id="Employer_Address__c"/> <field id="Employer_City__c"/> <field id="Employer_State__c"/> <field id="Employer_Zip__c"/> <field id="Worked_Part_Time_in_Last_50_Days__c"/> <field id="Full_Time_not_past_50_days__c"/> <field id="Part_Time_not_past_50_days__c"/> </fields> <conditions> <condition type="modelmerge" value="" field="Id" operator="=" novaluebehavior="noquery" model="PRC_Form_Employment__Item" enclosevalueinquotes="true" mergefield="Track__r.Client__c" fieldtargetobjects="Contact"/> </conditions> <actions/> </model> </models> <pageregioncontents> <pageregioncontent regionid="sk-1m94-655" uniqueid="sk-2rcS-235"> <components> <wrapper uniqueid="sk-2rcV-277" cssclass="pr-form-content has-footer"> <components> <wrapper uniqueid="pr-form-header-wrapper" cssclass="pr-form-header"> <components> <grid uniqueid="pr-form-header-content" columngutter="1em" rowgutter="1em"> <divisions> <division behavior="fit" verticalalign="center"> <components> <image source="staticresource" uniqueid="pr-form-icon" datasource="salesforce" behavior="none" resource="SLDS_Icons" resourceContentType="application/zip" path="action/new_custom18.svg"> <styles> <styleitem type="itemsize" width="custom" height="custom"> <styles> <styleitem property="width" value="24px"/> <styleitem property="height" value="24px"/> </styles> </styleitem> <styleitem type="border"/> <styleitem property="background" value="#ed1c23"/> <styleitem property="padding" value="6px"/> </styles> </image> </components> </division> <division behavior="flex" verticalalign="top" minwidth="100px" ratio="1"> <components> <template multiple="false" uniqueid="pr-form-title" allowhtml="true"> <contents>&amp;lt;div class="subtitle"&amp;gt;Form&amp;lt;/div&amp;gt; &amp;lt;div class="maintitle"&amp;gt;Employment Information&amp;lt;/div&amp;gt;</contents> </template> </components> </division> </divisions> <styles> <styleitem type="background" bgtype="none"/> </styles> </grid> </components> <styles> <styleitem type="background"/> <styleitem type="border"/> <styleitem type="size"/> </styles> </wrapper> <wizard deferstepcontentsrendering="false" buttonslocation="top" uniqueid="pr-form-wizard"> <steps> <step stepid="step1"> <components> <basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="PRC_Form_Employment__Contact" uniqueid="sk-1Rpx-303" mode="edit"> <columns layoutmode="responsive" columngutter="4px" rowgutter="4px"> <column uniqueid="sk-1Rpx-299" ratio="1" minwidth="300px" behavior="flex" verticalalign="top"> <sections> <section uniqueid="sk-1Rpx-300" collapsible="no" title="Employment Details"> <fields> <columns uniqueid="sk-1Rq3-431" layoutmode="responsive" columngutter="4px" rowgutter="4px"> <column uniqueid="sk-1Rq3-418" verticalalign="top" behavior="flex" ratio="1" minwidth="300px"> <sections> <section title="New Section" collapsible="no" uniqueid="sk-1Rq3-419" showheader="false"> <fields> <field uniqueid="sk-2fjP-282" id="Employment_Status__c" required="true" type="RADIO_BUTTONS" addnoneoption="true" nonelabel="--Select--"> <renderconditions logictype="and" onhidedatabehavior="keep"/> <enableconditions/> </field> <field uniqueid="sk-2fj--400" id="Employer_Name__c" required="true"> <label>Employer Name</label> <renderconditions logictype="and" onhidedatabehavior="keep"> <rendercondition type="multiple" operator="in" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Employment_Status__c" fieldtargetobjects="Contact" value="" enclosevalueinquotes="true"> <values> <value>W-2</value> <value>1099</value> <value/> </values> </rendercondition> </renderconditions> <enableconditions/> </field> <field uniqueid="sk-2fkE-440" id="Employer_Phone__c" required="true"> <label>Employer Phone Number</label> <renderconditions logictype="and" onhidedatabehavior="keep"> <rendercondition type="multiple" operator="in" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Employment_Status__c" fieldtargetobjects="Contact" value="" enclosevalueinquotes="true"> <values> <value>W-2</value> <value>1099</value> </values> </rendercondition> </renderconditions> <enableconditions/> </field> <field uniqueid="sk-1Mdp-606" id="Employer_Address__c" required="true" displayrows="2"> <label>Employer Street Address</label> <renderconditions logictype="and" onhidedatabehavior="keep"> <rendercondition type="multiple" operator="in" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Employment_Status__c" fieldtargetobjects="Contact" value="" enclosevalueinquotes="true"> <values> <value>W-2</value> <value>1099</value> </values> </rendercondition> </renderconditions> <enableconditions/> </field> <field uniqueid="sk-1Mhy-813" id="Employer_City__c" required="true"> <label>Employer City </label> <renderconditions logictype="and" onhidedatabehavior="keep"> <rendercondition type="multiple" operator="in" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Employment_Status__c" fieldtargetobjects="Contact" value="" enclosevalueinquotes="true"> <values> <value>W-2</value> <value>1099</value> </values> </rendercondition> </renderconditions> <enableconditions/> </field> <field uniqueid="sk-1Mhy-814" id="Employer_State__c" required="true" nonelabel="--Select--"> <label>Employer State</label> <renderconditions logictype="and" onhidedatabehavior="keep"> <rendercondition type="multiple" operator="in" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Employment_Status__c" fieldtargetobjects="Contact" value="" enclosevalueinquotes="true"> <values> <value>W-2</value> <value>1099</value> </values> </rendercondition> </renderconditions> <enableconditions/> </field> <field uniqueid="sk-1Mhy-815" id="Employer_Zip__c" required="true"> <label>Employer Zip Code</label> <renderconditions logictype="and" onhidedatabehavior="keep"> <rendercondition type="multiple" operator="in" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Employment_Status__c" fieldtargetobjects="Contact" value="" enclosevalueinquotes="true"> <values> <value>W-2</value> <value>1099</value> </values> </rendercondition> </renderconditions> <enableconditions/> </field> </fields> </section> <section title="New Section" collapsible="no" uniqueid="sk-1Rq4-437" showheader="false"> <fields> <columns uniqueid="sk-11VJ-630" layoutmode="fixed"> <column width="100%" uniqueid="sk-11VJ-617"> <sections> <section title="New Section" collapsible="no" uniqueid="sk-11VJ-618" showheader="false"> <fields> <field uniqueid="sk-11VN-651" id="Second_Job__c" required="true" addnoneoption="true" nonelabel="--Select--"> <label>Do you have an additional employer?</label> <renderconditions logictype="and" onhidedatabehavior="keep"> <rendercondition type="multiple" operator="in" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Employment_Status__c" fieldtargetobjects="Contact" value="" enclosevalueinquotes="true"> <values> <value>W-2</value> <value>1099</value> </values> </rendercondition> </renderconditions> <enableconditions/> </field> <field uniqueid="sk-11Vn-844" id="Second_Employer__c" readonly="false" required="true" displayrows="4"> <renderconditions logictype="and" onhidedatabehavior="keep"> <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Second_Job__c" fieldtargetobjects="Contact" value="Yes"/> <rendercondition type="multiple" operator="in" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Employment_Status__c" fieldtargetobjects="Contact" value="" enclosevalueinquotes="true"> <values> <value>W-2</value> <value>1099</value> </values> </rendercondition> </renderconditions> <enableconditions/> <label>Additional Employer Name, Phone, and Address</label> </field> </fields> </section> </sections> </column> </columns> </fields> </section> </sections> </column> <column behavior="flex" uniqueid="sk-11OM-1727" ratio="1" minwidth="300px" verticalalign="top"> <sections> <section title="Occupation Information" collapsible="no" uniqueid="sk-3bA4-581" showheader="false"> <fields> <field uniqueid="sk-2gWl-438" id="Occupation__c" showhelp="true" required="true"> <label>Occupation Title</label> </field> </fields> </section> <section title="New Section" collapsible="no" uniqueid="sk-11OM-1728" showheader="false"> <fields> <field uniqueid="sk-2l9f-372" id="Years_in_Current_Primary_Occupation__c" required="true" addnoneoption="true" nonelabel="--Select--"> <label>How many years have you been in your primary occupation?</label> <renderconditions logictype="and" onhidedatabehavior="keep"/> <enableconditions/> </field> <field uniqueid="sk-11Ej-710" id="Years_with_Current_Employer__c" required="true" addnoneoption="true" nonelabel="--Select--"> <label>How many years have you been employed at the business where you work?</label> <renderconditions logictype="and" onhidedatabehavior="keep"/> <enableconditions/> </field> <field uniqueid="sk-11Xj-590" id="Months_with_Current_Employer__c" required="true" addnoneoption="true" nonelabel="--Select--"> <label>How many months?</label> <renderconditions logictype="and" onhidedatabehavior="keep"> <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Years_with_Current_Employer__c" fieldtargetobjects="Contact" value="&amp;lt;1"/> </renderconditions> <enableconditions/> </field> <field uniqueid="sk-11Y7-793" id="New_Job_Start_Date__c" required="true"> <renderconditions logictype="and" onhidedatabehavior="keep" logic="1"> <rendercondition type="fieldvalue" operator="=" fieldmodel="PRC_Form_Employment__Contact" sourcetype="fieldvalue" field="Months_with_Current_Employer__c" fieldtargetobjects="Contact" value="Have not started." enclosevalueinquotes="true"/> </renderconditions> <enableconditions logictype="and"/>

There’s XML of another page where I am experiencing this issue. That’s 11.2.6 on Salesforce. 

I’ll continue posting here each time I am working with an environment/page where I have experienced this issue.


Hey Matt,


I’m having another customer report this as a “BIG” issue. Can you please continue to investigate? I have a fairly good feeling that it is due to a Save action within the action sequence. The save action will throw the error, but the action sequence continues…so within a wizard, if the last action is navigating to the next step, the user still moves forward to the next step, even though the save action threw the error (and required fields were not filled out).


Thank you,


Conlan


Conlan, I haven’t been able to get back into this recently. Let me see if anyone else has been able to reproduce. Thanks,

Matt


Hey Matt,

I have tried re-producing this a couple of times. I upgraded a Skuid on Salesforce managed package to 12.1.9, and I am continuing to experience the issue on the same page where I saw this issue previously. In another attempt, the page where I was previously able to reproduce the issue on Skuid Platform…is now working as expected.

So the issue is definitely intermittent…but does persist. The scenarios are from the Skuid on Salesforce managed package v12.1.9 environment.

Scenario 1 - Unexpected Behavior
I put together a sample page (XML below) where I was able to replicate the issue. As you can see in this example, the ‘Additional Email’ field is required (note that it is only required via the field edito property…not required on the object-level). If you click the Next Step button without filling out this field at all, the wizard will move forward to to step 2, which is definitely unexpected behavior, because the info for the required field is not captured from the user.

Scenario 2 - Expected Behavior
On this sample sample page, if you enter a value into the ‘Additional Email’ field…then backspace/delete that value (leaving the field blank)…then click Next Step, the required field message is thrown and the user is prevented from moving forward in the wizard, as is expected behavior.

In the first scenario, it seems that that the model is not recognizing any unsaved changes, and therefore the Save action/event is not fired at all. To test this theory, you will notice on the Contact model action, I added a Block UI message whenever the model is saved. In the first scenario, the message is not shown. If however I fill out the required field properly, then click Next Step…my model saved message is shown.

Let me know if you need any further info on this one.

Thanks again for your help on troubleshooting this.

Conlan

                   models.saved                                                                               &lt;p style=“text-align: center;”&gt;&lt;span style=“font-size:20px;”&gt;All Done!&lt;/span&gt;&lt;/p&gt;                .nx-error{ display: none; }       Contact Account               


This is an old thread, but …


I just resolved a similar error. Fields in a V2 Form component were copied and edited in XML. Custom field names were edited, but uniqueId attributes were left duplicated.


For example:

>tag]skuid__field id=“City__c” uniqueId=“sk-3fSr-51465” required=“true”[/tag] was duplicated as:

:tag]skuid__field id=“State__c” uniqueId=“sk-3fSr-51465” required=“true”[/tag]


I did not verify, but it seems that if City was entered, but not State, the Form was satisfied that required fields were populated. The solution was to change the uniqueId on State__c to “sk-3fSr-51466”


Reply