Announcements
No record found.
Hello ,I have written a logic on sales confirm button in SalesTable form before next but logic is executing after run method.
Can you suggest
Hi Harish, Can you share your code and the run method that you are referring.
[ExtensionOf(classStr(SalesFormLetter))] public final class SalesFormLetter_CAP_Extension { public void run() { SalesLine salesLine ; ReasonMain_CAP reason_Cap; PriceChangeHistory_CAP priceChangeHistory; Dialog dialog; Dialog dlg = new Dialog('@CAP:DialogCaptionInDialogSalesPrice'); DialogField dfReasonCode = dlg.addField(extendedTypeStr(ReasonCode_CAP),'ReasonCode'); FormBuildCommandButtonControl OkButton; OkButton = dlg.formBuildDesign().control( 'OkButton'); //Disable the Cancel button if (salesLine.orig().SalesPrice != 0) { if(dlg.run()) if (dfReasonCode.value() != '' ) { ttsbegin; dlg.closedOk(); priceChangeHistory.ReasonCode = dfReasonCode.value(); priceChangeHistory.CurrencyCode = salesLine.CurrencyCode; priceChangeHistory.OrderNumber = salesLine.SalesId; priceChangeHistory.ItemNumber = salesLine.ItemId; priceChangeHistory.LineNum = salesLine.LineNum; priceChangeHistory.OriginalPrice = salesLine.orig().SalesPrice; priceChangeHistory.UpdatedPrice = salesLine.SalesPrice; priceChangeHistory.ReferenceType = '@CAP:SalesOrder'; priceChangeHistory.CreateDateTime = today(); priceChangeHistory.RecIDSales = salesLine.RecId; priceChangeHistory.TableIDSales = salesLine.TableId; priceChangeHistory.RecIDPriceChange = priceChangeHistory.RecIDPriceChange 1 ; priceChangeHistory.CreateBy = curUserId(); priceChangeHistory.insert(); ttscommit; } else { salesLine.SalesPrice = salesLine.orig().SalesPrice; Error('Please fill the reason code'); } } next run(); } }
Hi Mohit,
I need that my dialog window should open before the standard run method call.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 510 Most Valuable Professional
André Arnaud de Cal... 302 Super User 2026 Season 2
CU-1234529-002 197