Approving field on sysapproval_approver showing sys_id

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2017 08:32 AM
We just upgraded to Jakarta a few weeks ago and we just discovered the Approving field from the systapproval_approver table is showing the sys_id instead of the value.
I've read the current articles out here regarding the same issue and the workaround is to uncheck the Read Only field on the dictonary.
So in my situation, I've gone to the table to see if the dictionary entry was Read-only and it is not. So why is is still showing the sys_id.
I found a UI Policy that is scripted and I am wondering if this is what is blocking it. Can someone review the code below?
I have not found anything else that would force the sys_id.
function onCondition() {
var docField = g_form.getControl('document_id');
var sysField = g_form.getControl('sysapproval');
var docValue = g_form.getValue('document_id');
if (!docField && !sysField) {
alert('There must be a reference field on the form to associate approval with and item. Use Personalize Form Layout and select the Approving field');
return;
}
// the legacy field is the sysapproval field, going forward using document_id
// for legacy users, if the document_id field does not exist, still allow
// the sysapproval field to prevail
if (!docField && sysField) {
g_form.setVisible('sysapproval', true);
return;
}
// if there is a docField with a value then assume that
// this is a current record and hide the sysapproval field
if (docField && g_form.getValue('document_id').length > 0) {
g_form.setVisible('sysapproval', false);
return;
}
***** I am thinking this may be causing the issues ******
// knowing from test above that there is no doc field with a value
// check to see if there is a sysapproval with a value. If so, assume this
// is potentially a legacy record and allow sysapproval to prevail
if (sysField && g_form.getValue('sysapproval').length > 0) {
g_form.setVisible('sysapproval', true);
g_form.setVisible('document_id', false);
return;
}
// if not a sysapproval with value and not a document_id with data, then assume that this
// is a new record, with an empty doc field and empty sysapproval field, and force
// the docField
g_form.setVisible('sysapproval', false);
g_form.setVisible('document_id', true);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2017 01:42 PM
Karen,
Whichever field is showing sys id, you can change in the code by adding .getDisplayValue().
Prakash

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2017 01:52 PM
Hi Karen,
There are two fields in the Approval table. one is 'sysapproval' which points to the task table. And the other one is 'document_id' field, which is a sys_id field.
If your approval is on a task table, the sysapproval field is also populated with the record ID and it will have the Number field if you add it to the form.
When approval is on a table other than task table, the document_id field gets populated, which is a sys id field.
I dont see a problem with the script you have posted. But you can deactivate that UI policy and check if it works. For me, below is how it appears for me for a document_id/Approving field
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2017 04:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2017 04:48 AM
Hello Karen,
The above approval record, is it attached to a child of Task table?
Thanks,
Kannan