I have two columns: “Timecard Approved?” and “Reject Reason.”
The Supervisor reviews individual timecards and if anything is missing, they hit an action button - “Reject Timecard” - which sets the “Timecard Approved?” column to “Reject.”
This was working as expected until I set the column “Reject Reason” to required if “Timecard Approved?” = “Reject.”
This now prevents the action from firing and shows the following error message once I hit the “Reject Timecard” action:
Is there a workaround for this?
@Dialect_Junk
What do you expect to happen when the action executes correctly other than recording “Rejected” value to the respective column?
That’s the only action - set value of the column to “Reject.”
@Dialect_Junk
Try this expression with your Required_if
AND(
CONTEXT("ViewType")="form",
[Timecard Approved?] = "Reject"
)
Levent, I tried this expression. It allows me to set the column as “Reject,” however, the “Reject Reason” column does not become required as desired.
Since the view type is a Detail, I guess it makes sense the column isn’t required since both conditions aren’t satisfied?
Just to clarify, I want to be able to hit the “Reject Timecard” action button setting the “Timecard Approved?” column to “Reject,” and I want the “Reject Reason” column required if “Timecard Approved?” = “Reject.”
@Dialect_Junk
I believe it’s not possible to enable quick edit for a required column in a detail view
@Dialect_Junk
I would suggest this:
1.) Create a slice of this record’s table which contains the [Key Column], [Timecard Approved?] and [Reject Reason] columns only. Set the slice to ADDS_AND_UPDATES mode only.
2.) Add a REF type FORM VIEW and assign this slice as a base table.
3.) Set Finishing View to TASK DETAIL
4a.) Set a Show_if expression like below to your [Timecard Approved?] column
IF(
CONTEXT("View") = "Your-Ref-Type-Form-View-Name",
FALSE,
TRUE
)
4b.) Set an Initial_Value expression like below to your [Timecard Approved?] column
IFS(
CONTEXT("View") = "Your-Ref-Type-Form-View-Name","Reject"
)
4c.) Set an Reset_if expression like below to your [Timecard Approved?] column
CONTEXT("View") = "Your-Ref-Type-Form-View-Name"
4d.) Set an Editable_if expression like below to your [Timecard Approved?] column
NOT(CONTEXT("View") = "Your-Ref-Type-Form-View-Name")
5.) Re-set the Required_if expression for [Reject Reason] column
[Timecard Approved?] = "Reject"
6.) Change your action button:
Do this > App: Go to another view within this app
Target > LINKTOROW([KeyColumnName], "Your-Ref-Type-Form-View-Name")
7.) And lastly remove [Reject Reason] from Quick Edit
This will simply launch the table’s Form View with Edit mode, reset the [Timecard Approved?] column’s and assign the value in the Initial Value property, your [Reject Reason] field will be mandatory to fill in and form saved.
Levent, thank you for taking the time to come up with this! Wow!
I had to roll the app out so I simply changed my “Detail” view to a “Form” view. I’ll have to try this very clever workaround on the next iteration of my app.
Again, thank you!!!
You’re welcome
User | Count |
---|---|
16 | |
10 | |
9 | |
8 | |
3 |