Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

open pending vendor invoice by click method

(0) ShareShare
ReportReport
Posted on by 439

Hi all,

in my form i have a field which is storing vendor invoice number   and I made a button so that when we click on that it should open the relevent pending vendor invoice record, here the form is not straight. i have written the below code to open the form which is not working.

    FormRun  purchEditLines;
    Args clientArgs;

    Args   args;
    VendInvoiceInfoTable    VendInvoiceInfoTable;
    PurchFormLetter purchformletter;
    select VendInvoiceInfoTable  where VendInvoiceInfoTable.Num == SummaryInvoice.VendorInvoiceNumber;

    args = new Args();

    args.record(VendInvoiceInfoTable);
    args.parmEnum(7);

    args.caller(this);
    //args.parmObject(element);

    new MenuFunction(menuItemActionStr(PurchFormLetter_InvoiceActionView  ), MenuItemType::Action).run(args);

*This post is locked for comments

  • Abdul.Whyne Profile Picture
    10 on at
    RE: open pending vendor invoice by click method

    Hi,

    In Dynamics 365fo Action menu item "PurchFormLetter_InvoiceActionView" is not there, so in that case what will be the code to open the selected pending vendor invoice from the table buffer ?

  • Rustem Galiamov Profile Picture
    8,072 on at
    RE: open pending vendor invoice by click method

    I'he used the code from my suggestion. Nothing more...

  • rohit1900 Profile Picture
    439 on at
    RE: open pending vendor invoice by click method

    yes you are right i want the same code 

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at
    RE: open pending vendor invoice by click method

    Hi rohit1900!

    I've created one pending invoice from two different PO and then run the code:

    Screenshot-2018_2D00_11_2D00_13-at-22.56.27.png

    You need to get the same result?

  • rohit1900 Profile Picture
    439 on at
    RE: open pending vendor invoice by click method

    Hi the above code works fine for the single pending invoice(if pending vendor account  contains single PO lines)

    I have a pending vendor invoice which has multiple PO attached to  single  vendor invoice 

    how to open the  vendor invoice by the click of  button i tried the above code which is not working any modification required.

  • Verified answer
    Rustem Galiamov Profile Picture
    8,072 on at
    RE: open pending vendor invoice by click method

    Ohh..sorry.

    Try to use PurchTable as a args record parameter:

        Args                    args;
        VendInvoiceInfoTable    vendInvoiceInfoTable;
        PurchTable              purchTable;
    
        select purchTable
        join vendInvoiceInfoTable
            where vendInvoiceInfoTable.Num           == "yourInvoiceNum"
               && vendInvoiceInfoTable.ParmJobStatus == ParmJobStatus::Waiting
               && vendInvoiceInfoTable.PurchId       == purchTable.PurchId;
    
        args = new Args();
    
        args.record(purchTable);
        args.parmEnum(7);
    
        new MenuFunction(menuItemActionStr(PurchFormLetter_InvoiceActionView), MenuItemType::Action).run(args);
  • rohit1900 Profile Picture
    439 on at
    RE: open pending vendor invoice by click method

    Thanks for the reply

    the code which is given by you  will open the posted vendor invoice not the pending vendor invoice.

    actually in code I have created  a vendor invoice(not posting it)  and in the form given one button

    which  should open the particular pending vendor invoice directly and user can post it directly without going to pending vendor invoice

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at
    RE: open pending vendor invoice by click method

    Hi rohit1900!

    If you want just to open the form with selected invoiceId you should use VendInvoiceJournal form and Display menu item:

    Args               args;
    VendInvoiceJour    vendInvoiceJour;
        
    select vendInvoiceJour  
        where vendInvoiceJour.InvoiceId == "yourInvoiceNum";
    
    args = new Args();
    
    args.record(vendInvoiceJour);
        
    new MenuFunction(menuitemDisplayStr(VendInvoiceJournal), MenuItemType::Display).run(args);


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 AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
shanawaz davood basha Profile Picture

shanawaz davood basha 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans