Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Thursday, June 16, 2022

Count the no of rows updated using update_recordset in AX 2012/D365

Hi,

static void Job560(Args _args)
{
    PurchLine       purchLine;
    PurchTable      purchTable;
 
    update_recordset purchLine
        setting
            CustomerRef = "CUST_0012"
        join PurchTable
            where PurchTable.PurchId == "PO-000368"
            && PurchTable.PurchId == purchLine.PurchId
             && purchLine.CustomerRef == "";
    info(strFmt("PurchTable = %1, PurchLine = %2 records updated",purchTable.RowCount(),purchline.RowCount()));
}


Regards,

Thursday, May 19, 2022

Get current record or select datasource of formDataSource extension of a form in D365

  Hi,

[ExtensionOf(formDataSourceStr(SalesTable, SalesLine))]

final class Dpay_SalesTable_SalesLine_FDS_Extension

{

        //init of SalesLineDS of SalesTable form

void initValue()

{

FormDataSource     formDataSource = this;


SalesLine    salesLine = formDataSource.cursor();

                

                //your logic        


next initValue();


//Your logic

}

}


Regards,


SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...