Skip to main content

When a formula function contains text that is the name of a Formula Function and is immediately followed by a left paren, the actual function definition is output.


Examples


  1. Formula = “VALUE(e.g. Example)” / Output = “parseFloat(e.g. Example)”

  2. Formula = “DAY(e.g. Monday)” / Output = “skuid.time.getDay(e.g. Monday)”

Notes - The approach used to parse formulas will also result in collisions when there is one function that ends with the same text that is the full name of another function. For example, if there was a function called “FORMAT_FIELDVALUE”, it would collide with the function “VALUE” and unless FORMAT_FIELDVALUE was listed before VALUE during $.each evaluation, the result would not be correct. Given that TODAY() comes before DAY() in the function list (which is out of alphabetical order), possibly this part is already known?


Steps to reproduce:


  1. Create page from sample below

  2. Preview page

Expected Behavior

ValueExample should be “VALUE(e.g. Example)”

DayExample should be “DAY(e.g. Monday)”


Actual Behavior

ValueExample: parseFloat(e.g. Example)

DayExample: skuid.time.getDay(e.g. Monday)


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="ValueExample" uionly="true" displaytype="FORMULA" readonly="true" returntype="TEXT" label="ValueExample">
<formula>"VALUE(e.g. Example)"</formula>
</field>
<field id="DayExample" uionly="true" readonly="true" displaytype="FORMULA" returntype="TEXT" label="DayExample">
<formula>"DAY(e.g. Monday)"</formula>
</field>
</fields>
<conditions>
<condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
</conditions>
<actions/>
</model>
</models>
<components>
<pagetitle model="Account" uniqueid="sk-3fATze-72">
<maintitle>
<template>{{Name}}</template>
</maintitle>
<subtitle>
<template>{{Model.label}}</template>
</subtitle>
<actions>



<action type="savecancel" window="self"/>
</actions>
</pagetitle>
<basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read" uniqueid="sk-3fATze-73">
<columns>
<column width="100%">
<sections>
<section title="Basics">
<fields>
<field id="Name"/>
<field id="ValueExample" valuehalign="" type=""/>
<field id="DayExample" valuehalign="" type=""/>
</fields>
</section>
</sections>
</column>

</columns>
</basicfieldeditor>
</components>
<resources>
<labels/>
<css/>
<javascript>

</javascript>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

Skuid Team - Any input on this?


Barry~ 

Thanks for alerting us of this bug. The devs are aware of the issue and will consider it for a future release.

Thanks for helping us make Skuid better!
Karen


Thanks Karen!


Hello Karen -

With the introduction of custom formulas, the issue identified here could surface more frequently.  The fact that custom formulas use “c_” prefix should minimize surfacing the defect but this issue still exists in the latest edition of Brooklyn.

Is there an update on when this will be resolved?

Thanks!


Reply