Formula Field evaluating incorrectly on page load (Skuid 7.16)

When a formula field “depends” on another formula field, the formula field is being calculated incorrectly on page load.


  1. The UI field that depends on the other UI field is listed last in the Field list for the model.
  2. During runtime, if the fields that affect the formula change, the calculations are correct.

Steps to reproduce:

  1. Create page using XML below
  2. Create an order and add an order item setting quantity equal to 10
  3. Preview page choosing the order you created

Expected Result
Quantity = 10
Double Quantity = 20
“Triple The Double Quantity” = 60

Actual Result
“Trip The Double Quantity” equals 0

Sample Page XML

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Order">   <models>
      <model id="Order" limit="1" query="true" createrowifnonefound="false" sobject="Order">
            <field id="Name"/>
            <field id="CreatedDate"/>
            <field id="OrderNumber"/>
            <condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
      <model id="OrderItem" limit="20" query="true" createrowifnonefound="false" adapter="" type="" sobject="OrderItem">
            <field id="AvailableQuantity"/>
            <field id="ListPrice"/>
            <field id="Id"/>
            <field id="Quantity"/>
            <field id="UnitPrice"/>
            <field id="OrderItemNumber"/>
            <field id="UIDoubleQuantity" uionly="true" displaytype="FORMULA" label="Double Quantity" readonly="true" returntype="DOUBLE">
            <field id="UITripleTheDoubleQty" uionly="true" displaytype="FORMULA" label="Triple The Double Qty" readonly="true" returntype="DOUBLE">
            <condition type="modelmerge" value="" field="OrderId" operator="=" model="Order" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
      <pagetitle model="Order" uniqueid="sk-buT4b-67">
            <action type="savecancel" window="self"/>
      <basicfieldeditor showsavecancel="false" showheader="true" model="Order" mode="read" uniqueid="sk-buT4b-68">
            <column width="100%">
                  <section title="Basics" collapsible="no">
                        <field id="OrderNumber" valuehalign="" type=""/>
      <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="OrderItem" buttonposition="" mode="read" uniqueid="sk-bvYn4-124">
            <field id="OrderItemNumber" valuehalign="" type=""/>
            <field id="AvailableQuantity"/>
            <field id="ListPrice"/>
            <field id="Quantity"/>
            <field id="UnitPrice"/>
            <field id="UIDoubleQuantity" valuehalign="" type=""/>
            <field id="UITripleTheDoubleQty"/>
            <action type="edit"/>
            <action type="delete"/>
         <massactions usefirstitemasdefault="true">
            <action type="massupdate"/>
            <action type="massdelete"/>
            <view type="standard"/>
      <styleitem type="background" bgtype="none"/>

Barry.  We previously identifed an issue with formula fields where formulas are not evaluated if they are based on another formula.  This exposes dependency issues for formulas that we have not previously handled.  We are working on this. 

Good deal, thanks Rob!

This appears to be at least improved if not resolved in 7.20.  Can someone confirm?


According to the release notes for 7.19 the ui-only formula fields should now work with other ui-only formula fields as inputs.

Thanks Matt.  I was still experiencing some precedence issues with 7.19 but they appear to be improved or possibly resolved in 7.20.

Skuid team?

We did fix the “Formula field cannot reference another formula field” issue in 7.19 (or 20…) .  Let us know if you are seeing other wierdness…   

Will do Rob.  If I recall correctly, I was able to reference another formula field in 7.19, but on page load the precedence of evaluation was incorrect and still resulting in the wrong value.  As of 7.20, it appears to be working as expected.  I’ll be doing some more testing over the new few days and will let you know if I run in to anything.  I think for now, we can consider this resolved as of 7.20.  Thanks!

Glad to hear this is fixed.