Hi,
I have a Sales Order which has option on printing as:
1. Print
2. Email (Pdf)- It attaches an email and sends.
3. Pdf (It creates a pdf and saves to certain location)
The requirement is whenever after selecting any one of the options, a report runs -> on clicking on the print (on request form of report).
The status of the respective record must changes from Created to Sent.
I tried writing code on OnPostRecord Report as:
recSHNew := SH;
MESSAGE('TRIP-NEW %1',FORMAT(recSHNew."No."));
IF NOT CurrReport.PREVIEW THEN
recSHNew.SETRANGE("No.",recSHNew."No.");
recSHNew.Status := recSHNew.Status::"Sent to Carrier";
recSHNew.MODIFY;
WHERE
SH = Sales header record variable
recSHnew = New Sales header record variable
I tried assigning SH to new recSHNew record variable and then changing the status only for the that specific Sales order.
But it gives error:
Microsoft Dynamics NAV
Another user has modified the record for this Rit after you retrieved it from the database.
Enter your changes again in the updated window, or start the interrupted activity again.
Identification fields and values:
Nr.='13012954'
OK
I closed the complete navision client and reopened it, still the same error persists.
](*,)
0
Comments