What does your "Cancel" script do?
You may want to consider entering the information into global fields. Then, if you click cancel, you can clear out the global fields. If you click submit, then a script can add a record and replace the fields with the values from the global fields, and then blank out the global fields. Does that make sense?
Thanks TSGal for the quick reply.
My Cancel script is:
Revert Record/Request [No dialog]
Enter Browse Mode
If statement to change layout based on the request type
Show all records
I'm trying to replicate the Cancel button on the sidebar that is hidden. The above script works in FMP but not in IWP.
The premise is, user clicks the edit button which triggers a script that changes the layout and opens the record for editing. Once there if they want to cancel the edit to disregard their changes, they'll click the cancel button.
Unfortunately, when they click my Cancel button, the revert does not appear to occur and the changes are recorded. I'm hoping that there is something I've missed.
I could not duplicate the problem. Here is what I did.
I created a script that was solely:
Revert Record/Request [No dialog]
I then created a oval on my layout, and made this a button executing the script above.
In FileMaker Pro, I changed the entire record and clicked the button. Everything reverted.
I turned on Instant Web Publishing.
I went to another machine, launched Firefox and put in the IP address for Instant Web Publishing. I select the database file, select the appropriate layout, modified some data, clicked the button and everything reverted.
Let me know what actions are different from yours, and I'll try to duplicate it here.
I tried your test and I believe I have found the difference.
When a user clicks the Edit button I made, they go to an edit layout that was created and the record is Opened to allow instant editing.
However, when the record is Opened using the script then the revert does not work and instead the record is closed and saved.
Once I removed the "Open Record/Request" and I click into a field and trigger Edit mode then the revert works, the changes are not saved.
I was opening the record so that the user can make edits immediately. Is there a way to trigger Edit mode so that when the user clicks my Edit button they can make changes without having to click in a field first?
Thanks for the help.
I created a button that executes a script that contains:
Go to Field [ <first field> ]
In my case, I selected the field that is a drop-down list, and when I select a new value and press the revert button, it reverts just fine. Let me know if this works for you.
That did the trick. Removing the Open Record/Request from the Edit Script allows my Cancel button to work properly and selecting a field automatically fixes the need to open the record.
I have a new twist on this issue. I am working with IWP. I too am trying to recreate the functionality of the IWP Cancel button in a custom button. Here is my problem. I have a portal. Within the portal is a field with a drop down list with the options include arrow and auto complete using value list. The field has a validation that the value must be a member of the value list.
During a testing procedure, I noted it was possible for a user to not select a value in theis field so when the request was sent back to the database the validation error message displayed. I pressed OK. The problem record was still active however I was not able to do anything to resolve the situation except click the cancel button in the status area. The problem is that I need to hide the status area for other reasons so I need to create a custom button to the the same thing. So far I have failed.
I have tried:
enter browse mode
And possibly some other combinations.
Any help would be appreciated.