Update Main Form

omyvadiyaomyvadiya Member Posts: 124
Hi,
On the sales header i have to update the status field after it prints a pdf of the sales order.
After printing it must update the status of the Sales header.

On sales line it is updating just after the print,as there is code written on the OnValidate of sales line to modify the status field of sales line.

How can i do the same on Sales header

](*,) ](*,) ](*,)

Comments

  • vaprogvaprog Member Posts: 1,141
    Hi omyvadiya

    What client are you printing from? Classic?

    How are you giving the command to print? From a button on the main (header) form? If yes, it should update without any additional programming.

    If you do it any different, you may need to call CurrForm.UPDATE on the form that shows the header.

    If you print it in a way that is not related to the form showing the header, say from the menu pane, then best just forget it.
  • omyvadiyaomyvadiya Member Posts: 124
    Hi Vaprog,

    I am printing the pdf from Functions->Print-> Print Pdf.
    On Print Pdf's-> OnPush-> i call a codeunit which creates the pdf and stores it to C:/ Prints folder.
    i tried updating the status from report, by getting the record and validating the record, its working :lol: ....But the problem is, it is not updating at the same time after printing the pdf,
    i escape the main form after printing the pdf, and then i see the updated status on sales order list.
    But it must update at the same time, i used the Currform.Update(false), on the Sales Header's Status to update the mainform..
    But No LUCK :-k
  • vaprogvaprog Member Posts: 1,141
    Ok, might be that the automatic update only happens when another window is displayed when printing (like the printer selection dialog or a progress bar).
    Try adding the following line after the call to your Codeunit:
    CurrForm.UPDATE(FALSE);
    
  • omyvadiyaomyvadiya Member Posts: 124
    Tried...but no luck #-o
  • MBergerMBerger Member Posts: 413
    Maybe you should show the code that you have so far, if possible
  • vaprogvaprog Member Posts: 1,141
    What happens if you add FIND like this:
    FIND('=');
    CurrForm.UPDATE(FALSE);
    
Sign In or Register to comment.