I need some help here on finding a right way to do this.
I had originally asked this question about awaiting the completion of a long running operation. That question was answered, but it didn't solve the issue.
I have a custom action that opens a Smart Panel to capture some data from the user, which is then passed into a long running operation to fetch physical inventory count data from Zoho and update the INPIReview document.
This all works.
However, when processing the import, an important step is to record any items that were counted in Zoho, that do not exist on the Physical Inventory Review document so the user can be alerted that some additional items were counted.
There won’t be many items, so we simply opted to write the details of those extra items to trace, and then notify the user with a dialogue box warning them that extra items were counted and they need to review the trace log.
This also works - kind of.
After clicking “OK” on the dialogue box that pops up, the original Smart Panel pops up again.
According to this article, “The ask method actually throws an error that the system then catches and displays the popup window. After the user interacts with it the system calls the same method except the call to Ask now returns the value from the user interaction.”
I’m wonding if this may be why the smart panel is being triggered again, but I’ve tried so many different things, and I can’t get it to behave properly.
I just want to call the dialogue box AFTER the long running operation is completely finished, if the value of my “didWriteToTrace” variable is true.
I also tried creating a class that implements the IPXCustomInfo interface and just triggering a PXException in the Complete() method. However, it still seems to execute prior to the completion of the process, and throwing the exception prevents it from completing correctly.
Am I on the right track here?
