You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to get current field value using IFieldDetails.getField().getLabel()?

Question
25
Views
0
Comments
edited Nov 14, 2017 4:41PM in UI Extensibility

Content

Hi community!

I implemented the code in Code Block section to update a global attribute (jobprofile_id) and to call showHideJobProfile() function every time a new JobProfile (implemented as a Custom Object with a relationship to Incident) is selected.

My issue is that every time I run this and test it by changing the JobProfile value, the latest value of CO$JobProfile is retrieved instead of the current one.

Could anyone help me with this?

Thanks.

 

Code Snippet

             WorkspaceRecord.addFieldValueListener('Incident.CO$JobProfile', function(fvl){
	WorkspaceRecord.getFieldValues(['Incident.CO$JobProfile']).then(function(IFieldDetails)
	{
		jobprofile_id = IFieldDetails.getField('Incident.CO$JobProfile').getLabel();
	});
						
	console.log("jobprofile_id updated by addFieldValueListener: "+jobprofile_id);
				
	showHideJobProfile();
}); 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!