- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
For configurable workspaces that use the "standard" record page --- e.g. "CSM default record page" for CSM/FSM Configurable Workspace; "SRP Record" for Service Operations Workspace --- the controller has the form.fields object which you access via api.data.record.form.fields. There does not appear to be any distinct event on the controller or the associated Form component that indicates when the form.fields object is available for use. My workaround was to handle the controller's "Record property changed" event checking for when form.fields was finally not undefined, then firing my own event so the page would know when it could be used. There HAS TO be another way to know that ServiceNow has fully loaded one of the more important client-side objects on the record page. Anyone have ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thx for the response @IronPotato but I had previously tried both of those and the form.fields object was still undefined. Only the Record property changed event seems to do the trick, although not an event triggered by the actual form.fields object being set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I would check that again, I've used those events many times to get access to form fields as I had many story implementations that required access to form fields and I'm sure they are there on either of these 2 events. GL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Well I'll be damned @IronPotato, glad you had me check it again. I could've sworn I tried both of those events, but either I didn't try Record Data Fetch Completed or I did and mistakenly thought it didn't work. Because it did! The form.fields object was still undefined during "Succeeded", but good to go on "Completed". Guess I can remove my workaround on Record Property Changed. Thx!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Also, remove the if condition, log only the path to the form fields in that client script and make sure you have the same client script on all 3 events....data fetch succeeded, data fetch completed and form field change. Make sure that your client script is added to that events.