Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Call to page part action in Navision

(0) ShareShare
ReportReport
Posted on by 2,576

Hi,

I have created an action in sales order page which when clicked should create released production order of the sales order and then the lines from the released production order should get posted automatically.

But how can I call a page part action i.e. the released production orders 'show production journal' function from the sales order page ?

I used the following line in my sales order page:

ReleasedProductionOrderPage.ProdOrderLines.PAGE.ShowProductionJournal;

But it does not work.

Please suggest as to how can I do this.

*This post is locked for comments

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Call to page part action in Navision

    By looking at your requirement you are going to create released production order from Sales Order and after creation it should post output journal automatically.

    You can check How NAV create Production order from sales order and then you need to write program to create output journal and post the same.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Call to page part action in Navision

    Try to find the production order of the sales order and than the production order line then execute the function which is in showproductionjournal

    ProdOrder.RESET;

    ProdOrder.SETRANGE("Source Type",ProdOrder."Source Type"::"Sales Header");

    ProdOrder.SETRANGE("Source No.","No.");

    IF ProdOrder.FINDFIRST THEN BEGIN

     ProdOrderLine.RESET;

     ProdOrderLine.SETRANGE(Status,ProdOrder.Status);

     ProdOrderLine.SETRANGE("Prod Order No.",ProdOrder."No.");

     IF ProdOrderLine.FINDFIRST THEN

        ProductionJrnlMgt.Handling(ProdOrder,ProdOrderLine."Line No.");

    END;

    Where ProductinJrnlMgt is the codeunit  of Production Journal Mgt

    ProdOrder is the Record of Production Order

    ProdOrderLine is the Record of Production Order Line.

  • Suggested answer
    RE: Call to page part action in Navision

    Hi,

    Check "Source No." of Table 5405.

    You can write code to open the Production Order List Page.

    Maybe something like in the Page Action.

    ProdOrder.SETRANGE(Status, ProdOrder.Status::Released);

    ProdOrder.SETRANGE("Source No.", "No.");

    RelProdOrder.EDITABLE(FALSE);

    RelProdOrder.SETTABLEVIEW(ProdOrder);

    RelProdOrder.RUN();

    RelProdOrder is a Page variable of Page 9326, ProdOrder is a record variable of Table 5405.

    Hope it helps.

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans