Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

get the lastrecord of the form.

(0) ShareShare
ReportReport
Posted on by 475

Hi guys,

I have created a purchase order by req. worksheet and whenever i click on the carry out action message the last record of purchase order should be shown.I have tried a lot but it is not working, it is listing all the records from the purchase order.

Please advice,

Bharath K

*This post is locked for comments

  • bharathkarunakaran Profile Picture
    475 on at
    RE: get the lastrecord of the form.

    Thank you for your reply,

    I want to get the last Purchase order to be shown that is created by Req. worksheet while clicking the carry out action message.

    Req worksheet ->new PO -> clicking carry out the action message -> purchase order form of last created purchase order by req. worksheet.

    Regards,

    Bharath

       

  • Suggested answer
    Andrey Baludin Profile Picture
    3,941 on at
    RE: get the lastrecord of the form.

    Form 50 is a Purchase Order. It shows only one order - not all.

    Or you mean something else? We need to see your code.

  • bharathkarunakaran Profile Picture
    475 on at
    RE: get the lastrecord of the form.

    Thanks andrey

    Its working But another problem is

    i want to open last created purchase order in req. worksheet , the code that i written now is opening all purchase orders.

    i,e I created a purchase order with a number last of that no.series and when i ran that purchase order is opening not the last created purchase order from the req. worksheet.

    Please advice

    Bharath K

  • Suggested answer
    Andrey Baludin Profile Picture
    3,941 on at
    RE: get the lastrecord of the form.

    Change Form.RUN to FORM.RUNMODAL

  • bharathkarunakaran Profile Picture
    475 on at
    RE: get the lastrecord of the form.

    hi,

    I am using nav 2009.

    I think you have misunderstood my question,when i click carry out action message on req. worksheet form the last purchase order created must pop in the purchase order form.

    Bharath

  • Suggested answer
    CDsilva Profile Picture
    4,188 on at
    RE: get the lastrecord of the form.

    Hi,

    You mentioned you have a custom action button, carry out. Write your code on the OnAction trigger.

    I'm just inquisitive which version of NAV are you using ?

  • bharathkarunakaran Profile Picture
    475 on at
    RE: get the lastrecord of the form.

    2018_2D00_06_2D00_06-14_5F00_06_5F00_09_2D00_CRONUS-USA_2C00_-Inc.-_2D00_-Microsoft-Dynamics-NAV-Classic.png

    Hi

    Thanks for your reply 

    I tried what you said,but its not working,

    I wrote the code on code function in CU 333 where are purchase orders are created from the req. worksheet but it is not working.

    PLease advice

    Regards

    bharath k

  • Suggested answer
    CDsilva Profile Picture
    4,188 on at
    RE: get the lastrecord of the form.

    Hi,

    Did you try this

    OnAction()

    If PurchaseHeader.FINDLAST Then

    PAGE.RUN(50,PurchaseHeader);

  • Suggested answer
    CDsilva Profile Picture
    4,188 on at
    RE: get the lastrecord of the form.

    Hi,

    Use Findlast to fetch last record

    docs.microsoft.com/.../findlast-function--record-

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans