BUI - getFieldValues Synchronously
Content
Hello,
Is there a way to make the code (below) wait for the Promise to complete and get the values before before it moves on (synchronously)?
- At the minute I would have to setup the getFieldValues and run the call to use the field within the getFields
- I want to obtain a field value mid-function and really want to wait for the field to be available without having to chain together lots of calls to make it work
Regards,
David
Version
18aCode Snippet
I want to do something like: var field = ""; ORACLE_SERVICE_CLOUD.extension_loader.load("Sample") .then(function(extensionProvider) { extensionProvider.registerWorkspaceExtension(function(WorkspaceRecord) { WorkspaceRecord.getFieldValues(['Incident.c$fieldX']).then(function(IFieldDetails) { field = IFieldDetails.getField('Incident.c$fieldX').getLabel(); }); }); }); // Use the value field Instead of: var field = ""; ORACLE_SERVICE_CLOUD.extension_loader.load("Sample") .then(function(extensionProvider) { extensionProvider.registerWorkspaceExtension(function(WorkspaceRecord) { WorkspaceRecord.getFieldValues(['Incident.c$fieldX']).then(function(IFieldDetails) { field = IFieldDetails.getField('Incident.c$fieldX').getLabel(); // Use the value CallSomeFunction(field); }); }); });
Tagged:
0