web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    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);


  • rohit1900 Profile Picture
    439 on at

    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

  • Verified answer
    Rustem Galiamov Profile Picture
    8,072 on at

    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

    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.

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    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

    yes you are right i want the same code 

  • Rustem Galiamov Profile Picture
    8,072 on at

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

  • Abdul.Whyne Profile Picture
    10 on at

    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 ?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans