Link to home
Start Free TrialLog in
Avatar of santhoshn
santhoshn

asked on

How to distinguish post and commit_form

In one when-button-pressed event I am calling "post". Afterwards I want to know whether the "commit" is encountered or still it is in post. How can distinguish post and commit programmatically. Since in both the cases the system status is QUERY.
Avatar of santhoshn
santhoshn

ASKER

Edited text of question
Edited text of question
You talk about the record status here.
I think the form status is still 'CHANGED' when you posted but not committed. (But I must say I'm not sure).

You can also use a global variable that sets to 'POSTED' if you use the post built-in and sets to 'COMMITTED' when you use the commit built-in. The global variable is best set to 'NOTPOSTED' in the WHEN-NEW-ITEM-INSTANCE trigger on FORM-level when the form status changes to 'CHANGED'.

Peter.
Hi Peter

Thank you for responding my question.

But actually after "POST" all the system status including form status is "QUERY" only.
Now I am using global variable only. This gives me lot of maintenance problems. I will give you a brief of my problem.

In my form there are three blocks are there. One is master another is detail and one is
independent block. Here I will select what are rows I want using check box(Multi select) from the independent block and move all the selected rows to the detail block by pressing a button . While moving I am giving one "POST". Now when I navigate to next record of the master block. This time I want to ask the alert "Do you want to save the changes". Since I gave the POST the default alert won't come. So explicitly I need to show the alert. If the user pressed the COMMIT then it should not ask. This is my requirement.

If know any less maintainence logic please let me know.

Thanks

Santhosh.

ASKER CERTIFIED SOLUTION
Avatar of dmcgregor
dmcgregor

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Why do u post after moving the records from the independent block to the detail block ?
If u insert the records in the table without committing, the form will ask if u want to commit if the user jumps to another master record. It will also show the not-committed details if u query the detail block.
Just an idea. The solution from dmcgregor looks also right.
Peter.
Hi dmcgregor

Thank you very much for your answer and is working fine.

Santhosh