I have two class fields on a form: trying to assign a value of one based on the selected value of the other one and my code is not working....
when WorkType = "TEMPORARY" ReasonForOpening = "MSP TEMP"
any ideas....Thanks
See page 80 of the latest LPL Configuration Console Reference. The when clause on a form needs to come subordinate to/indented/after the variable assignment, and it needs to be a "simple condition" (and WorkType = "TEMPORARY" doesn't meet the criteria to be a simple condition). The particulars of what constitutes a simple condition are on page 66, but in short, a user defined condition will fit the bill for a simple condition, so first, define a new user defined condition field:
WorkType = "TEMPORARY"
WorkTypeIsTemporary when (WorkType = "TEMPORARY")
And then use it on your form like so:
WorkType required when value changed ReasonForOpening = "MSP TEMP" when (WorkTypeIsTemporary)
I'll take a look, Thanks Michael
Michael,
Followed your instructions as described but it does not work. When WorkType field value is changed to "TEMPORARY", ReasonForOpening field value does not change to the expected "MSP TEMP".
Form -
UserField - for simple condition
Anything that I may have missed?
Thanks
Try this on your form:
WorkType
required
when value changed
ReasonForOpening = "MSP TEMP"
when (WorkType.TEMPORARY)
No guarantee (since I would have expected what you have now to have worked), but try adding an explicit refresh to maybe trigger the UI update of the other field:
WorkType required when value changed ReasonForOpening = "MSP TEMP" when (WorkTypeIsTemporary) refresh ReasonForOpening
Same issue
Piggy back on your idea, I made a slight change and - EUREKA
big THANKS to you and everyone else