Force Required_IF in detail view or hide the cancel button in form view

This question is largely similar to this one - Prevent navigating away if Required field in Detail View Quick edits

I have a timesheet all setup where the user:
1 = Navigates into the job record
2 = Clicks a “Clock In” button
3 = This creates a record in the timesheet table with the clock in time
4 = Clicks a “Clock out” button
5 = This then adds the clock out time to 3 above
6 = Opens up the timesheet record as a detail view with 4 quick edit columns so they can say what vehicle they used, were they stopping in a hotel etc

What I want is that if they choose something in the first quick edit column then the second quick edit column is required. I’ve set this up but it doesn’t work. They can simply leave the second column blank and navigate away to a different view or click back.

Sending them to a form view instead wouldn’t make things much better. As now they have the cancel button. Which if they click it will delete the entire timesheet record

Anyone know of a simple fix?

0 6 195
6 REPLIES 6

What is the Required_If expression?

I have a Quick Edit that I just implemented a Required_If to test it. It seems to work in my case. I am requiring a Time entry.

Expression

Initial state of View

Re-entering view after DateTime initially entered
3X_4_6_46fa16d9bdefaec0803fa07d3fb5f34f31ea0fa3.png

I wonder if timing is the issue here. If you waited on the Detail view does the second field eventually show as required?

In my use case I have an action to update the Status from “Pending” to “On Way”. I noticed it took a little while for updates to reflect the new status.

I guess the question is when a Quick Edit applied, how quickly does it reflect in the UI for any expressions to notice the change?

The required_if formula works fine. It puts in the start and the red text saying its invalid because its blank. But the issue is you can just click back or another view.

OOOhhhhh, I see. Right, there is nothing to prevent them from navigating away.

You mentioned the Problem with a Form is the Cancel button. You can “hide” the Cancel button – sort of. Technically, in the Localize section, you can only replace it but you can replace it with “”. Nothing shows but there is still a really small button there that a user could “accidentally” tap on. It is unlikely however.

I used this as shown below.

I couldn’t find an active use case of a form to show.

With quick edit in detail, each individual column change counts as a “sync”. In such a scenario, there is no way to enforce conditional required_ifs between columns like that. It’s just not logically possible.

What? Doesn’t the record already exist from before? Hitting cancel on an edit form does not delete the record.

You right. After thinkign abou this the clock in already created the record so cancelling later would not delete it. Deleting only happens if its a newly created record.

I’ve sort of managed to sort it by doing this:
1 = Clock in button uses LINKTOFORM() to initially create the record. So that if you have to enter the required info
2 = Hide the Cancel button as above
3 = The clock out button then uses LINKTOROW() to reopen the same form after clocking out

Thanks for everyones suggestions

Top Labels in this Space