Valid If expression needs exceptions for Copy Record

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

0 8 342
8 REPLIES 8

Steve
Platinum 4
Platinum 4

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
)
  1. CONTEXT("ViewType") gets the view type (e.g., detail, form, gallery) of the view currently displayed to the user.

  2. ("form" <> ...) asks, is the currently-displayed view not a form-type view?

  3. 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).

  4. 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!

Top Labels in this Space