Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't access Workflow status value from Submit layout

Archerwizz2022
Contributor III

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"

image.png

The html looks as follows

image.png

 

 

 

 

 

 

But in all other layouts, it looks like this, and the object is on the layout, but the value is undefined:

image.png

and the html looks like this:

image.png

 

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?

5 REPLIES 5

DavidPetty
Archer Employee
Archer Employee

@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

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.

Is field on all the other layouts?  It cannot be off layout when referencing fields in an application.

 Advisory Consultant

Yes, It's on all layouts exactly the same way, where other layouts are copies of the default layout.

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;