Alfasith AX

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

Thursday, October 26, 2017

Conditional based decimal in SSRS

Hi,

=iif(Fields!CurrencyCode.Value ="USD",(FormatNumber(Fields!TotalAmountSumDebit.Value,2)),(FormatNumber(Fields!TotalAmountSumDebit.Value,4)))

Regards,

Tuesday, October 17, 2017

Find number of hits and data usage in SQL * Applicable for all the applications (SQL as DB)

Hi,

Right click on the DB and select script and page below one.

SELECT
tables.NAME AS TableName,
indexes.name as IndexName,
sum(partitions.rows) as NumberOfRows,
sum(allocation_units.total_pages) as TotalPages,
sum(allocation_units.used_pages) as UsedPages,
sum(allocation_units.data_pages) as DataPages,
(sum(allocation_units.total_pages) * 8) / 1024 as TotalSizeMB,
(sum(allocation_units.used_pages) * 8) / 1024 as UsedSizeMB,
(sum(allocation_units.data_pages) * 8) / 1024 as DataSizeMB
FROM
sys.tables
INNER JOIN     
sys.indexes ON tables.OBJECT_ID = indexes.object_id
INNER JOIN
sys.partitions ON indexes.object_id = partitions.OBJECT_ID AND indexes.index_id = partitions.index_id
INNER JOIN
sys.allocation_units ON partitions.partition_id = allocation_units.container_id
GROUP BY
tables.NAME, indexes.object_id, indexes.index_id, indexes.name
ORDER BY
TotalSizeMB DESC

Sunday, October 8, 2017

Checkbox in dialog in X++

static void DialogCheckBox(Args _args)
{
    Dialog      dialog                   = new Dialog("New dialog with checkBox");
    NoYesId     checkValue               = NoYes::No;
    str                         strMessage = "Confirmation will create Variation. \n Click OK to proceed.";
    str                         strTitle = "Confirmation of Project / Contract WBS";

    DialogField dialogFieldVariation     = dialog.addFieldValue(extendedTypeStr(NoYesId), checkValue, "Create variation");
    DialogField dialogFieldVariationType = dialog.addFieldValue(enumStr(ProjBudgetRevRequestorType), "","Variation type");
    DialogField dialogFieldVariationDiscription = dialog.addFieldValue(extendedTypeStr(Description), "" );
    dialog.caption("Confirmation of Project / Contract WBS");
    dialog.addText("Please check to create Variation. Click OK to proceed",0);
    if (dialog.run())
    {
        checkValue = dialogFieldVariation.value();
        if(checkValue)
            info("Hi");
        else
            info("Bye");
    }
}

FileNameSplit() to slip the Directory, file name and extension in D365 FnO

 Hi,     /// <summary>     /// Validate the Fileformat     /// </summary>     /// <param name = "filepath">FileP...