cancel
Showing results for 
Search instead for 
Did you mean: 

how to cast a context variable

raymond16_
Champ in-the-making
Champ in-the-making

I create a new document Type called calcul1 with field1 type double with field2 type double in the scheme I create an other field named total In the edit form I create a button called add which sould add field1 + field2 when total is declared as string I get the good result When total is declared as double I get an error the chain is : FETCH>DOCUMENT EXECUTION CONTEXT > SET CONTEXT VARIABLE name=field1 value=@{Document["calcul1:champ1"]} EXECUTION CONTEXT > SET CONTEXT VARIABLE name=field2 value=@{Document["calcul1:champ2"]} and then I declare : DOCUMENT > UPDATE PROPERTY value = @{Context["field1"]} + @{Context["field2"]} xpath = calcul1:total

i have got a good result when total is declared as a string( xxx+oooo ) but nothing when declared as a double, and I need a doubled summ in this field thanks for help Raymond

2 REPLIES 2

Laurent_Doguin
Star Collaborator
Star Collaborator

There is a much simpler way to do this:

FETCH>DOCUMENT
DOCUMENT > UPDATE PROPERTY 
  value = @{Document["calcul1:champ1"] + Document["calcul1:champ2"]}
  xpath = calcul1:total

Your issue comes from here:

DOCUMENT > UPDATE PROPERTY value = @{Context["field1"]} + @{Context["field2"]} xpath = calcul1:total

Value will be evaluated as a string if you have @{Context["field1"]} + @{Context["field2"]} instead of @{Context["field1"] + Context["field2"]}

raymond16_
Champ in-the-making
Champ in-the-making

thank's alot for this explanation Raymond

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.