cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically assign text module to field

Former Member
0 Kudos

Hello,

I am working on a dunning form where the texts in the form change depending on the level.

I've setup three text modules in SMARTFORMS and put them in the form context -TEXT1, TEXT2 and TEXT3.

I need to write a formcalc script for the textfield so that if level = 1, then binding should with TEXT1 and if level = 2 then binding is with TEXT2 and so on. How do I access and change the binding data for the field in the script?

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member189058
Active Contributor
0 Kudos

Is level field there in the form context???

Former Member
0 Kudos

Yes, the level field value is present there in the context. This helped me resolve the issue by using alternatives based on the level. First alternative, check if level = 1, if true, use TEXT1 elseif it is false, then put one more alternative in this node. Check if level = 2 is true, then use TEXT2. Thanks.

former_member189058
Active Contributor
0 Kudos

Try this code.. at the initialize event for textfield...


if $record.<context_node_name>.level.rawValue == "1" then
  textfield.rawValue == "Sample1"
else
  textfield.rawValue == "Sample2"
endif

Regards,

Reema Shahbazkar.