Update Personal Options / Personalization Settings using UpdateUserSettingsSystemUser Request – Dynamics 365


Recently we had a requirement to update the “Negative Currency Format” – Regional Options for all the users.

We could not find this option in our favorite plugin – User Settings Utility.

So to programmatically update it we use the below code.

Or using our most favorite plugin – SQL 4 CDS

Updating it to the required format – 5

The Result –

Get more details here-

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/usersettings?view=dynamics-ce-odata-9

Hope it helps..

C# Code –

  CrmServiceClient svc = new CrmServiceClient(ConnectionString);
            
            if (svc.IsReady)
            {
                var reqUpdateUserSettings = new UpdateUserSettingsSystemUserRequest();

                // GUID of the System User
                reqUpdateUserSettings.UserId = new Guid("18392d47-9dc0-eb11-8235-00224808ff23");

                // reference the usersettings Entity
                reqUpdateUserSettings.Settings = new Entity("usersettings");

                // update the negativecurrencyformatcode to appropriate integer value
                reqUpdateUserSettings.Settings.Attributes["negativecurrencyformatcode"] = 5;

                var response = (UpdateUserSettingsSystemUserResponse)
                    svc.Execute(reqUpdateUserSettings);
            }

SQL –

update usersettings 
set negativecurrencyformatcode = 5
where systemuserid = '18392d47-9dc0-eb11-8235-00224808ff23'
Advertisements

Fixed – We are having trouble loading your form preview. Check to make sure you have access error in Power Apps


While trying to open a form for customization for a custom entity we were getting below error within the maker portal.

The user was an admin user.

The same was the case in both Chrome and Edge browsers.

The only way we could proceed was by switching to classic experience.

Switching to Classic worked

After updating the form in classic and publishing the changes, the form started working properly in the maker portal also.

We were able to customize the form in both Chrome and Edge.

Hope it helps..

Advanced lookup in Model-driven Power Apps / Dynamics 365


To enabled Advanced Lookup, log into to Power Platform Admin Center, navigate to

Environment >> [Select Environment] >> Settings >> Behavior

Enable the Lookup behavior and Save.

This adds the Advanced Lookup option in the Lookup dialog.


Clicking on it opens the Advanced Lookup Grid 


We can perform SEARCH within a selected View, CHANGE a view, can FILTER it the results further to show only records owned, ADD a new record, SORT the grid.


The best part is we can open/edit an existing record as well as add new ones without losing the existing context.

Opening an existing record from the result opens the record in the new pop-up window as shown below.

Similarly, the Add new option opens the Quick Create form.

In case of special data type like Party List or Regarding, we can select multiple records of different entities we are presented with.

Similar the option to Add new records list all the tables/entities applicable to that lookup.

Thus the new advanced lookup makes working with Lookup much simpler and effective and we should start adapting / using it.

 

Blog posts on 2021 Release Wave 1 – Dynamics 365

Hope it helps..

 

Advertisements

Solved – window onload undefined error in Dynamics 365


Recently we got the below issue raised by the user on form load of one of the entities.


Most of the times this issue will arise because of the control / attribute being referenced in the JavaScript, being not available on the form.

And same was the case here, one of the JavaScript’s associated with the ribbon button, was referring to business process field (header_process_xxxxx) which was not available on the form.

Hope it helps..

Scan business cards in Dynamics 365 for Sales – 2019 Release Wave 2 (Unified Interface)


The scan business card feature added as part of release wave 2, allows salespeople to quickly scan business cards using the Quick Create Form. The scanner reads the information from the card and populates the corresponding mapped fields in the record.

Out of the box, it is available in quick create form of lead and contact entity.

To specify the mapping for the business card control fields, navigate to Settings – Customizations and open the Quick Create form and select the Business Card Control and go to the Controls tab for its properties.

Click on the edit icon for the field and specify the mapping.

To enable for entities other than lead and contact, open the quick create form of that entity for customization and select either single or multiple lines of text field as a placeholder and add the business card control to it.

Followed by appropriate mapping of properties to the fields of that entity.

To see it in action let us create a new lead record using it’s quick create form. On click on the Scan Business Card button and selecting an image we get the values populated on the form.

Make sure to enable the free trial of AI Builder.

We can see the business card attached/saved with the record.

This behaviour can be configured.

Navigate to Sales Tab of System Settings

Few points to consider here

  • This feature is only available in North America and the EMEA region for now.
  • The mapping of address fields is not supported currently.
  • The users need to have a Common Data Service User role to use the control.

Hope it helps..

Synchronize (Bi-Directional) Dynamics 365 CRM Cloud data with SQL Azure using Skyvia’s Synchronization Package


Continuing our previous post where we used the replication package

https://nishantrana.me/2019/11/13/easily-set-up-dynamics-365-ce-crm-replication-incremental-to-azure-sql-sql-on-premise-using-skyvias-data-integration-services/

here we will see how we can use the synchronization service for bi-directional sync.

Below of the prerequisites of synchronization package to perform bi-directional sync –

  • We need to use the created on and modified on fields of the Entity
  • The synchronized tables to have an auto-generated primary key.

So here we need to alter the SQL Azure’s Contact table that was auto-created earlier by the Replication package to have the auto-generated primary key.

Connect to the SQL Azure database using Skyvia’s Query service and perform the alter operation

Or use the Query Editor (preview) of Azure

With necessary changes made, let us create a new Synchronization package

Specify the connection and click on Add Task to create the synchronization task.

We have specified contact entity from Dynamics CRM Source and contact table in SQL Azure which was earlier created for us by the replication package.

It automatically maps all the columns here based on the column name.

We can also manually specify mapping here for both Source To Target and Target to Source fields to be used for sync.

Click on Finish once done with the mapping.

Similarly to replication packages, the synchronization packages can be scheduled.

Click on Save to create the Task.

Click on Run

The run history shows the 220 records synced from Dynamics CRM to SQL Azure.

We can see the 220 records created in our SQL Azure DB

Now let us update a record in SQL Azure and run the package again.

We can see the record updated in Dynamics CRM

Now let us delete a few records from Azure SQL and run the package

We can see the records delete from Dynamics CRM

Similarly, let us delete a couple of records from Dynamics CRM and run the package

We can see the 8 records deleted in the destination SQL Azure

Thus, we saw how easy it is to do bi-directional sync using Skyvia’s Synchronization package.

Hope it helps..