When custom logic contains the word “or” or “and” more than once an uncaught reference error is encountered.
Steps to reproduce:
- Create page using XML below - Page contains a field with “1 OR 2 OR 3” for rendering custom logic
- Preview page
Actual Result
Uncaught Reference error: trueorfalse is not defined
Expected Result
Page displays without error
Analysis
replace is used for substitution but replace will only replace the first occurrence of the string found. Possibly consider using a regex with global flag (/and/g).
Sample Page
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account"> <models>
<model id="Account" limit="1" query="true" createrowifnonefound="false" sobject="Account">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
<field id="Phone"/>
</fields>
<conditions>
<condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
</conditions>
<actions/>
</model>
</models>
<components>
<basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read">
<columns>
<column width="100%">
<sections>
<section title="Basics" collapsible="no">
<fields>
<field id="Name"/>
<field id="Phone" valuehalign="" type="">
<renderconditions logictype="custom" logic="1 OR 2 OR 3">
<rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="Account" sourcetype="rowproperty" sourceproperty="isNew"/>
<rendercondition fieldmodel="Account" sourcetype="rowproperty" sourceproperty="isSaved" enclosevalueinquotes="false"/>
<rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="false" fieldmodel="Account" sourcetype="rowproperty" sourceproperty="isCloned" value="true"/>
</renderconditions>
</field>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
</skuidpage>