I have a form with three fields: Remote_User, StaffID and Type.
On WebQueryOpen an agent runs, picking up the Remote_User,retrieving the staff id from the address book (string value), and placing the value in the StaffID field on the form.
I have the following @if formula on the Type field:
@If(StaffID=“1189”;“FINAL”;“DRAFT”)
Problem is, the Type field is always set to DRAFT.
If I rem out the code in the agent, and place “1189” in the default value of the StaffID field, the the formula works fine.
Any idea why? Could the agent be placing the staff id value in as something other than string? Any ideas or suggestions would be greatly appreciated. Thanks in advance.
Subject: @If formula not working properly - code included
The problem is that the WQO runs after the document and form are married, so you are changing the value in StaffID after the field calculations are done. You’ll need to set the draft/final value in the WQO agent as well.
Subject: RE: @If formula not working properly - code included
Do you mean I need to set the field value on the WebQuerySave (WQS) agent?
I’m going to give it a try.
Thanks!
Subject: RE: @If formula not working properly - code included
No, he means that the Computed formula fires before WQO runs, so your dependency is backwards, and therefore your Computed formula can’t compute based on info that’s not yet there.
Subject: RE: @If formula not working properly - code included
Thanks guys. After reading the responses, I changed the approach…
All new items are stored as DRAFT. Then the reviewer will have a hotspot button that he will press to promote all new draft items to final items.
Thanks again!