g_approval_form_request and $sp.getRecord(); in EC Pro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 09:48 PM - edited 10-18-2023 09:57 PM
We are working on showing the RITM approvals in My Tasks page-EC pro portal
Using the OOB 'Todos Requested Item Approval' widget in Todos configuration , we are able to show only variables not the fields of the RITM. So trying to show all the variables and fields by using custom widget(which is OOB- Approval record- Global scope).
So in this widget they are using a function
g_approval_form_request = true;
var gr = $sp.getRecord();
data.tableLabel = gr.getLabel();
gs.info("Table name is "+ data.tableLabel);
- when I tried to execute the logs we are getting the Approval as a Table label.
But using the same code in Todos requested item widget(EC core scope) doesn't seem to execute the code . It is throwing an error as ErrorServer JavaScript error Cannot convert null to an object.
So I have a query whether the g_approval_form_request = true or $sp.getRecord(); can be used in other scoped applications? or something g_approval_form_request needs to be setanywhere ? I believe we are not able to get the desired o/p only because of these .
Please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 07:34 PM
Hi , how are you?
$sp.getRecord(), only works if the page has the table and sys_id parameters on URL OR if you pass as parameters like
$sp.getRecord("incident",719823789123123123)
If my answer helped you, please mark my answer as helpful.
Vanderlei Catione Junior | LinkedIn
Senior ServicePortal Developer / TechLead at The Cloud People
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 09:32 PM - edited 10-19-2023 09:41 PM
Hi, Thanks for the response.
Yes, page is My Todo's. But I'm looking for approvals and RITM variables.
As you mentioned I've passed the parameters like below where data.sysId is having the approval record sysid. but it is not entering into var gr(before var gr I'm able to see log), but after that the getRecord is not working I believe, Is there something which I have to look/modify
g_approval_form_request = true;
var gr = $sp.getRecord('sysapproval_approver', data.sysId);