Open Forum

Expand all | Collapse all

Page Extension for Sales Orders and BlanketSales Orders

  • 1.  Page Extension for Sales Orders and BlanketSales Orders

    TOP CONTRIBUTOR
    Posted Feb 25, 2020 02:42 PM
    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
    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: Page Extension for Sales Orders and BlanketSales Orders

    GOLD CONTRIBUTOR
    Posted Mar 02, 2020 05:42 AM
    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
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role