Advertisements

Archive

Author Archive

D365 July Updates – Multi select option set and Virtual entity

September 10, 2017 Leave a comment

With July updates Dynamics 365 introduced few new features. I am going to touch base:

Virtual Entity:

  • Virtual entities replace previous client-side and server-side approaches to integrating external data, which required customized code and suffered from numerous limitations, including imperfect integration, data duplication, or extensive commitment of development resources.
  • Virtual entities are stored in CRM with an internal metadata flag on the entity marked as virtual, which tells the system not to put a schema in the database. Virtual entities are organization owned, there isn’t any CRM role level security for virtual entities. Each virtual entity points to a row from the data source
  • Refer this Article

Multi-select option set:

  • This is long awaiting feature. Limitation of existing Option set was we could select only one option. With the advent of new control we can select multiple options.
  • Select options stored in a field separated by ;
  • Features of the new Multi-Select option set include:
    • A new AttributeType: MultiSelect Option Set introduced.
    • We can add control to forms, views, and quick create forms, and read-only and editable grids
    • Can add up to 150 values available for selection
    • ‘Select All’ and ‘Clear selection’ feature
    • Supported in Advanced Find and FetchXML queries
  • Refer for more details.

🙂

 

Advertisements

Azure Deployment Slots – Deploy and Swap

September 10, 2017 Leave a comment

Assume that you have your live application deployed on Azure running and you must deploy a hot fix.

The option you got is, you might want to take your application down for some time till your hot fix deployed.

How about you deploy the hot fix with no downtime, the answer is Azure “Deployment Slots”.

Create a Deployment Slot:

To use ‘Deployment Slots’, make sure you are running with Standard or Premium Azure Service Plan before adding a slot

  • Connect to Azure subscription and open your existing ‘App Service’
  • Under ‘DEPLOYMENT’ section, select ‘Deployment Slots’ and click on “Add Slot”

Azure - Deployment Slot

  • In the next screen, provide Slot name and choose ‘Configuration Source’. I gave my Slot name ‘Staging’ and in the ‘Configuration Source’:
    • If you choose your existing ‘App service’ all the settings including ‘Application Settings/Diagnostic Settings/…’ will be copied to this slot
    • Or you can choose ‘Don’t clone configuration….’ Option, if you want your slot to be clean and no carry over settings.

Deployment Slot - Add

  • Click ‘Ok’
  • After few seconds, you would get notification that your slot is ready
  • Once slot setup completed, your main App name will come as prefix of your slot (Ex: If ABC is my web app; my Slot name is ABC-staging)

Deployment Slot - Created

Publish Website to Slot:

  • Use Visual studio “Publish Web” option

Deploy - Connect Azure App Service

  • Select “Microsoft Azure App Service” and choose your main “App Service” and “Deployment Slots -> {Slot}”

Deploy - Slot

  • Click “Publish”
  • After publishing, your slot would work as any other Web App. You can give the slot URL to test to run BVT

Deployment Slot - Open Staging

Swap Slot:

  • Once you feel your slot is fine and can be promoted as main App
  • Click on ‘Swap’

Swap - 1

  • Select ‘Source’ and ‘Destination’
    • Main Web App would always represent as “production”
    • “Staging’ is the name of your slot

Swap - 2.PNG

  • Click Ok
  • It would take couple of minutes to complete Swap
  • Once Swap completes, end users who are accessing would start getting new build with virtually no down time.

Useful points:

  • If any errors are identified in production after a slot swap, roll the slots back to their pre-swap states by swapping the same two slots immediately
  • You can check your available ‘Deployment Slots’ by opening your Service Plans.

Check you available Slots.PNG

 

 

 

🙂

Azure Web Deploy – Time out errors

September 10, 2017 Leave a comment

Recently when we were trying to publish a web site to Azure ‘Deployment Slot’ using Visual Studio “Web Deploy” option, we encountered either Time out exception or VS hung after few files push.

Azure - Web Deploy - Visual Studio

Reason for this exception could be due to the enormous transactions on main (Prod) web app of the ‘Deployment Slot’.

Work around:

  • We found a work around by using Drag and Drop feature of Kudu service deploying to wwwroot folder directly.

Steps:

  • Publish the web site to your machines local drive

Publish Website - Local drive

  • ZIP the files (***You must select all the files and Zip it; Don’t zip the folder)

Publish Website - Zip folder

  • Open the Deployment Slot’s Kudu Service (Go to ‘Advanced Tools’ -> Go)

Web App - Advanced Tools

  • On the Kudu page, navigate to Home -> site -> wwwroot
  • Drag and drop the zipped folder of your published web site.

Kudu wwwroot - Drag and Drop

  • Wait for the process to complete publish.

🙂

Categories: ADX Tags: , , ,

Dynamics 365 Portal – Troubleshoot errors hosted in Azure

September 3, 2017 Leave a comment

Recently we got internal server error while we were accessing Portal hosted in Azure.

Microsoft Azure is providing simple and quick way to troubleshoot the errors.

There are few options to troubleshoot like ‘Log Stream’ and ‘Diagnostic Dumps’. In this Article, I am going to show how to use them.

Pre-requisite:

  • Connect to your Azure account and open the Web App from ‘App Services’
  • Make sure you enable “Application Logging” from ‘Diagnostics logs’ section

Azure - Diagnostics logs

Log Stream:

  • ‘Log Stream’ is helpful to track the ongoing exceptions and track the live Request and Response.

Azure - Log Stream

Diagnostic Dump:

  • Connect to KUDU services by clicking on ‘Advanced Tools –> Go’

Azure - Connect to KUDU Service

  • Click on Tools –> Diagnostic Dump

Azure KUDU - Diagnostic Dump

  • Download and extract the .zip folder
  • Go to ‘LogFiles’

Diagnostic Dump - Eventlog

  • Open the ‘eventlog.xml’ using any file editor

Diagnostic Dump - Open Eventlog

‘Application Insights’ is another option which helps you detect and diagnose quality issues in your web apps and web services.

🙂

ADX Portals Web Notification system job failures and fix

Other day ADX web notification system jobs were failing/in Progress from long with below error message

ADX Web Notifctaion Failures

To give little background on Web Notifications:

  • Adxstudio Portal application caches results from CRM to improve performance.
  • This is done by adding a Web Notification URL in CRM (Advanced Find –> Web Notification URLS)

Web Notifctaion URL's

  • For each event that is processed in the CRM event execution pipeline, such as a create, update, or delete, a new system job for the appropriately registered Web Notification plugin step is created and run that sends an HTTP POST web request to each Web Notification URL to inform the portal cache should be refreshed

Reason and Fix:

  • Issue was with wrong web notification URL.
  • We modified our portal URL hosted in Azure and did not update the same in “Web Notification” URL.
  • Issue has been fixed by correcting the URL and disable and then enable the web notifications again
    • To Enable\Disable Notifications, open OOB ADX “Web Notification’ solution (Settings -> Solutions)

Enable_Disable Web Notifications

Note:

  • If web notifications have been enabled and a change is made to the Portal URL and/or Web Notification URLs, the web notifications need to be disabled and then enabled again to have the changes to the URLs properly registered.
  • If multiple Portal Web App’s hosted for a CRM organization, you can have multiple “Web Notification URL” entries.

Refer article for more info on Web Notifications.

🙂

Categories: ADX Tags: ,

Retrieve Members of a Records Access Team and migrate Access Teams between Organizations

Most of you know that an Access team owns no records and has no security roles assigned to it.

Records will be shared with an Access team, and the team is granted access rights on records such as Read, Write and Append.

OOB Opportunity Access Team

By default, we would get one OOB Opportunity Access Team and we can enable “Access Team” for required entities by selecting “Access Teams” option in entity customization’s.

Enable Access Team

We can add “Access Team” to the form’s sub grid and keep adding the users

Add Access Team Sub Grid.PNG

Below is the sample code to retrieve the members of Access Team for a record (i.e., Opportunity in this case)

Code Snippet:

Private void GetUsersFromOpportunitySalesTeam(IOrganizationService service, Guid opportunityId, Guid teamTemplateId)        {

var fetchUsersFromSalesTeam = @”<fetch>

<entity name=’opportunity’ > <attribute name=’name’ />

<filter type=’and’>

<condition attribute=’opportunityid’ operator=’eq’ value='” + opportunityId + @”‘ />       </filter>

<link-entity name=’principalobjectaccess’ from=’objectid’ to=’opportunityid’ link-type=’inner’ alias=’poa’ >

<attribute name=’objectid’ alias=’objectid’ />

<link-entity name=’team’ from=’teamid’ to=’principalid’ link-type=’inner’ >

<link-entity name=’teamtemplate’ from=’teamtemplateid’ to=’teamtemplateid’ >

<filter type=’and’>

<condition attribute=’teamtemplateid’ operator=’eq’ value='” + teamTemplateId + @”‘/> </filter>

</link-entity>

<link-entity name=’teammembership’ from=’teamid’ to=’teamid’ link-type=’inner’ intersect=’true’ >

<link-entity name=’systemuser’ from=’systemuserid’ to=’systemuserid’ link-type=’inner’ >

<attribute name=’fullname’ /> <attribute name=’systemuserid’ />

</link-entity>   </link-entity> </link-entity>  </link-entity>   </entity>

</fetch>”;

var teamMembers = service.RetrieveMultiple(new FetchExpression(fetchUsersFromSalesTeam));

// Retrieve User Guids

if (teamMembers!= null && teamMembers.Entities.Count > 0) {

foreach (var teamMember in teamMembers.Entities){

if (teamMember.Attributes.Contains(“systemuser5.systemuserid”) && teamMember.Attributes[“systemuser5.systemuserid”] != null) {

Guid userId = new Guid(((AliasedValue) teamMember.Attributes[“systemuser5.systemuserid”]).Value.ToString());

}

}

}

How to get the “Access Team Id” (i.e.,teamTemplateId)

  • Make a retrieve call “teamtemplate” entity and retrieve the Id by Name field (i.e., Opportunity Sales Team Template)
  • Or you can get the GUID from URL of “Access Team Template”

Points to ponder:

  • “Access Team” is not a solution components and cannot be added to the Solution to move across the organizations.
  • If you have an Opportunity Access Team sub grid on Account form and if you move the customization’s from Dev to Test organizations, the sub grids will break, if you cannot maintain the “Access Team” with same Id
  • To move Access Teams between Organizations with same Guid’s, below are couple of ways
    • A console application (Link)
    • XRMToolbox Plug-in (Link)

🙂

ADX Portal – Configure views to fetch Logged In Partner owned records

As we know, ADX portal would be accessed by external Partners and they get created as Contacts in the CRM. 

We got a requirement to configure “My Opportunities” view in Portal to show the Opportunities owned by logged in Partner. 

In CRM, this type of requirement is straight forward as the filter will be “Opportunity.owner=Logged in User”

How to configure similar view in Portal, as the Partner will be ‘Contact’? 

When you Install/Enable Portal solution in CRM,

  • It creates below Contact records. 

  • Also it adds a new field “Partner Owner’ (i.e., msa_partneroppid) in all OOB entities.

To configure ‘My Opportunities’ view in ADX: 

  • Choose ‘Portal Customer’ as filter criteria. This would be replaced with logged in partner.

  • Create the view and configure as ‘Entity List’ and publish to ADX.

🙂

Categories: ADX Tags: , ,