Sunday, November 19, 2017

How to change the DashboardSettings of maximum controls limit in Dynamics 

The maximum number of controls allowed on CRM2011, CRM 2013 Or CRM2015 dashboards is 6. You cannot put the more than 6 graphs/charts/iframes/web resources etc. on the dashboard.
We can extend the number of controls as per the user needs. This setting is applied to the server not a organization setting. So you cannot change this setting for CRM Online but you can change this for an on-premise installation.

  1. Open the Windows Power Shell command window
  2. Add the Microsoft Dynamics CRM PowerShell snap-in using
Add-PSSnapin Microsoft.Crm.PowerShell
Sometimes You may get the message saying something like “Add-PSSnapin : Cannot add Windows PowerShell snap-in Microsoft.Crm.PowerShell because it is already added.” It is fine no problem.
3.  Run the following 3 commands
$setting = Get-CrmSetting -SettingType DashboardSettings
$setting.MaximumControlsLimit = 10
Set-CrmSetting -Setting $setting
After that open CRM, still you will be see only 6 components on the dashboard design, however you can add extra components based on how much you have set the limit.
Once you crossed the limit you will get following error message.
DashboardSettings
Note the maximum is 20

Monday, February 27, 2017

Ax 2012 Alternative items in production

Introduction:

after a lot of googling on "Alternative items in AX 2012 R3 Production Orders", i found only one answer "use plan group which located in formula line Form", I tried this way more than 4-8 times with no result. I already asked some consultant peoples about what i need to create groups of raw material items and link some alternative items with them group and when one item used in production formula doesn't have enough quantity use another item on the same group which have enough quantity for the production order, they also told me the same way which i found it on google and when i told them that i tried it they told me that you need cumulative update  but i tried to update and also no result but i found that the Plan Group only work on Planned Orders or MRP "Master Plan"
 So i decided to found another way to do my job Let's Start......

  1. Create table for Items Group
  2. Create table for Alternative Items linked with them group
  3. Create form to Insert/Update/Delete Items or Groups 

In Class ProdUpdStartUp there is a lot of functions responsible for production starting stage one of them Called updateBOMConsumption()  this function trigger while you start the production order we have to make minor customization in this function to check each item have enough quantity for the production order or not, if the item doesn't have enough quantity search for another item in its group alternative to it. As below:


prodBOM.selectForUpdate(true);
//Start of customization   

           availQty = ItemInfo::ItemQtyByInventDimId(prodBom.inventDim().inventDimId,prodBom.ItemId);
           itemConsumeQty = (prodTable.QtyStUp * prodBOM.BOMQty)/prodBOM.BOMQtySerie;
           
           if(itemConsumeQty > availQty)
           {
                
               altInventDim =  prodBom.InventDim();
               c = AlternativeItems::findItemId(prodBom.ItemId,itemConsumeQty,altInventDim);
               if (c && conpeek(c,1) != "")
                {
                    altItemId = conpeek(c,1);
                    prodBom.ItemId = altItemId;
                    if (altInventDim)
                        prodBom.InventDimId = altInventDim.inventDimId;
                    else
                        prodBom.InventDimId = InventDim::inventDimIdBlank();
                }
            }

//End of customization

findItemId is a method on table that we create to find suitable item have enough qty for production order
ItemInfo is class contain function that return the physical available qty on given InventDimId