Display error when formula contains invalid field reference

  • 3
  • Idea
  • Updated 3 years ago
  • (Edited)
Due to merge syntax, etc. this likely isn't a trivial matter but would like to see an error displayed either during runtme or design time (ideally both) when a formula field contains a field token that is invalid.

Steps to demonstrate:
1) Create page using XML below
2) Preview page

Desired Behavior
An error displayed either during design time, runtime or ideally both indicating the referenced field is invalid

Sample Page XML
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account">   <models>
      <model id="Account" limit="1" query="true" createrowifnonefound="false" sobject="Account" adapter="" type="">
         <fields>
            <field id="Name"/>
            <field id="CreatedDate"/>
            <field id="InvalidFieldInFormula" uionly="true" displaytype="FORMULA" readonly="true" returntype="TEXT" label="InvalidFieldInFormula" precision="9" scale="2" defaultValue="aaaaaa">
               <formula>{{Foobar__c}} + ":" + {{Name}} + ":" + {{FakeField}}</formula>
            </field>
         </fields>
         <conditions>
            <condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
         </conditions>
         <actions/>
      </model>
   </models>
   <components>
      <pagetitle model="Account" uniqueid="sk-2RvtQi-68">
         <maintitle>
            <template>{{Name}}</template>
         </maintitle>
         <subtitle>
            <template>{{Model.label}}</template>
         </subtitle>
         <actions>
            <action type="delete"/>
            <action type="clone"/>
            <action type="share"/>
            <action type="savecancel" window="self"/>
         </actions>
      </pagetitle>
      <basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read" uniqueid="sk-2RvtQi-69">
         <columns>
            <column width="50%">
               <sections>
                  <section title="Basics" collapsible="no">
                     <fields>
                        <field id="Name"/>
                        <field id="InvalidFieldInFormula" valuehalign="" type=""/>
                     </fields>
                  </section>
               </sections>
            </column>
            <column width="50%">
               <sections>
                  <section title="System Info">
                     <fields>
                        <field id="CreatedDate"/>
                     </fields>
                  </section>
               </sections>
            </column>
         </columns>
      </basicfieldeditor>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 3 years ago

  • 3

Be the first to post a reply!