If, then 2 criteria
Hi, As always, I'm guessing this is a simple fix and my limited skills with coding are the problem here.
I am trying to configure a choice field to trigger on update and adjust a choice field in certain records on a separate table based on a specific criteria.
I need the trigger to activate when a specific choice is selected but only update the choice fields of the connected records if a yes/no field is set to yes on them.
Currently, I can easily change the status on all of the selected records but I am unable to filter out the records with the yes/no set to no.
I have tried using Switch but see the same results.
An example of the very basic code I have set is below:
if Status = 3 or Orders.'Assets 2'.'In shipment'= true then
Orders.'Assets 2'.(Status := 4)
else
if Status = 4 or Orders.'Assets 2'.'In shipment'= true then
Orders.'Assets 2'.(Status := 1)
end
end
Apologies that I have not supplied much more detail but I am hoping that this is a simple fix and I don't want to waste anyone's time adding too much detail.
Thanks in advance for any assistance
7 replies
-
Hi, try this:
switch true do case Status = 3 and Orders.'Assets 2'.'In shipment'= true: Orders.'Assets 2'.(Status := 4) case Status = 4 and Orders.'Assets 2'.'In shipment'= true: Orders.'Assets 2'.(Status := 1) end
-
OK, so the only thing I can work out is that the "and" "or" operators are tripping me up. Using and produces no change, using or changes everything, which makes sense to me as I have confirmed one of the criteria but not both. Hmmmmm I'll keep trying
Content aside
- Status Answered
- 7 hrs agoLast active
- 7Replies
- 32Views
-
2
Following