Category Archives: Dynamics 365
Generic Type Bookable Resource on Schedule Board in D365 Field Service
Introduction: This blog explains how to filter Generic Type Bookable Resource on Schedule Board. Pre-requisite: Latest Field Service Solution of D365. Procedure: 1. Open Schedule Board, Field Service → Schedule Board. As highlighted below there is no option to select Generic Type Bookable Resource in Filter Section. 2. Click Options → Selected Resources 3. Select Generic in Resource Types drop down as shown below. 4. Select Bookable Resources as per need. 5. Bookable Resource are shown in Schedule Board of type Generic. Conclusion: This blog explains how to filter Generic Type Bookable Resource on Schedule Board.
Share Story :
CRM Tip: How to Check Security Role in Plugins – Correct way
Problem Statement: We often have requirements to perform some action based on certain security role. For ex., we only want System Administrator to delete particular record, and no one else should delete irrespective of their security access. There are many ways to achieve this, but many of the times the solution is not foolproof Incorrect/ Misguided Solution: Generally developers achieve the above requirement by using plugin with below steps: Get User ID from the plugin context. Get all the roles of the user Loop and check if any of the role name is “System Administrator”. If Step 3 is true, then allow delete, else restrict delete This solution works most of the time, but this won’t work if the client is using any other language than English in CRM. Since role names are customized based on language, the above plugin won’t find any user with the System Administrator name of the role. Solution: For language proof solution, we must use the role template lookup on the Role entity. For OOB security roles, there is a role template GUID which does not change based on environment. For System Administrator, the Role Template ID is “627090FF-40A3-4053-8790-584EDC5BE201” The following code will get the System Administrator properly. You can find the sample plugin on my GitHub as well. public bool HasAdminRole(Guid systemUserId) { Guid AdminRoleTemplateId = new Guid(“627090FF-40A3-4053-8790-584EDC5BE201”); QueryExpression query = new QueryExpression(“role”); query.Criteria.AddCondition(“roletemplateid”, ConditionOperator.Equal, AdminRoleTemplateId); LinkEntity link = query.AddLink(“systemuserroles”, “roleid”, “roleid”); link.LinkCriteria.AddCondition(“systemuserid”, ConditionOperator.Equal, systemUserId); return service.RetrieveMultiple(query).Entities.Count > 0; } Note: This can be done for other OOB roles as well like Sales Manager, Sales Person, etc. For custom roles, the role template Id is empty. If the custom roles are created by you, then you can used the Role Id (Unique GUID of Role entity) for querying instead of names.
Share Story :
Invoking Web Service/Rest API from D365 FOE
In this blog article, we will see how we can invoke web service call for a third-party application in Dynamics 365 for Finance and Operations, Enterprise Edition using X++. In this blog we will Consider Service Order Entity as source passing Service Order values to a third party application on Service Order creation using web service endpoint url. Create a SMAServiceOrderTable Table post Insert event. /// <summary> /// Post insert passing Service Order values and URL to invoke Web service /// </summary> /// <param name=”sender”></param> /// <param name=”e”></param> [DataEventHandler(tableStr(SMAServiceOrderTable), DataEventType::Inserted)] public static void SMAServiceOrderTable_onInserted(Common sender, DataEventArgs e) { SMAServiceOrderTable serviceOrderTable; serviceOrdertable = sender as SMAServiceOrderTable; String15 SOstatus = enum2Str(serviceOrderTable.Progress); //parmvalue stores Service Order values in container container parmvalue = [“‘CustAccount’:'”+serviceOrderTable.CustAccount+”‘”,”‘ServiceOrderId’:'”+serviceOrderTable.ServiceOrderId+”‘”,”‘CurrencyCode’:’US Dollar'”,”‘SOStatus’:'”+SOstatus+”‘”,”‘ProjId’:'”+serviceOrderTable.ProjId+”‘”,”‘CFSCRMWorkOrderNo’:'”+serviceOrderTable.CFSCRMWorkOrderNo+”‘”]; new WebService().sendrecord(“<<webservice url>>”,parmvalue); } Create a class which calls the web service. Class WebService { public void sendrecord(String255 endpointurl,container arryI) { str url; str postData; str returnValue; System.Net.HttpWebRequest request; System.Net.HttpWebResponse response; System.Byte[] byteArray; System.IO.Stream dataStream; System.IO.StreamReader streamReader; System.Net.ServicePoint servicePoint; System.Net.ServicePointManager servicePointManager; CLRObject clrObj; System.Text.Encoding utf8; Counter countCounter; ; //generate postdata in json format postData = “{“; for(countCounter= 1;countCounter<= conlen(arryI);countCounter++) { postData = postData+conpeek(arryI,countCounter)+”,”; info(strFmt(“%1″,postData)); } postData = postData+”}”; new InteropPermission(InteropKind::ClrInterop).assert(); url = endpointurl; clrObj = System.Net.WebRequest::Create(url); System.Net.ServicePointManager::set_Expect100Continue(false); request = clrObj; request.set_Method(“POST”); utf8 = System.Text.Encoding::get_UTF8(); byteArray = utf8.GetBytes(postData); request.set_ContentType(“application/json”); request.set_ContentLength(byteArray.get_Length()); dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.get_Length()); dataStream.Close(); } } Let me know your reviews. I will soon come up with more articles, as I further explore D365 Operations.
Share Story :
Field Security Profile Error
Introduction: One of regular CRM user suddenly start getting error “The use does not have read permission to a secure field. The requested operation could not be completed”. As it clearly visible that the error is coming due to the security issue. But after checking the permission we did not find any issue in the security role. Since it was working earlier it was not known why it is not working now. But someone has imported a modified solution in production instance. Then, we checked and found that a new field security profiles were created, since this particular user was not the member of list, so he was not able to read the record. You need to make sure that you have added user/users into this list whom you want to read/create/update a particular field. Once you have added the user you will able to read/update/create the value of a particular field. Hope this helps you to resolve the security profile issue.
Share Story :
Connection Entities in Dynamics 365
Overview: Connection entities provision an easy way to connect and describe relationships between two records in D365 CRM. This is supported across most Entity types in Dynamics 365. Some of the features of Connection entities are as follows: All Business and Custom entities can be enabled for Connections. Provision to add descriptive information between the relationship between the 2 records. Enabling Connections for an Entity: In my example below, I’ll enable Connections for 2 custom entities – I have a custom entity called Family Members and have these records details of Family Members like their blood groups and medical history. This entity is a child entity of another customer entity called Patient. Connections must be enabled for this custom entity at the entity level as shown below: Connections need to be enabled on both entities between which connection is to be made. Once Connections have been enabled, navigate to the record and navigate to the related records, you’ll see Connections is now available. Connection Roles: Connection Roles are the description that defines in what way is record A related to record B. Connection Roles can be added to a Solution or even created as below: In a solution, look for Connection Roles on the left hand menu Then, create a Connection (Existing ones in an Unmanaged Solution can be added as well) I am creating a new Connection Role by the name Father and I’ve enabled the same only for Patient entity. and Family Member After saving the record, I’ll create a Matching Connection Role to the role Father I just created. Now, I’ll create a matching Role called as Son Now, the two roles have been created which match each other Associating Records: Once my Connections have been enabled on source (connection from entity) and target (connection to entity), I’ll associate the two records as follows: I will navigate to the Family Member entity I created above and will associate a record with a record to Patient entity. This way, I can derive what is the relation between the family member and the patient. In the Connection Associated View above, I’ll associate the Family Member Gary to the Patient. So I’ll select To Another in the connection menu as shown in #1 above. Then, find the Patient Alexander James which I created in the Connect To tab as shown below. And then I relate the current record to the target record as the Father. Note: As soon as Father was selected in the Connected To tab, the Details tab auto-filled Son as it was the only role associated with the Father when we created Connection Roles in above section in this blog. In case there are multiple Connection Roles associated with one Role, the Details section’s As This Role field will be empty for you to select the related role from. And the record is saved as below. Likewise, a record can be connected to multiple other records as well. Retrieving Connections: Connections are useful if you want to draw reports, graphs or charts.
Share Story :
Set up gift cards
Introduction: This blog explains you setup of gift card in Dynamics 365 retail, which can be issue and redeem in store. In POS gift card can be use as payment tender. Just like loyalty Card Casher can check the balance, he can add balance (Money) to the gift card and issue the gift card from POS. Before you setup gift card in Dynamics 365 retail, you should Set up a retail service product to represent gift cards. If cards have bar codes, make sure that the correct bar codes are associated with the gift card product. Let’s begin. Step 1: Open the Dynamics 365. Go to the Retail and Commerce > Headquarter setup > Parameter > retail parameter Click on Posting. Step 2: In the Gift card product field, select the gift card product. This this case “9999” is gift card product No. you can select your gift card no. Gift Card Company: the legal entity that holds the liability for gift cards. In the Journal field, enter the name of the journal to use when intercompany journal entries are created. Journal entries are creating during the statement posting process. In the Serial number templates fields, enter the start date, end date, and gift card numbering template to use when generating electronic gift cards. If the gift card template doesn’t expire, leave the End date field blank. Conclusion: By following above steps you can setup gift card in Dynamics 365 retail.
Share Story :
Dynamics CRM behaviour on deletion of User
Introduction: Have you ever wondered what happens to the user owned records in CRM when the user itself is deleted from CRM? Will the records get deleted? Or Will it be assigned to some other user? What will happen to the existing system jobs? Let us see in the below example. Description: Suppose there is a user named “Somesh Siripuram” and this user has its own account records. The owner of this records is “Somesh Siripuram”. Now the user is being deleted from the admin portal and no longer has access to Office 365 and CRM. Login with system administrator and check for the deleted user. The user will be listed in “Disabled User” view. When you open the user the email address and the user name of the user will be changed and some number appears Now, it’s time to check the deleted user owned records Thus, we can see that records neither gets deleted nor the owner of the records get changed. Manual assigning of records to another user is required. Other effects: Waiting jobs will remain as waiting until it is cancelled. New system jobs (where workflow owner equals to disabled user) will fail. You need to change the owner manually, they are not auto assigned to system
Share Story :
Physical Negative Inventory Dynamics 365 for Operations
Physical negative inventory functionality is mainly used for issuing the stock for insufficient inventory. If Physical inventory checkbox is selected then system will allow to issue an item though stock is not available into inventory. Path: Inventory Management > Setup > Inventory > Item Model Group Below is example how to issues stock if there is insufficient inventory. You can see the below item for which On Hand inventory is not available though I want sale these stock. Create the sales order and enter item, quantity, Unit cost and confirm the sales order. Post the Packing slip to sell or issue the stock. Check the On hand inventory after posting Packing slip. You can check On Hand Quantity is showing negative. Conclusion: These functionality helps to issue stock through sales order, Production order, adjustment journal though stock is not available or insufficient.
Share Story :
Sharing Schedule Board in D365 Field Service
Introduction: This blog explains options available for sharing of Schedule Board in D365 Field Services Pre-requisite: Latest Field Service Solution of D365. Procedure: Open Schedule Board, Field Service -> Schedule Board. Open a specific Tab Setting on Schedule Board for e.g. Facility as highlighted below. Click on field “Shared With” dropdown. Schedule Board can be shared with below 3 options Everyone – Schedule Board is shared with all Users. Just Me – Schedule Board is shared with Login User Only. Specific People – Schedule Board is shared with Specific People. Steps to Share Schedule Board with Specific People: Select “Specific People” option in Shared With field of Tab Setting on Schedule Board. Open “Schedule Board Settings” entity records from Advanced Find. Open Schedule Board of Specific People record from the results. Click on “Share” button in ribbon. Add new User by Clicking on “Add User/Team” option and provide privileges as per need. Conclusion: This blog explains the options to share Schedule Board and, also how a Schedule Board can be shared with specific Users only.
Share Story :
Customized Button in Dynamics 365 POS
Introduction: In Dynamics 365 Operation retail POS, we have different button on POS of different function. Some time we have a requirement from client he want some specific button on POS. In This blog I am going to show you how to add button on POS Screen. Follow the below steps. Step 1: Open the Dynamics 365 Operation. Step 2: Go to the Retail And Commerce > POS > Screen Layout Step 3: Once you click on it, list of screen layout will open. As per you Store Profile select layout. In this case my layout of A2CP16:9C Step 4: We all Know that In dynamics 365 POS, there is different button grids, As per requirement we will add demo button in Shift and Drawer button. So select the button grids and click on designer button Step 5: Once I click on it. My button designer will Open. Step 6: Right click on the last button and click on Add row. In Row will be added. Right click on button and select Button property. And set the Property Step 7: Click on OK Button and close the designer. Go the Channel Database and Run the Job No. :- 1070. Conclusion: With the help of above steps, you can add, remove or create Customized button designer view for the MPOS and CPOS