2024 Nov 25 3:28 PM - edited 2024 Nov 25 3:33 PM
Hi,
I need to enhance the standard POD report by adding a custom column with the order status based on some calculations. This is achieved by calling different APIs in a hierarchy sequence.
I am setting values in a json model in LifecycleExtension.js file. These values are, among others, order & status.
Then in ExtensionUtilities.js file I collect these values and update the final report accordingly.
Problem is that in LifecycleExtension.js file I am calling several DM APIs.
Even though I am waiting for the asynchronous call to finish some calls have no response as they have not been finished...
So I have implemented Promise all, where I wrap all the different Promises ( all API calls: orders, boms, materials, etc. ). This is done in onAfterRendering: function inside LifecycleExtensions.js. My assumption was that this Promise all would wait for all the API calls to be completed and then it would release the onAfterRendering: function and would jump to ExtensionUtilites.js where I resume the logic by reading what I have set up in onAfterRendering: function. The problem is that it does not wait and it jumps to ExtensionUtilites.js even when Promise all is not completed
..however these calls are completed after some seconds but it is too late as ExtensionUtilities.js has been executed already.
I am forcing the API calls to be synchronous and that solves the issue but the screen freezes for a long time before it renders the results.
Does anybody have any solution?.
Thanks,
Javier
Request clarification before answering.
User | Count |
---|---|
6 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.