Views:

Applies to Product - Microsoft Dataverse


What’s happening?
The previously created session does not close automatically and requires manual intervention. When a new call is initiated, a new session is created, but the previous session remains open.


Reason:

  • There is no explicit programmatic call to close sessions when tabs are marked as "done."
  • Potential restrictions or limitations in the Integration Framework (CIF) or Omnichannel APIs for session closure.
  • Certain Dynamics 365 or Omnichannel configurations may not include session auto-closure functionality.
  • Integration challenges between the application and Dynamics 365, particularly related to accessing Dynamics libraries from the application.
Resolution:
  • It has been suggested to use the following API methods to close the session:
    • getFocusedSession method to retrieve the focused session.
    • close method to programmatically close the session.
    • Example code to close the session: javascript const session = Microsoft.Apm.getFocusedSession(); if (session.canClose) { session.close(); } Xrm.Utility.getGlobalContext().saveSettingValue("msdyn_SuppressSessionCloseWarning", true);
  • If the API methods are working fine when called from the console but not from the application code, it may indicate that the necessary libraries are not present in the application environment. It is recommended to ensure that the Integration Framework (CIF) SDK is correctly integrated into the application.