D365 for Power Apps : POC

Requirement: Create and Edit the customer groups on a simple mobile Power app.

Prerequisite :
1) Mobile device with Internet
2) Login for Power App website  and D365 access.

Below steps to be followed to achieve the requirement :

Step 1: Login to Power App website with your user

Step 2: Select Dynamics 365 Phone Layout


Step 3 : In Connections tab click New Connection and select Dynamics 365 for Operations


Step 4 : Click Create Button


Step 5 : In Next screen It will show you all the data-set’s which you have access, select a appropriate data-set


Step 6: Choose a table you want to use in your App and click Connect


Step 7 : App screens are created and will be shown to you


Step 8 : Click File and save as and then Name your app and slick save
You can save app to cloud as well as in your PC.


Step 9 : You are done with your part of basic development in Power App web site.
Download the Power app from play store.

Step 10 : Login with the same credentials in you app, and you can see the App created in your  Power App website on your mobile PowerApps.

Sending the Customer Group records From D365 to Outlook: Logic Apps POC

Sending the Customer Group records (D365) to Outlook:

Step 1: Login to the Azure portal https://portal.azure.com with your credentials


Step 2: Search Logic App, and click on it


Step 3: Click create button on the right corner below


Step 4: Give Name and select an Existing resource or create a new resource group and click create


Step 5: Select Blank logic app

Step 6: Perform the following steps :

                1 Create request

                2 Create Response

                3 Take Dynamics 365 operations and select get records


                4 Sign in with your credentials

                5 Add instance and Entity Name

                6 In next step add office 365 outlook and sign in with your credentials

                7 Add To, Subject and Body (Give the field names that needs to be send via mail)

                8 Save the Logic App Designer


                9 Click run, Once the Logic app runs successfully you will see all the green check marks



Excel addin for D365 and Table browser for Chrome

Below steps will guide you to add D365 excel addin to your Excel

Step 1:

Browse the below link, and Click Add button



Step 2:

Click on Open in Excel link


Step 3:

Click on Open Office (desktop) as shown in below screenshot


Step 4:

It will prompt you a window, as shown in below click yes


Step 5:

Excel will be opened and asked for Enable, Click on Enable


Step 6:

After clicking the Enable  a window will be opened on right side of excel to login to your D365 account,



Step 6:

Paste the Same URL in server URL, click on Ok

Login to your D365 account and copy the URL till XXX.dynamics.com



Step 7:

It will ask you to confirm the changes, on clicking the Yes button it will be redirect you to sign in page

login with your account details which is using for D365






How to add multiple report design under Print management in AX 2012

Below are the steps to be followed :

Step1. Create new Design for report under visual studio
Step2. Add code to method:
\Data Dictionary\Tables\PrintMgmtReportFormat\Methods\populate
Add code  before TTSCOMMIT:
addOther(PrintMgmtDocumentType::PurchaseOrderInvoice, ssrsReportStr(VendInvoiceDocument, MyReport), ssrsReportStr(VendInvoiceDocument, MyReport), #NoCountryRegionId);
Step 3. Choose you new format under:
AP -> setup -> form setup -> Print management -> Vendor invoice -> report format to VendInvoiceDocument.MyReport
Step 4.
New Report design can be executed from use Print management from Inquiry journal forms or during posting by selecting Print management destination.
Step 5. (Optional)
In case: the report still keep original design, add this code to class VendInvoiceDocumentController in method outputReport or Main:
//original menu item or your new menu item
if(args.menuItemName() == menuitemOutputStr(MyReportMenuItem))
formLetterReport.getCurrentPrintSetting().parmReportFormatName(ssrsReportStr( VendInvoiceDocument,MyReport));

Extensions In D365

Table Extensions :

The following table lists each table method and its events.

Published Table method Preceding event Succeeding event
validateWrite ValidatingWrite ValidatedWrite
validateDelete ValidatingDelete ValidatedDelete
validateField ValidatingField ValidatedField
validateFieldValue ValidatingFieldValue ValidatedFieldValue
modifiedField ModifyingField ModifiedField
modifiedFieldValue ModifyingFieldValue ModifiedFieldValue
Insert Inserting Inserted
Update Updating Updated
Delete Deleting Deleted
Initvalue InitializingRecord InitializedRecord
FinalDeleteValidation Executed when a delete operation is performed on a table object, before the operation is committed to the underlying database table N/A
FinalInsertValidation Executed when an insert operation is performed on a table object, before the operation is committed to the underlying database table N/A
FinalReadValidation Executed when a read operation is performed on a table object. N/A
FinalUpdateValidation  Executed when an update operation is performed on a table object, before the operation is committed to the underlying database table. N/A


Update Dimensions for the Item,Customer and Vendor

Some times you may get a strange requirement from client to update few dimensions on Default Dimensions :

Below code snippet is used to update the required dimensions without disturbing the other dimensions

//Bellow example will remove the BU,Dept and CC without distrubing the other dimensions
static void ItemDimUpdate(Args _args)
    InventTable inventTable,inventTableselect;
    container dimValue;
    DimensionDefault DimensionDefault,DimensionDefault1;
    str BussinessUnit,CostCenter,Department,ItemGroup,Project;
    int i = 0;

    DimensionAttributeValueSetStorage       dimStorage;
    CustTable                               custTable;
    Counter                                 c;

    while select * from inventTableselect
         i = 0;
         BussinessUnit = "";
         CostCenter = "";
         Department = "";
         ItemGroup = "";
         Project = "";
         dim = new Struct();
         dimValue = connull();

        //Getting values from the Old Dimension
        dimStorage = DimensionAttributeValueSetStorage::find(inventTableselect.DefaultDimension);
        for (c=1 ; c<= dimStorage.elements() ; c++)
            switch (DimensionAttribute::find(dimStorage.getAttributeByIndex(c)).Name)
                case 'BussinessUnit':
                    BussinessUnit = dimStorage.getDisplayValueByIndex(c);
                case 'CostCenter':
                    CostCenter = dimStorage.getDisplayValueByIndex(c);
                case 'Department':
                    Department = dimStorage.getDisplayValueByIndex(c);
                case 'ItemGroup':
                    ItemGroup = dimStorage.getDisplayValueByIndex(c);
                case 'Project':
                    Project = dimStorage.getDisplayValueByIndex(c);

       //Creating the New Dimension
       //Just keep the required dimensions and Comment the other dimensions

       // if(BussinessUnit)
       //     dim.add('BusinessUnit', BussinessUnit);
       // if(CostCenter)
       //     dim.add('Costcenter', CostCenter);
       // if(Department)
       //     dim.add('Department', Department);
            dim.add('ItemGroup', ItemGroup);
            dim.add('Project', Project);

        dimValue += dim.fields();

      //  if(BussinessUnit)
      //  {
      //      i++;
      //      dimValue += dim.fieldName(i);
      //      dimValue += dim.valueIndex(i);
      //  }
      //  if(CostCenter)
      //  {
      //      i++;
      //      dimValue += dim.fieldName(i);
      //      dimValue += dim.valueIndex(i);
      //  }
      //  if(Department)
      //  {
      //      i++;
      //      dimValue += dim.fieldName(i);
      //      dimValue += dim.valueIndex(i);
      //  }
            dimValue += dim.fieldName(i);
            dimValue += dim.valueIndex(i);
            dimValue += dim.fieldName(i);
            dimValue += dim.valueIndex(i);

        //Below code will get the new dimension
        DimensionDefault = AxdDimensionUtil::getDimensionAttributeValueSetId(dimValue);

        inventTable = inventTable::find(inventTableselect.ItemId,true);
        inventTable.DefaultDimension = DimensionDefault;


    info("Updation completed");


Below Code snippet is used to update the Item,Customer and Vendor :

static void ItemDimUpdate(Args _args)
    InventTable inventTable;
    Struct dim = new Struct();
    container dimValue;
    DimensionDefault DimensionDefault;

    dim.add('BusinessUnit', '002');
    dim.add('CostCenter', '007');
    dim.add('Department', '022');
    dim.add('ItemGroup', 'Audio Test');
    dim.add('Project', '000002');  

    dimValue += dim.fields();
    dimValue += dim.fieldName(1);
    dimValue += dim.valueIndex(1);
    dimValue += dim.fieldName(2);
    dimValue += dim.valueIndex(2);
    dimValue += dim.fieldName(3);
    dimValue += dim.valueIndex(3);
    dimValue += dim.fieldName(4);
    dimValue += dim.valueIndex(4);
    dimValue += dim.fieldName(5);
    dimValue += dim.valueIndex(5);  


    DimensionDefault = AxdDimensionUtil::getDimensionAttributeValueSetId(dimValue);
    inventTable = inventTable::find("A0001",true);
    inventTable.DefaultDimension = DimensionDefault;