Hi Mark,
Yes, there is a better way than a 100% duplicate code.
The Function that you are created should accept a parameter Sales Line.
The first thing in the function you can do it Identify the Document Type - Quote,Order,Invoice,Credit Memo,Blanket Order,Return Order.
If Document Type is not in Order or Blanket Order, then you can skip from function otherwise you can proceed.
Hope it helps.
------------------------------
Saurav Dhyani
Upgrade Technical Futurist
ArcherPoint Inc.
Duluth
Blog -
https://saurav-nav.blogspot.com------------------------------
Original Message:
Sent: Feb 25, 2020 02:42 PM
From: Mark Anderson
Subject: Page Extension for Sales Orders and BlanketSales Orders
Hi All
I'm writing an extension that operates on sales lines and blanket sales lines. I need to add two menu items (actions) to the Line menu. Whether it's a sales order or blanket sales order, they both call the same codeunit where the code branches based on sales order or blanket sales order.
Right now, my AL file has 100% duplicate code except for:
pageextension 50021 SalesLinesExt extends "Sales Order Subform"
{
...
}
pageextension 50022 BlanketSalesLinesExt extends "Blanket Sales Order Subform"
{
...
}
This doesn't feel right to me. Is this the correct way or is there a better way?
Thanks
Mark
Mark
------------------------------
Mark Anderson
Director of ERP Systems
Clesen Wholesale
Evanston, IL
------------------------------