Approving field on sysapproval_approver showing sys_id

Cupcake
Mega Guru

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.

find_real_file.png

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);

}

14 REPLIES 14

Community Alums
Not applicable

Karen,



Whichever field is showing sys id, you can change in the code by adding .getDisplayValue().



Prakash


SanjivMeher
Kilo Patron
Kilo Patron

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



find_real_file.png



Please mark this response as correct or helpful if it assisted you with your question.

Thank you for replying Sanjiv,


        My dictionary entry appears the same. That's why I am confused as to why it is still showing the sys_id. See below:



find_real_file.png



find_real_file.png



Still not working.



Karen


Hello Karen,



The above approval record, is it attached to a child of Task table?



Thanks,


Kannan