Wednesday, June 21, 2023

Code to open TransTaxinformation form from purcheditlines form in D365 X++

 [ExtensionOf(formcontrolstr(PurchEditLines,TaxInformation))]

internal final class Dax_PurchEditLInes_TaxInformation_Extension

{

    public void clicked()

    {

        Args            args;

        FormRun         formRun,formrunloca,formrunpurchtable;

        PurchLine       purchline;

        FormControl     formcontrol ;

        PurchParmLine   purchparmline;

        next clicked();

        formcontrol = any2Object(this);

        formrunloca = formcontrol.formRun();

        purchparmline = formrunloca.dataSource().cursor();

        select * from purchline

            where purchline.PurchId == purchparmline.OrigPurchId

            && purchline.ItemId     == purchparmline.ItemId;

        args = new Args();

        args.name(formStr(PurchTable));

        formrunpurchtable = new FormRun(args);

        formrunpurchtable.init();

        formrunpurchtable.run();

        formrunpurchtable.close();

        args.name(formStr(TransTaxInformation));

        args.record(purchline);

        args.caller(formrunpurchtable);

        formRun = New FormRun(args);

        formRun.init();

        formRun.run();

        formRun.wait();

     }

  }

No comments:

Post a Comment