Hi Everyone,
I am working on the AL coding to fulfil my company's demand but I'm facing a couple of problem here.
1.
I have created an Automate Flow when users press the /Send Approval Request/ button in the Purchase Order page.
So we can find the button /Attach as PDF/ in Print/Send, but I want it automatic.
What I'm trying to do is to automatically generate a PO report to the document attachment when a user press the /Send Approval Request/ button before my flow gets start.
Therefore, my flow can merge the PO PDF file with my Power BI reports.
Simply saying, I want the /Attach as PDF/ automatically done when I press /Send Approval Request/.
I have changed some part of the code from this website (https://yzhums.com/20657/) to suit my situation as below:
However, when I press the /Send Approval Request/ button,
it shows this error and I couldn't solve this:
The changes to the Purchase Header record cannot be saved because some information on the page is not up-to-date. Close the page, reopen it, and try again.
Identification fields and values:
Document Type='Order',No.='106010'
Now I haven't connect the Automation flow with the approval workflow yet, so now in the sandbox has only a standard approval template workflow.
Update:
I changed the trigger OnBeforeAction() to OnAfterAction(). It's working fine for now. Haven't tested it might affect my flow or not since the sandbox doens't have flow yet.
I'll try to make a test flow and see if this is ok to use and update here.
I'm just posting this one for sharing.
but the next question we really can't solve it.
2.
Another issue we have here.
Our planner wants the planning worksheet in dynamics shows the sales order No. if the demand is coming from a Sales Order because the Planning Worksheet indeed is difficult to read when there are tens of lines in there.
We know the Order Tracking line shows the SO No. but it takes too much time.
We have spent days by searching for the way copy the SO No. related in the table but no luck so far.
Perhaps someone knows a simple solution that we couldn't able to imagine.....
Thank you
Joe Kim
joe.kim@alphalabs.co.nz