So i have a piece of code below:
So my goal is to open the sales quote from the number that is extracted through the QuoteNotification.GetData function. Now note that when i message the QuoteCode it is the acctual correct code from the quote i want to open so having the wrong code is out of question. Now for opening the quote i have the following problem. Let's say i'm working in quote number 1005 and from there i want to open quote number 1001. When i perform the action it just reopens / refeshes (the page blinks) the quote i'm working in, in this case quote number 1005 and it doesn't open quote number 1001. Is there a solution to this problem?
*This post is locked for comments
Your problem is that the Sales Header has the primary key Document Type and No. and you are just trying to get the No.
QuoteNo := QuoteNotification.GetData('QuoteNumber');
Evaluate(QuoteCode, QuoteNo);
if QuoteRec.Get(QuoteRec."Document Type"::Quote,QuoteCode) then begin
QuotePage.SetRecord(QuoteRec);
QuotePage.Run();
end;
You can also filter the record and use page.runmodal function.
QuoteRec.SetRange("Document Type", QuoteRec."Document Type"::Quote);
QuoteRec.SetRange("No.", QuoteCode);
Page.RunModal(Page::"Sales Quote", QuoteRec);
Hi
Sales Header has Document Type and No. as the primary key. So you have to mention both when using Get method.
So change the code accordingly.
if QuoteRec.Get(QuoteRec."Document Type"::Quote, QuoteCode) then begin
Regards
Avinash B
Sohail Ahmed
2
mmv
2
Amol Salvi
2