Saturday 22 April 2023

D365 CE - JS check the client is offline or online

Greetings, Dynamics Techies! As the world of Dynamics evolves, we are faced with the challenge of developing JavaScript that can seamlessly transition between online and offline modes. With the introduction of the offline profile, this challenge has become more pressing than ever before. 

 To help navigate these waters, I am excited to announce a new series of blog posts where I will be sharing my learnings and insights on developing JavaScript for both online and offline modes in Dynamics. Whether you're a seasoned developer or just starting out, these posts will provide valuable tips and tricks for ensuring your JavaScript is compatible with both modes, allowing for a smoother, more efficient user experience. 



 So, join me as we explore the world of Dynamics JavaScript development and discover how we can make the most of this exciting technology. Together, we can tackle the challenges of offline and online modes and unlock the full potential of Dynamics.


var clientContext = Xrm.Utility.getGlobalContext().client;
if (clientContext.getClientState() === "Offline") {
    // User is offline
} else {
    // User is online
}

Happy Learning!

Reference:

https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/xrm-utility/getglobalcontext/client#syntax-1

Saturday 11 January 2020

D365 CE - Rename organization/Instance url and name in cloud - Powerplatform

After creating the organization/Instance in cloud, we may want to rename the organization URL to fix a typo or we have changed our mind.

Can we do it?  => yes, of-course 

Note: The organization unique name cannot be modified!


How to fix it?

Consider we need an dev organization for Contoso. By mistake we created as ContosDev instead of ContosoDev

  1. Go to https://admin.powerplatform.microsoft.com/environments
  2. Open the environment(by clicking Constosdev cell) and click "Edit" 
  3. Update the URL and name as needed




































Voila, now the url is updated!

Wednesday 6 November 2019

D365 CE - Duplicate detection approach and options



Hello All,

It feels great to be back with an interesting topic around duplicate detection and approaches.

Duplicate detection is essential to maintaining data integrity and quality in any system and when it comes D365 though there are multiple options to achieve this we are going to concentrate on the following four

1. Duplicate Detection Rules

Duplicate detection rules are out of the box way to manage duplicates. The same can be configured at the UI level.
  • Not enforced and users can override optionally
  • Works within current users access, so there is a chance that duplicates beyond current users access are not considered
  • Needs to be specified explicitly while creating records via OrgService/WebApi

2. Alternate keys
MSCRM alternate Keys are handy in performing duplicate detection and the alternate keys are primarily used for simplifying Integration and Migration activities. Beyond that, it implements a unique constraint for one column or combination of columns.

  • Robust and applies across the board. No need for impersonation
  • Covers UI, Import, OrgService and WebApi
  • Allows null values and duplicate detection is not applied here
  • It also can be used for upsert, retrieve, update and delete. 
  • Errors are system defined and cannot be customized
3. Plugin/Workflow
We can write our own logic to detect and avoid duplicates using plugin and workflows.
  • Allows custom error messages
  • Provides better control on duplicate detection logic
  • Covers UI, Import, OrgService and WebApi
  • Works within the current user's access, so there is a chance that duplicates beyond the current user's access is not considered. Needs impersonation.
4. JavaScript
Like plugin, we can achieve this using a simple JavaScript but the same has its own limitations
  • Covers only UI
  • Allows custom error messages
  • Provides better control on duplicate detection logic
  • Works within the current user's access, so there is a chance that duplicates beyond the current user's access is not considered. Needs impersonation.



Monday 15 April 2019

D365 CE Quick Hacks - Switch to UCI from Classic UI - ForceUCI

With D365 CE there are lot of cool stuff's happening, we are right in middle of all the rapid evolution of the industry and product.

Before reading below content around UCI/Classic app, its recomended to go through below blogs, 



Its always handy to have URL's in armory to navigate to specific areas/interfaces with ease. Lets have a look at them now

How to quickly navigate to default UCI app from Classic UI?

Append a forceuci Query string parameter after main.aspx
https://<your orgname>/main.aspx?forceuci=1 

Ex: https://contoso.crm.dynamics.com/main.aspx?forceuci=1

How to quickly switch the current Classic app to UCI?

Append a forceuci query string parameter after appid. Please make sure to remove session idenfier("#<somerandomnumber>") before appending foreuci tag.

https://<your orgname>/main.aspx?appid=<yourappid>&forceuci=1 

Ex: https://contoso.crm.dynamics.com/main.aspx?appid=ec876248-c755-e911-a832-000d3a127836&forceuci=1

Happy Learning!