Use Case : I want a field to be required if user with specific profile is trying to create a new record. I added rendering condition to for the field and I have required.
This field is throwing an error when the user not specified in the rendering condition tries to create a new record.
How can I make this work?
Page 1 / 1
Hi Jaiti,
One option is to set up two copies of your field to the field editor or table, and click on one in your field editor or table, and make it ‘required.’ Then, only render that version of the field for profiles that MUST fill out this field, and render the other version for profiles that are not any of the above. I’ve tried this out and it seems to be behaving as expected.
I’ve set up an example page to demonstrate, with the page’s XML below. Let me know if this helps!
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
<models>
<model limit="20" query="true" createrowifnonefound="true" datasource="Ui-Only" processonclient="true" id="UI-Model">
<fields>
<field id="MyField" displaytype="TEXT" label="MyField"/>
<field displaytype="BOOLEAN" id="MakeMyFieldRequired" label="Make MyField Required?" ogdisplaytype="TEXT"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="UI-Model" uniqueid="sk-38Aj-443" mode="edit">
<columns>
<column width="100%" uniqueid="sk-38Aj-439">
<sections>
<section title="Section A" uniqueid="sk-38Aj-440" collapsible="no">
<fields>
<field uniqueid="sk-38Aj-445" id="MakeMyFieldRequired">
<renderconditions logictype="and" onhidedatabehavior="keep"/>
<enableconditions/>
<label>Check this box to make "MyField" required</label>
</field>
<field uniqueid="sk-38Aj-444" id="MyField" required="true">
<renderconditions logictype="and" onhidedatabehavior="keep">
<rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="false" fieldmodel="UI-Model" sourcetype="fieldvalue" field="MakeMyFieldRequired" value="true"/>
</renderconditions>
<enableconditions/>
</field>
<field uniqueid="sk-38Aq-481" id="MyField">
<renderconditions logictype="and" onhidedatabehavior="keep">
<rendercondition type="fieldvalue" operator="!=" enclosevalueinquotes="false" fieldmodel="UI-Model" sourcetype="fieldvalue" field="MakeMyFieldRequired" value="true"/>
</renderconditions>
<enableconditions logictype="and"/>
</field>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<resources>
<labels/>
<javascript/>
<css/>
<actionsequences uniqueid="sk-38AV-259"/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>
Hi Mark,
I did try this approach of using the same field twice and adding the profile criteria for visibility but this does not seem to work.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.