- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 09:32 AM
(This was posted in the Developer forum as well, but thought I may have luck here.)
I have duplicated the OOTB form widget and am using it to display case data on a custom page. I am using a custom table that is a child of HR Case and an HR Service built on that custom table. Whenever I save the form (even using OOTB UI actions), the widget "refreshes" and all of the values in string/checkbox fields get cleared. However, the updates do actually push to the server -- if I refresh the page or view the case in the back-end, the updates are there.
I believe this has something to do with my table specifically... When I test this using the OOTB form widget, table=sn_hr_core_case and another (HR Service) record's sys_id, the widget "refreshes" but the values stay on the form. If I change only the sys_id to that of my custom HR Service, the values get cleared. So any time my HR Service or table is inputted, the values clear, even on the OOTB form widget.
Do I need to add a record watch? I am confused because this appears to work for other HR Services. It may also be worth noting that I am unable to post work notes/comments to the case from the back-end currently. Not sure if this is related somehow.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 11:51 AM
Hey @James Chun, I actually just was able to figure out the issue... there is a function spUtil.simulateFakeFormSubmitForAutoComplete('widget-form', $scope.data.f._fields) that gets called within the function constructResponseHandler() in the client script of the form widget (ID: widget-form). I can't find any documentation on this specific function and have reached out to HIWAVE for more info... but commenting out this code seems to fix the inputs disappearing.
spUtil.simulateFakeFormSubmitForAutoComplete() function, which causes inputted fields to disappear
I figured this out by looking for when/how the widget data gets loaded. Sure enough, when the UI action completes (per the screenshot below) the loadForm() function gets called and then this constructRespondHandler() function gets called. At the end, this fakeSubmit thing happens.
widget-form client script (loadForm() function)
I'll update this thread when I hear back from HIWAVE. Until then... thanks for your help debugging! Hope this helps someone in the future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 02:47 PM
Thanks for this, looking at the screenshots, I can see the topmost field's value is visible after saving. Does this mean that the fields that are cleared are only the ones that you updated? i.e. after saving, the form displays the 'previous' version of the record. How is this field different from the rest of the fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 06:24 AM - edited 02-20-2024 06:36 AM
James, good question. In response to your first question -- not necessarily; any non-choice or non-reference field will be cleared. I just tested this by updating the reference field, choice field, string fields, checkboxes, and the date field. Everything gets cleared out on Save (except the ref + checkbox). All of the changes technically save (I can see my changes as saved in the back-end or if I refresh the front-end page).
Editing this post to add:
- I just ran another test, with a separate HR Service, and found a similar issue... this issue is actually happening across multiple HR Services and COEs. I just tried by passing the table sn_hr_core_case via the URL and a HR Service sys_id from the Talent Management COE and my string values got cleared. Similarly, I tried passing sn_hr_core_case_talent_management through the URL with the same sys_id, and it still cleared. I'm not sure why/how I didn't notice this happening in my previous tests... I think I am going to open a HIWAVE ticket.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 11:29 AM
Thanks for the update @jcmings,
So the issue is present across multiple COEs and happening in the OOTB widget as well? Just trying to narrow down the source of the issue and if it's from the cloned widget only, you may not get much support from the Support team.
Also, do you have any Client script or UI Policy that can potentially be causing this issue?
If you have already created a Support case, keen to see why this is happening as well!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 11:51 AM
Hey @James Chun, I actually just was able to figure out the issue... there is a function spUtil.simulateFakeFormSubmitForAutoComplete('widget-form', $scope.data.f._fields) that gets called within the function constructResponseHandler() in the client script of the form widget (ID: widget-form). I can't find any documentation on this specific function and have reached out to HIWAVE for more info... but commenting out this code seems to fix the inputs disappearing.
spUtil.simulateFakeFormSubmitForAutoComplete() function, which causes inputted fields to disappear
I figured this out by looking for when/how the widget data gets loaded. Sure enough, when the UI action completes (per the screenshot below) the loadForm() function gets called and then this constructRespondHandler() function gets called. At the end, this fakeSubmit thing happens.
widget-form client script (loadForm() function)
I'll update this thread when I hear back from HIWAVE. Until then... thanks for your help debugging! Hope this helps someone in the future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2024 03:24 PM
Hi,
Since I was also facing the similar issue like above, I have cloned Form widget and tried to comment the code in the cloned widget as you suggested .
but it didn't work for me. Can you please tell me how to test it further?
what was the result of the HI Support for you ? Did they provide you any solution ?