Conditon for user value

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mpol_ch
User
Posts: 877
Location: Switzerland

Conditon for user value

Post by mpol_ch »

Hello
I am using the following user values as "Select" option to define a status of contract. The Status must follow a certain sequence.
My Option:
1.Start
2.OK
3.Check
4.NOK
5.Suspend

Now if pageID=ADD then only option Start and And

If pageID=Edit check the current Status: IF Status==OK then show Options "Check" OR NOK, IF Status==NOK then show only Suspend... and so on.
Where can I start?

thanks
mpol_ch


mobhar
User
Posts: 11768

Post by mobhar »

Please note that User Values does not support dynamic filter criteria.

You should create a table to store those values, and then use that table as the Lookup Table of the "status" field. Define your filter criteria from the "Filter" property of "Lookup Table" pane.

Read also: "Using Lookup Table for Edit Tag (Text/Radio/Checkbox/Select)" under "Field Setup" topic from PHPMaker help file.


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

Hello mobhar
thanks for your input. Now I am trying to use filter but it does not work exactly what I want:
I want to put for add and edit page different rule. With if I am getting problems. With below code It show me for both options "add and edit" the same options? Do you have a suggestion?

(CurrentPageID() == "add") ? "Status = 'Start' OR Status = 'OK'" : (CurrentPageID() == "edit") ? "Status = 'Check' OR Status = 'NOK'" : ""

thanks anyway for your support.

mpol_ch


mobhar
User
Posts: 11768

Post by mobhar »

Try this:

(CurrentPageID() <> "add" && CurrentPageID() <> "edit") ? "" : (CurrentPageID() == "add") ? "Status = 'Start' OR Status = 'OK'" : "Status = 'Check' OR Status = 'NOK'"


Post Reply