Refresh a Prod Order but without the pop up

Hello and good afternoon, I am working on a project that basically allows reading an inbound xml file via NAV XMLPORT and subsequently creates various records: a sales order, a BOM, and a production order. I am able to automatically release the SO, certify the BOM, but stumble on how to refresh the production order WITHOUT getting the request screen to come up. Any help or guidance is greatly appreciated. Thank you all in advance. Sean

Hi,
you can add a custom function in the codeunit which have function to refresh the Production Order (5407 if that is correct), which accept parameters that you will fill in the request page.

The Function will be something like -
SetParameter(ProdOrder : Record “Production Order”;NewStatus : ‘Quote,Planned,Firm Planned,Released,Finished’;NewPostingDate : Date;SNewUpdateUnitCost : Boolean)

ChangeStatusOnProdOrder(ProdOrder,NewStatus,NewPostingDate,NewUpdateUnitCost);

Then call this function from with required parameter and it should do the magic.

Let me know if any doubts.

Thanks for the tip. I have something else that I can apply your code for. For the question above, I should have stepped away for coffee then come back at it. I did that right after posting the question then the light bulb went back on!

The Report.RUN function takes 4 parameters, and the second one is a Boolean that determines whether the request form should come up or not. I made that False and mission accomplished.

Thanks for your help!