How to get current field value using IFieldDetails.getField().getLabel()?
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(); });
0