Latest Microsoft Dynamics 365 Blogs | CloudFronts - Page 129

Prepopulating Lookup and dropdown fields on a Form in D365 CRM Portals using JS

Overview: In this blog we will see how we can prepopulate lookup and dropdown (option set) fields on an Entity form in D365 CRM Portals using JS. Pre-Requisites: D365 CRM Portals D365 CRM Environment Introduction We know that if we want to prepopulate a lookup or a dropdown field on a form in CRM Portals the best method is to use Entity Form Metadata. But there is an alternative way to prepopulate the Lookup and dropdown (Option set) fields on an Entity form in D365 CRM Portals using JS. Scenario: To implement the functionality of prepopulating a lookup field we will be using the account lookup field on the CRM entity form based on the value entered in the contact field for a created opportunity in the partner portal. For the prepopulating the dropdown field we will be using the opportunity status field. Process: First of most we will see how to prepopulate the lookup field on the entity form based on the value entered in another field. As mentioned in the above scenario we need to prepopulate an account field on an opportunity form based on the value present in the contact field. To insert a value into a lookup field using JS(jquery) we need the following information as mentioned below. The field value to be displayed. For eg. Account full name. The GUID if the record to be displayed. For eg. GUID of the account record. The logical name of the entity. For eg. Logical name of the account entity. Now we will see how to get these details form the existing information we have on the opportunity form. When we open an opportunity record, on the details page in the URL section we get the id of the opportunity record as shown below We will insert this id into the fetch xml using liquid template to obtain details of the contact related to the following opportunity record as shown below. As shown above we have used the opportunity id in the fetchxml to get the contact details. Once we have obtained the contact details from which we will be using the contact name value in the next fetchxml to get the related account information. In the following below shown fetchxml we will get the value and the id of the account record to be inserted. Once we get the account record details we will write the jquery in the following manner to insert the value into the lookup field. Jquery syntax: <script> $(“form_attributeid_name”).val(“record_value”); $(“form_attributeid”).val(“record_GUID”); $(“form_attributeid_entityname”).val(“entity_logicalname”); </script> Once we publish the liquid code we will see that the account field on the opportunity form is prepopulated with the value related to the value present in the contact field. For prepopulating the dropdown(option set) field we need the option set value of the record to be displayed. To set the value in the option set we will write the following jquery. $(form_attributeid).val(“attribute_optionsetvalue”); Hope you all find this blog helpful. Happy coding in CRM portals.

Share Story :

Add custom Table method on Form in D3FOE

Background: As we know, we can only work with Extension code in D365 Finance and Operations. In this blog article, we will see how we can add a custom display method to a Table and display it on form using Extension. Steps: Create a new Class Add Display method Display the method on form 1. Create a new Class: Go to Solution Explorer -> Project Right Click -> Select ‘Add new Item’ Select Class -> Enter Name. Class name can be anything ending with ‘_Extension’. Eg. <ClassName>_Extension Click Ok 2. Add Display method: Public Static class CFLoyaltyaddphone_Extension // Class must be static  {      [SysClientCacheDataMethodAttribute (true)]  //This statement will cache display method      public static display LogisticsElectronicAddressLocator CFS_GetPhoneno (RetailLoyaltyCard _this) //Pass Tablename as Parameter      {          DirpartyTable dirPartyTable;          Dirpartylocation dirpartylocation;          LogisticsElectronicAddress logisticsElectronicAddress;          select * from dirpartylocation              where  dirpartylocation.Party == _this.Party              join logisticsElectronicAddress               where logisticsElectronicAddress.Location == dirpartylocation.Location               && logisticsElectronicAddress.IsPrimary == NoYes::Yes               && logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Phone ;           return logisticsElectronicAddress.locator; //Return Field value                       }   } 3. Display the method on Form: Add the field type on form Design. Change the below property  

Share Story :

How to Customize Microsoft Dynamics NAV Startup Screen

Dealers must guide out how they need information, for example, stock, requests, clients, and items to move through every framework. At that point, they should assemble a stage that bolsters these streams. This requires a group with broad information on your frameworks to have the option to fabricate a custom combination arrangement without any preparation. Microsoft dynamics nav upgrade provides you all of this Explanations behind structure a custom coordination including your business having incredibly remarkable necessities or the requirement for unlimited oversight and responsibility for venture. You should have the option to assemble, uphold, and keep up the incorporation. On the off chance that you have the correct prerequisites to legitimize it, at that point custom reconciliation could be best for you. Introduction: This blog describes how to change the screen while loading Microsoft Dynamics NAV Pre-requisites: Microsoft Dynamics NAV Steps: 1. Navigate to the path C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\Images. 2. Open the splash screen in Paint and save it with extension .png. I’ve added the text ‘Happy New Year’. 3. Copy and replace the image in the above folder. 4. Launch Microsoft Dynamics NAV.

Share Story :

Create and Associate records using Xrm.WebApi

Posted On December 30, 2017 by Clinton D'Mello Posted in Tagged in

Introduction: In this blog we will demonstrate how to create and associate records using Xrm.WebApi which provides methods to use Web Api to create and manage records. Implementation: Step 1: The syntax to create a new entity record is as follows: Xrm.WebApi.createRecord(entityLogicalName,data).then(sucessCallback,errorCallback); Here entityLogicalName(string) and data(object) parameters are required. The “data” parameter is a JSON object defining the attributes and values for the new record. Step 2: In this example we will create a sample account record along with a primary contact for that account, associate an opportunity to the account and create task and notes for the opportunity all in a single operation. This type of process is called as a deep insert. The code for the same is as shown below: var scripting = { recordCreation: function () { var data = { “name”: “CRAYONS LTD.”, “description”: “This Account is Created using a Web API”, “creditonhold”: false, “telephone1”: “9954565154”, “address1_city”: “Mumbai”, “primarycontactid”: { “firstname”: “Clinton”, “lastname”: “Dmello” }, “opportunity_customer_accounts”: [ { “name”: “Opportunity Associated to CRAYONS LTD.”, “Opportunity_Tasks”: [ { “subject”: “Task Created” } ], “Opportunity_Annotation”: [ { “subject”: “Note Created”, } ] } ] } Xrm.WebApi.createRecord(“account”, data).then( function success(result) { console.log(“Account Created with ID” + result.id); //perform operations on record creation }, function (error) { console.log(error.message); } ); } }; Step 3: In order to associate to an existing record @odata.bind annotation can be used. For Example: “primarycontactid@odata.bind”:”/contacts(GUID of the contact)”. Screenshots 1. A New Account is created with the name “CRAYONS LTD” and in the primary contact file the primary contact is set with the name Clinton Dmello as set in the code. 2. Also an opportunity is associated to the account as shown below in the associated view. 3. In the opportunity we can see the newly created task in the activities and a note as shown below. Hope this helped!

Share Story :

Zero Amount Issue for Expense Entry of T&M Project in D365 PSA

Introduction: We often get issues raised by Users while training PSA – Amount entered on Expense Entry is not reflecting on Invoice in T&M Project and instead shown as $0 as below. Resolution: We need to configure PSA correctly and check below configurations. 1. Sales Price List of Project is configured with Category Prices and not as shown below 2. Cost Price List of Organization Unit is configured with Category Prices and not as shown below 3. Amount in Chargeability View of Project Contract Line should have values in Sales Price Column of Chargeable Categories for expenses and not as shown below Conclusion: Zero Amount issue get resolved after configuring Category Prices in Price List and Chargeability View of Contract Line correctly and results are as shown below  

Share Story :

Actionable Audit App to access audit logs in D365

Introduction: In this blog we will see how audit logs in D365 can be fetched that can be used for reporting purposes. Auditing helps to track changes made to the data in D365. The System Auditing entity cannot be accessed. Actionable Audit is a App by Microsoft Labs in which the required audit logs can be stored in the actionable audit entity which can be used later on by fetching the records of that entity. This audit log can be helpful to create Dashboards in Power BI, create reports etc to get meaningful information from the data. Implementation: Step 1: First we enable the auditing for the organization(globally) in Settings > Auditing. Step 2: We then enable auditing for the required entities and fields. Step 3: Download the Actionable audit app from the AppSource. Step 4: After accepting the terms and condition is done, it will take some time to install the solution as shown in the notification below. Step 5: In the plug-in registration tool we can see the assembly MicrosoftLabs.ActionableAudit is present. Step 6: Out of the box some steps are already registered as seen below Note: Only if the field is enabled for auditing the logs will be stored in Actionable Audit entity. Step 7: If required, the out of the box plugin steps can also be unregistered. And we can also add custom entities to the list. The pre-image and post-images also must be registered for different message which is shown in the user guide in the AppSource. Step 8: After the logs are created they are stored in Actionable audit entity as shown in the below example. Hope this helped!

Share Story :

Data Migration for Many to Many Relationship Entities in D365 PSA

Introduction: This blog explains how to migrate data for Many to Many or N:N relationship records. Scenario: Client always demand configuration records to be migrated from Test Env to a Production Environment.We can migrate data for Entity records and Entities with 1:N relationships records however we cannot directly migrate data for N:N relationship( intermediate entity) which is not exposed in D365 PSA. This can be achieved by using XRM Tool Box plugin – Manage NN relationships. Prerequistive: · XRM Tool Box with “Manage NN relationships” plugin installed. · Both entities having alternate key with data – This is required as a cleaner approach. Below steps explains how to achieve requirement. Steps of Implementation: 1. Open “Manage NN relationships” plugin in XRM tool box with Source Organization as connected. 2. Click Load Metadata button and then select First Entity with Specific attribute as alternate Key and same for Second Entity as shown below. 3. Click button Export button and save file. 4. Open exported file Column A is OrgUnitID and Column B is PriceLevelID data. 5. Change connection to target organization of Manage NN relationship plugin in XRM toolbox and then follow the step 1 and 2. 6. Click Import button and select the file exported in step 3. 7. Data migrated is been tracked in log section of plugin. Conclusion: N:N relationship or Many to Many relationship entity records cannot be migrated from D365 PSA as they are not been exposed however this can be achieved by using third party tool like XRM Tool Box – “Manage NN relationship”.  

Share Story :

Chargeability View in D365 PSA

Overview: Often while working on PS, I was struggling to  get the Chargeability View right. The main reason is not having the right Price List setup at the right places. There are 4 important places where the Price Lists need to be setup properly. Product Catalog with Role Prices having Org Unit A Account having corresponding Sales Price List and the same Sales Price List under it’s Project Price Lists grid. Opportunity having Org Unit A as Contracting Unit and Product Price list having Sales Price List for Org Unit A selected. Quote derived from the Opportunity having the same Account, Opportunity, Contracting unit and Product Price List selected. Organization Unit: For each Organization Unit you add to PSA, make sure you’ve added a Cost Price list to the Organization Unit as well as a Sales Price list exists for the same. Make sure Organization Units on the Role Prices are selected correctly on both the Sales and Cost Price Lists Sales Price List on Account and Opportunity: Account and Opportunity too should have the same Sales Price list whose Cost Price list is associated with the Organization Unit of the Account’s and Opportunity’s Organization Unit. Make sure you’ve correct Organization Unit and Product Price List as a Sales Price List for that Org Unit selected on the Opportunity form. Chargeability View on Quote Lines: Once everything flows from Account to Opportunity to Quote and to Quote Lines, you can see that your Chargeability View pops-up properly. Hope this helps you derive correct Chargeability View without hassle.

Share Story :

Filtering duplicate records in SSIS

Posted On December 29, 2017 by Simran Monteiro Posted in Tagged in ,

Introduction: In this blog, I will demonstrate how to remove or filter duplicate records in SSIS using Sort Tranformation. Steps: First, configure you OLE DB as your Source using the OLE DB Source as shown below. Bring the Sort Transformation and configure it as shown below. Check the box at the bottom of the Window that says ‘Remove rows with duplicate sort values’. Now you can connect to your destination by dragging the required block and connecting the Sort Transformation to the Destination block. For blog purposes, I have connected it to the Multicast block. Your Data Flow should look like: Click on start to execute your Data Flow. Benefits: Removal of duplicate rows can be useful when trying to avoid Data Redundancy in your System as well as to reduce the memory required.  

Share Story :

How to split an ‘Address’ column into multiple columns in SSIS

Posted On December 29, 2017 by Simran Monteiro Posted in Tagged in , ,

Introduction: We can split an Address column into multiple columns for Flat Number, Building, Road, City etc. in order to make it easier to process the data. In order to do this, we can use the Derived Column Transformation in SSIS. Steps: In the screenshot below, you can see the Address column has an aggregated address for each employee. In your SSIS Package,  bring a Data Flow Task. Configure you Excel Source in Connection Manager and select the sheet you want the data from. Check in the Columns Tab to verify if the Columns are correct. Now drag the  Derived Column Transformation and connect the Excel Source to it. Double click the Derived Column Block and configure it as shown in the screenshot below. Flat: SUBSTRING([Col 2],1,FINDSTRING([Col 2],”,”,1) – 1) Building: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,1) + 1,((FINDSTRING([Col 2],”,”,2) – FINDSTRING([Col 2],”,”,1)) – 1)) Road: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,2) + 1,((FINDSTRING([Col 2],”,”,3) – FINDSTRING([Col 2],”,”,2)) – 1)) Area: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,3) + 1,((FINDSTRING([Col 2],”,”,4) – FINDSTRING([Col 2],”,”,3)) – 1)) City: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,4) + 1,((FINDSTRING([Col 2],”,”,5) – FINDSTRING([Col 2],”,”,4)) – 1)) PIN: SUBSTRING([Col 2],FINDSTRING([Col 2],”,”,5) + 1,((LEN([Col 2]) – FINDSTRING([Col 2],”,”,5)))) Once the configuration is done, connect Derived Column Transformation to you Target Block. Configure your Target Block to your Destination as shown below and check the Mappings to ensure the correct Source and Target columns are mapped. This is what your Data Flow should look like: Click on ‘Start’ when done. Once the execution is complete, check your Target Database for the desired output. Conclusion: This can be a requirement in many scenarios and by following the steps mentioned above, we can achieve the desired output.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange