AnsweredAssumed Answered

Calculation Field not updating with Global Variable, but ok with Global Field

Question asked by RobinXiao on Feb 26, 2011
Latest reply on Feb 28, 2011 by philmodjunk

Title

Calculation Field not updating with Global Variable, but ok with Global Field

Post

I was scripting a "toggle sort order" function with arrow graphic show current order, acs or des. I achieved the result first with Global Field, but the Calculation Field won't work if I replace Global Field with Global Variable, if I copy paste the calculation formula into Data Viewer, it works there. Is this some sort of bug or its how its designed to be?

Example:

Graphic_arrow: Global, container field with 3 repetitions,1 up arrow, 2 down, and 3 nothing

column_number:Global Field (or Global Variable which does work), save the number of column currently sorted

Layoutname:Global Field (or Global Variable which does work), save the layout name currently sorted, so I can use following fields in many layout

$$sortorder: Gloabl Variable to save acs or des sort

Script is buttoned to column1,2,3,4,5,6, It will toggle $$sortorder and set Layoutname and column_number.

column1: Global calculation field, result container, display the sort arrow on list layout. Function: if( Layoutname = get(layoutname) and column_number = 1; getrepition(Graphic_arrow;$$sortorder+1); getrepition(Graphic_arrow; 3)). 

Problem is this function does not work inside Calculation Field if Layoutname &column_number(both in the condition of if statement) are Global Variable, but when you copy pasted to data viewer everything worked as suppose to be. very strange.

column2,3,4,5,6: more arrow status like column 1

Outcomes