AnsweredAssumed Answered

Portal record: Delay commit

Question asked by lourensjoubert on Apr 11, 2018
Latest reply on Apr 13, 2018 by beverly

Hi Folks,

 

In searching for solutions online, I’m obviously not asking the right questions… going in circles… round and round… can anyone help?

 

In short

Can I prevent a portal record commit, until the user either clicks a commit button in the portal or exists the enveloping record.

 

The long story

Here’s part of my layout…

Screen Shot 2018-04-11 at 12.11.47.png

 

The below detailed portion of this layout is a single portal row filtered with IsEmpty ( IDPK#TimeSlip) used to create a TimeSlip record. (Thanks to  philmodjunk and rgordon for teaching me how to use this trick.)

Screen Shot 2018-04-11 at 15.31.13.png

It worked as expected.

 

Click the green button to trigger a start timestamp and then add a TimeSlip note, or add a JobNote (another single filtered portal row), or navigate to a different tab, and back before pressing the red stop button to enter a stop time stamp.

 

I thought I had the layout licked…

 

BUT if the user clicks off a field, the record commits. I understand that is how it is supposed to work. But of course now the portal presents a new empty record. And I now have a record without a Stop timestamp (or perhaps a note). Users can see TimeSlip records in a portal in the Time Logs tab. But this should be for the exceptions not a regular occurrence.

 

So I thought the best thing to do was create a script to prevent the portal record from committing unless all fields are filled.

 

The below script (triggered by OnObjectExit), does the trick to prevent a half-completed portal record from committing. There’s no OnRecordCommit trigger for a portal field?

Screen Shot 2018-04-11 at 15.40.13.png

BUT, now the user cannot get out of the portal to add a JobNote or look up information on other tabs etc. Solving one problem created another.

 

Flawed logic? Wrong garden path?

Outcomes