This info is very useful in order to pre-set the staging approval and it works. But the thing is the stage loaded to slow and the loading bar is close even before all the stage finish loading. I believe it has to be with the app.closeDialog()
. So I try to put it inside some condition to check if the Label1
has finish loaded or not:
requestDs.relations.WorkflowStages.createItem(function() {
var createDatasource = requestDs.relations.WorkflowStages.relations.Approvers.modes.create;
var draft = createDatasource.item;
draft.Email = 'xxx@airasia.com';
draft.Name = 'xxxx xxxx';
createDatasource.createItem(function(createdRecord) { });
if (requestDetailsPage.descendants.StagesList.descendants.StagesListRow.descendants.DraftStagePanel.descendants.Grid1.children.Grid1Cell.descendants.Label1.loaded) {
app.closeDialog();
}
});
}
So if Label1
had finished loading only then it will close the loading bar. Anyway I don't think I have reference it correctly to the Label1
and got error like
descendent is not defined
Can anyone help me to solve this? or suggest a better to way to do it ..