Monday, October 12, 2020

Model Driven App - Script Error

 Recently during some development, I came across one strange error. One user was getting script error when trying to access connection entity form. 

On connection entity, I added some JavaScript code to filter connection from lookup to limit only for Users and Teams. 

JavaScript Code is working fine when I tried to debug issue. 

After doing some more debugging, I realized user is using different app and that app does not have access to Team entity. 

 Once added Team entity into App, error Fixed, and script worked as designed. 

When designing Model Driven App for consider 

 1. When using JavaScript code to filter lookups to specific entity, specially customer lookup, connection entity from / to lookups, make sure entities used in filter are added in App. 

2. When using JavaScript code to redirect to specific form based on value change / option set change, make sure all forms added in App. 

3.  If entity is using Quick create form, then make sure quick create forms added in App otherwise default main form will be used to create record

 

 


Monday, February 13, 2017

Error : Too many entities enabled for auto created access teams.



Error Log: 

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Too many entities enabled for auto created access teams.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147187918</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Too many entities enabled for auto created access teams.</Message>
  <Timestamp>2017-02-13T21:33:05.6114604Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>


Solution: 
In MS CRM by default you can enable for auto create access teams to Maximum 5 entities. Once this limit reaches you will see above error message.
This limit is specified in MaxEntitiesEnabledForAutoCreatedAccessTeams deployment setting.
You need to update this deployment setting if you have more than 5 entities.

To update you can use Powershell

Add-PSSnapin Microsoft.Crm.PowerShell
$Cred = Get-Credential
$CrmOrgs=Get-CrmOrganizations -serverUrl https://< CRM_Server_Host >
 -Credential $Cred
Get-CrmSetting -SettingType TeamSettings
$set =Get-CrmSetting -SettingType TeamSettings
$set.MaxEntitiesEnabledForAutoCreatedAccessTeams = “6”
Set-CrmSetting -Setting $set
 
Useful links for PowerShell:
https://technet.microsoft.com/en-us/library/dn905215.aspx#BKMK_changemon
https://technet.microsoft.com/en-us/library/dn531194.aspx
https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.deployment.teamsettings.maxentitiesenabledforautocreatedaccessteams(v=crm.7).aspx 

To Update using SQL
Login to SQL server
Run following query on MSCRM_CONFIG database
select * from DeploymentProperties where ColumnName ='MaxEntitiesEnabledForAutoCreatedAccessTeams'

To Update MaxEntitiesEnabledForAutoCreatedAccessTeams  setting run
update DeploymentProperties set IntColumn = 6 where ColumnName ='MaxEntitiesEnabledForAutoCreatedAccessTeams'

Verify your setting is changed or not using select query.
Now you can able to enable 6th entity for auto create access team. 

Tuesday, February 7, 2017

Add custom portal into online CRM

To add custom portal into online CRM

1.  Go to Admin portal, either from dynamics CRM or directly into Admin portal.


2. Then go to Admin Centers and click on Dynamics 365, as shown below

3. Dynamics 365 Administration Center will be opened in new window. 


4. Click on Applications tab in Administration Center.

5. Select Portal Add-On and click on Manage, new window will be opened to configure portal

6.  Configure your portal, by entering name, portal type (Production / Trail), portal URL. 

7. Then select Dynamics 365 instance

8. Once Dynamic 365 instance selected, you need to select portal language, portal administrator  

When selecting portal administrator 
  •  Portal Administrator must be CRM user with System Administrator role.
  • User added as contact in CRM with Web role "Administrator" 
  • Login to the portal using "Sign in with an external account" option with user CRM credentials. 
9. Then select portal Audience and how portal deployed. 


Portal audience once set for portal cannot be changed later from UI. Portal choices are tailored based on the selection of the audience.

For Partner / Employee audiences, user license required for internal users (customer employees, contactors, agents) dependent on entities exposed.

Depending on audience, we will get different options for portal to be deployed. 

10. Submit your request.

11. After submit and accept page, provisioning begins. You will see following screen


12. Once you accept, portal creation request will be submitted.

 It will take around 30 minutes to complete. After provisioning package installation begins.


13.  Once package installation completed you will see portal details, and you are ready to configure your portal. 



 14. In your CRM instance you will see one area for portal, you can manage your custom portal from there.