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)

Create

(0) ShareShare
ReportReport
Posted on by 502

Hi All,

I need to call PurchEditLines form for generate one packing slip from some lines of some purchases like pushing "select" button at PurchEditLines form. I couldn't found anything about this.

I looked up purchformletter class without any success...

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    I didn't get what you need when you posted the same on DUG  and nothing has changed. Instead of copying it to more and more forums, could you please spend few minutes describing your problem? It would also help if you actually asked a question.

  • Community Member Profile Picture
    on at

    Martin, you are right.

    Because of this issue lots of queries are getting skiped and not getting answered properlly.

    @METIN & all others,

    Please help us with more information in your queries..

  • metin emre Profile Picture
    502 on at

    English is not my native language, I didn't realize my post is not clear. If someone would be said "I didn't get what you need" before, I would not be choose this way, I try last days without success... I thought, noone knows a way at that forum, so tried my change with other forums. I'm trying again with hope more clearly:

    You can run PurchEditLines and select some lines of some purchases with select button. I just want to do this with X++:

    1-Select some purchases with purchFormLetter class (I just succeded select one purchase).

    2-Filter some lines of these purchases. (I couldn't succeded)

    3-Show these at PurchEditLines form.

    This is my code part:

    l = purchformletter::construct(DocumentStatus::PackingSlip);

    args.object(l);

    args.record(tmpPurchTable);

    args.parm(VendReceiptsListJour.ReceiptsListId);

    mf = new menufunction(identifierstr(purchformletter_packingslip), MenuItemType::Action);

    mf.run(args);

    There are more than one record at my tmpPurchTable temporary table but it see just one of them. Also I need to filter some lines of these purchases, I couldn't find out a way...

    Please, I'm waiting an answer... :)

    I hope I could tell me at this time... :(

  • Verified answer
    metin emre Profile Picture
    502 on at

    Found solution. It was hard for me to find out:

       Object                  formRun;

       Args                    args = new Args();

       PurchFormLetter         purchFormLetter;

       purchTable              purchTable;

       VendReceiptsListTrans   ListTrans;

       PurchParmLine           purchParmLine;

       PurchParmTable          purchParmTable;

       ;

       select purchTable where purchTable.PurchId == this.PurchId;

       purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);

       purchFormLetter.parmSourceTable(purchTable);

       purchFormLetter.initLinesQuery();

       purchformletter.createParmUpdate();

       purchformletter.chooseLines();

       while select OrigpurchId from ListTrans

           group by ListTrans.OrigPurchId

           where ListTrans.ReceiptsListId == this.ReceiptsListId && ListTrans.OrigPurchId != this.PurchId

       {

          select purchTable where purchTable.PurchId == ListTrans.OrigPurchId;

           purchformletter.updateQueryAndChooseLines(purchTable);

       }

       ttsbegin;

       while select forupdate purchParmLine

           where purchParmLine.ParmId == purchformletter.parmId()

       {

           select firstonly ListTrans where ListTrans.ReceiptsListId == this.ReceiptsListId && ListTrans.OrigPurchId == purchParmLine.OrigPurchId &&

                   ListTrans.ItemId == purchParmLine.ItemId;

           if (ListTrans.RecId == 0)

               purchParmLine.delete();

       }

       update_recordset purchParmTable setting num = this.ETGpackingSlipId where purchParmTable.ParmId == purchformletter.parmId();

       ttscommit;

       purchformletter.reArrange(true);

       args.name(formstr(PurchEditLines));

       args.caller(purchformletter);

       formRun = ClassFactory.formRunClass(args);

       formRun.init();

       formRun.ETGfromVendReceiptJour(this.RecId);

       formRun.run();

       formRun.wait();

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans