Posts

Showing posts from 2018

"Object reference not set to an instance of an object Error" When you do show all Fields

Image
Hi All , Just wanted to share a quick note about issue we faced once we upgraded to  Application version  7.2,  PU 12. If you visit any standard/customized form  where you added default dimension field wherein you specify  dimension entry control and you try to click show all fields from Options > record Info menu You get error "Object reference not set to an instance of an object."  The Reason behind  this error is , at run time in dimension entry Control class they re trying to create text control  using "dimensionEntryController" object without doing check if the object instance exist or not. KB 4051199 has been released to fix this issue, just get it from LCS and apply to your environments if you face these issue. 

Find References in dynamics 365 for operations using PowerShell

Image
Just wanted to share quick note about finding references from PowerShell . In dynamics 365 for operations you can use find references or cross references (Previous version AX 2012) from visual studio . Suppose you want to find In which objects a particular enum is used then in visual studio you can just click on that enum and click find references and it gives you list of objects where that particular Enum is used . With following PowerShell command along with object name you can see line of code where that particular enum is used with line number. To get the result perform following steps. First navigate to package folder so that you can refine your search. In my example I am using application suite and in my case pacakesLocalDirectory is at J drive . It can be in different drive as well. With updates 12 machines I can see its moved to K drive. cd J:\aosservice\PackagesLocalDirectory\ApplicationSuite And then use following command to search Get-ChildItem -Recurse -Filte

Customizing D365 with event handlers

With Dynamics 365 release we have to do most of the things using extensions and event handlers. You still have an option to over layer code. While creating new package if you choose select existing packages and modified any standard object which belongs to that package, you are doing overlaying.  In previous versions it was not a big  issue but with new release we should stop doing that and instead embrace a practice of doing customizations using extensions and event handlers. Source code and metadata of model elements can be extended without an over-layering using extensions. Today I will share some code snippets about how to  do few things while using event handlers How to get Form Datasource If you copy form event handler here is how you can get form datasource from XFormRun [FormEventHandler(formStr(HcmPosition), FormEventType::Initialized)] public static void HcmPosition_OnInitialized(xFormRun sender, FormEventArgs e) { FormDataSource hcmositio