Alfasith AX

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

Wednesday, July 14, 2021

Alternative row colors with different scope in SSRS

 Hi,


Alternative colors without any scope or condiction.

=iif(RowNumber(Nothing) Mod 2, "#ffffff", "#f0f0f0") 


Alternative colors with scope or condiction.

=IIF(RunningValue(Fields!CustId.Value, CountDistinct, Nothing) MOD 2 = 1, "#ffffff", "#f0f0f0") 


We can display alternative colors based on distinct running values or by parent groups or specific condition like

=IIF(Fields!Amount.Value > 35000 , "#ffffff", "#f0f0f0") 


Even we can achive group with in group cases and Matrix cases by selecting particular cells.


Regards

Wednesday, July 7, 2021

Jobs to export CSV from D365

 Hi,


class DpayExportCSV

{        

     /// <summary>

    /// Runs the class with the specified arguments.

    /// </summary>

    /// <param name = "_args">The specified arguments.</param>

    public static void main(Args _args)

    {

        CommaStreamIo commaStreamIo = CommaStreamIo::constructForWrite();

        SalesTable       SalesTable;

        SalesLine       SalesLine;

        FilePath  tempDir = "C:\\Temp\\SalesTable.csv";

       // #define.filename(@'C:\Temp\SalesTable.csv')

        ;

 

        const str fileName = 'SalesTable.csv';

        commaStreamIo.writeExp(['Level', 'SalesId', 'CustAccount','DlvTerm']); // Header

        while select * from SalesTable

        {

            commaStreamIo.writeExp(['OH', SalesTable.SalesId, SalesTable.CustAccount,SalesTable.DlvTerm]);

            while select SalesLine where SalesLine.SalesId ==  SalesTable.SalesId

            {

                commaStreamIo.writeExp(['OL', SalesLine.ItemId, SalesLine.SalesQty, SalesLine.InventDimId]);

                //// You may further add your componbenets table below to this within this loop

            }

        }

        System.IO.Stream stream = commaStreamIo.getStream();

        stream.Position = 0;

 

        FileUploadTemporaryStorageResult result = File::SendFileToTempStore_GetResult(stream, fileName);

       // System.IO.File::Move(result.getFileName(),tempDir);

        System.IO.StreamReader sReader = new System.IO.StreamReader(result.openResult());


        // Set file contentn string

        str  fileContent = sReader.ReadToEnd();

        //System.IO.File::Move(fileContent,tempDir);

        // Save file

        File::SendStringAsFileToUser(fileContent, tempDir);

        

      //  File::SendFileToTempStore(stream,"\\C:\\Temp\\SalesTable.csv");

        info(result.getDownloadUrl());

        Message::Add(MessageSeverity::Informational, result.getDownloadUrl());

        

    }

}


Regards,

REST Vs SOAP in AX 2012/D365

Hi,

The integration between 2 application/platform to perform the action of integration is termed as API (Application programming interface).

Integration will be in the forms of URL that contains service address with hosted location (server).

REST and SOAP are the 2 API services.

The REST and SOAP has its own unique properties and behaviour.

SOAP will support only XML structure of data format.

REST supports all the structure of data format viz JSON.

WSDL (Web Services Description Language) based call services are SOAP API.

AX 2012 cannot be integrated directly from any API, for that we have to create serviceReference in Visual Studio and to be deploy the project in AOT to consume the functions and object present in that services.

AX2012 supports only SOAP web services.

 D365 can be integrated by custom web services or ODATA. It creates 2 endpoints one for REST and other of SOAP.

Regards,

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...