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)

add items to PurchLine by my query

(0) ShareShare
ReportReport
Posted on by 2,050

Greeting

i have an issue i want add ItemId to PurchLine directly depending on my query

the query is work and it's bring ItemId  but the problem is not add it on PurchLine

so here i create button on PurchTable

7318.1.PNG

here's button

0474.2.PNG

and this is my code on my created button



void clicked()
{

    InventTable invTable ;
    while select * from invTable
    where invTable.NameAlias ==Reference_VendorRef.text() &&
    invTable.PrimaryVendorId ==PurchTable_OrderAccount.text()


    {
         PurchLine_ItemId.setFocus();
        PurchLine_ItemId.text(invTable.ItemId);

    }

    super();
}

and this is reference used in my code 

2541.3.PNG

so can you please help me to how fill PurchLine directly depending on my query

*This post is locked for comments

I have the same question (0)
  • Verified answer
    mohammed.mqi Profile Picture
    2,050 on at

    thanks  Crispin John Augustine for responded that's so helpful

    i edit my code and it's work fine here's my code

    void clicked()
    {
    
        InventTable invTable ;
    
        while select * from invTable
        where invTable.NameAlias ==Reference_VendorRef.text() &&
        invTable.PrimaryVendorId ==PurchTable_OrderAccount.text()
    
    
        {
            PurchLine.clear();
                PurchLine.PurchId = PurchTable_PurchId.text();
                 purchLine.ItemId=invTable.ItemId;
                 purchLine.createLine(NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes);
                PurchLine.update();
        }
        super();
    }


    but i have small issue i need update grid PurchLine after that automatically 

  • Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Use code purchLine_ds.executeQuery()(after super()) after your update to refresh and fetch updated values onto your grid.

    Thanks,

    Chaitanya Golla

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
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans