
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 06:49 AM
Hi,
I have an event table where I store events, and allow user to register for the event to receive a calendar invitation.
Registration is done via an UI action using the logged in users SysId, the current event SysId and putting them into a ScriptInclude where a registration record is created in a separate table using gliderecord. As far as I can see, the UI action does no save to the Event table, only to the registration table.
Some fields on the Event record should be filled to complete the calendar invitation, this is done by an admin. Admin wants a reminder onSubmit to fill out the relevant fields (doesn't want mandatory fields due to only some events being open for invites). So I created an OnSubmit client script that checks event type, and if those relevant fields are empty, then sends a confirm message reminding to fill out fields (OK to proceed with save and Cancel to go back).
My problem is now when a user clicks the Register UI Action, somehow the client script is triggered and the message shows up. I was assuming the script would only run on an actual save/submit in the Event table, not on a save that only goes to another table. Is there a way to stop the client script to trigger the message in this case?
Solved! Go to Solution.
- Labels:
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 03:15 PM
Yes. "Submit" does not mean "submit to the table", it means "submit to the server".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 07:30 AM
Kristin,
Is there a reason why you're using a form message instead of sending a notification to the admin? If you were using a notification to inform the admin, you could configure it to send only when the Event table was populated with a new record.
Based on your description, it seems like an Event record IS being created when the script include is called by the UI Action. The Admin is then going back to this record to fill out any required fields. Is this not the case? Otherwise, the admin would have to fill out the whole Event record himself and then submit it.
Pull up the Event table, and in a separate tab use the UI Action from the Registration form. Go back to the Events table on your other tab and see if there was a new record created by refreshing the list. If there's a new one, your onSubmit Client script is running. I would recommend just using a notification that fires when a new Event record is created.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 12:50 PM
Hi,
I must have not been clear enough:
There are a few admins/creators that can create new events. The onSubmit client script is meant to remind them to fill out specific fields on the event record when the event record is saved/submittet. They can either click OK to submit without filling the fields or cancel to go back, fill the fields and then submit. That part is working. A notification sent to an admin would not fit the purpose here because they would then need to go back later to fill out more information. What could work would be a UI policy setting the fields mandatory, or even an annotation on the form, but the customer specifically asked to have a popup before submit.
The end users can see the event record (but not change it), and will then see a UI Action on the event form to "register for this event". When they click the UI action, a record is created on the registration table, grabbing the sysId of the event and the sysId of the logged in user, running them through a gliderecord on a scriptinclude before inserting the relevant information in the registration table. The end user does not have write permission to the event table.
That is why I don't understand how the client script is triggered; there is no submit on the event table when someone clicks to register.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 02:00 PM
Kristin,
could you post a screenshot of the Register UI Action and the script include? If the script include is long, you can copy/paste it and use the 'insert/edit code sample' button.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 02:09 PM
Is the "Client" box checked on the "Register for this event" UI Action?
If the Client box is not checked, then your UI Action is running a server script and the onSubmit Client Script will run.