Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2022-05-20 05:00 PM
I have the same custom object replicated in the all layouts (default, submit, review, challenge and approve).
I'm able to read the value of the workflow status in the default layout and act accordingly using the following:
var BPWKStatusVal = $CM.getFieldById(fldIds.BPWKStatus).value;
Where fldIds.BPWKStatus is defined as the ID of the workflow status field on the layout. Using debugger, I'm able to see the Id of the value "Draft"
The html looks as follows
But in all other layouts, it looks like this, and the object is on the layout, but the value is undefined:
and the html looks like this:
The workflow status is Read-only in all layouts. The only difference I noticed was in the html was
"{\"enabled\":true,\"value\":\"91654:0\",\"text\":\"Draft\",\"selected\":true,\"active\":true}"
"{\"enabled\":true,\"text\":\"Pending Process Review\",\"value\":\"91655:0\",\"selected\":true,\"html\":null}"
Any insights?
2022-05-20 05:19 PM
@Archerwizz2022, I'm a little lost on the issue. Regardless of the html attribute is there or not, the value attribute is constantly there.
Advisory Consultant
2022-05-24 10:35 AM
Unfortunately, not. using var BPWKStatusVal = $CM.getFieldById(fldIds.BPWKStatus).value; returns undefined in the all layouts but the "Default". And that's the problem I'm facing.
2022-05-24 12:14 PM
Is field on all the other layouts? It cannot be off layout when referencing fields in an application.
Advisory Consultant
2022-05-24 12:17 PM
Yes, It's on all layouts exactly the same way, where other layouts are copies of the default layout.
2022-05-24 02:08 PM
This is another different issue, but somehow related, if the Workflow Status field is a calculated field with default value set to "Draft", then the value of the field is "undefined" when trying to read it in JavaScript using $CM.getFieldById(fldIds.BPWKStatus).value;