Hello, I have actions configured for copying a parent/child scenario - Job Order Header/Job Order Detail. Both the the job order header & detail have valid if expressions in place preventing the user and another field from being duplicated but since the same job order is being copied with the same job order no (not a unique id or key), its ok to make the copy When I run the copy, it fails as a result of the duplication.
Hereโs my expression for the user id thatโs failing with my attempt and stating if the user is in the lis but its the same job order its ok to include it in the listing.
SELECT(users[Email],OR([vir_user_assigned]=FALSE,[vir_job_order_no]=[_THISROW].[vir_job_order_no]))
Is there a way to indicate exceptions to the Valid ifs in an expression? I have this issue in many areas of my app so any help on thinking this one through would be outstanding.
A million thanks
Yes, as itโs an expression, so you can handle any exception that can be expressed by an expression. The problem here is that an expression canโt inherently recognize itโs being evaluated in the context of an action.
Are you trying to use App: copy this row and edit the copy?
Thanks Steve, Iโm using:
Data: Add a new row to another table using values from this row
And itโs ultimately okay if the new row has the duplicate (non-key) values?
Yes
You could try using a CONTEXT() expression. There are several possible approaches, such as to apply the current Valid If expression only in forms:
IF(
("form" <> CONTEXT("ViewType")),
LIST([_THIS]),
expression-for-forms
)
CONTEXT("ViewType")
gets the view type (e.g., detail, form, gallery) of the view currently displayed to the user.
("form" <> ...)
asks, is the currently-displayed view not a form-type view?
LIST([_THIS])
sets the list of valid values for the column to the value it currently has if and only if the answer to (2) is โyesโ (i.e., the user is not in a form).
Replace expression-for-forms
with the expression you want to use if and only if the answer to (2) is โnoโ (i.e., the user is in a form).
Based on the SELECT() expression you provided, it appears youโre using Valid If to provide the form user with a dropdown menu, so Iโve structured my expression for that. Weโd have to tweak the expression if you instead want a simple valid/invalid result.
Thanks Steve, Iโm digesting this now and will check back.
Thanks again
Hi Steve it worked! Iโm testing in several other areas now.
A million thanks for your help as always!
Whoo-hoo!
User | Count |
---|---|
43 | |
29 | |
22 | |
20 | |
13 |