CRM 2016/2015 form onLoad script error

After upgrade when you load new form you get the below onLoad script error,

 

unable to get value of the property “setVisible” : object is null or undefined

 

Solution:

Finding the solution is the issue here. Once you know the fix it is pretty easy. In the information section will provide more details about how I found the solution.

To fix this issue you have to go to,

Settings > Administration > System Settings > General (First tab) > Use legacy form rendering – set this feature to “No” and click “Ok”.

 

Now when you go back to the form you will not see the onLoad script error.

Information:

CRM form for which I was getting this error was for Quick Campaign. This form has a system OOB onLoad script to dynamically change the form fields based on entity the campaign is related to. Now each time when the form loads it will look for the related entity and get attribute field value using CRM method call. The problem is these method call for new turbo form won’t work for a form rendered in legacy engine. So the onLoad script won’t be able to set the parameter and the value will be null.

 

To find the issue I had to use browser developer tool and code step in and do a reverse engineer the whole script since we do not have all access to CRM source code. Finally I found the onLoad script for quick campaign and understood the code path to finally understand how turbo forms are initializing the attribute control variable.

CRM 2016 ORG CREATE/IMPORT ERROR OUT

During ORG import or create we get below error,

Solution:

Clean or make sure GAC has only required CRM assembly DLLs. Also make sure the below file location does not have any old CRM version DLLs.

Location: C:\Windows\Microsoft.NET\assembly

 

Information:

The error is caused due to an old version DLL of CRM is trying to update DB with old schema and which is causing NULL reference.

 

CRM platform trace error:

System.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.ImportDefaultDataAction —> Microsoft.Crm.CrmException: Error while importing workflow {8b12a2c7-088c-49aa-93b3-b618e2b26ea4} name Opportunity Revenue Rule —> Microsoft.Crm.CrmException: Error generating UiData for workflow:, id:00000000-0000-0000-0000-000000000000 —> System.NullReferenceException: Object reference not set to an instance of an object.

CRM IFD Auth issue – ADFS URL looping

While accessing CRM we see that ADFS URL keep looping by itself few times and fails to login. This happens only when we use external IFD URL and not for internal URL.

Error on fiddler:

———————————————————————————————————-

ADFS doesn’t have P3P policy, please contact your site’s admin for more details.

———————————————————————————————————-

We verified the following to troubleshoot the issue,

  • Certificate on both CRM and ADFS
  • ADFS and CRM IFD configuration
  • Certificate permission
  • Reimporting certificate
  • The same ADFS was working for other CRM deployments without any error
  • CRM eventlog also didn’t give us much info.

Finally using CRM platform trace we could find that during IFD process CRM was verifying all ORG build version and one of the ORG was of old build version. Even though the ORG was disabled, without removing the ORG from deployment manager the auth will fail.

CRM version on which this issue was occurring – CRM 2016 with SP1

How to delete ADFS windows internal database without access credentials?

In case you did ADFS configuration and it created a internal database. Now you are not able to overwrite existing database, this is what you do.

There are 2 ways to get rid of ADFS database,

  1. Delete ADFS database using SQL connection,
    • Install Microsoft SQL Server 2012 Express
    • Connect to windows internal database using “\\.\pipe\MICROSOFT##WID\tsql\query”
    • Now delete AdfsArtifactStore and AdfsConfiguration database
    • In case you do not have access to windows internal database take 2nd optiogn.
  2. Uninstall Windows Internal Database feature
    • Go to Server Manager > Manage > Remove Roles and Features
    • Now go to roles select “Active Directory Federation Service” and click next and select “Windows Internal Database” under features
    • Click next and finish the uninstall.
    • Before we can install roles and features back again we have to delete the database files.
    • Open a CMD and execute below command
      del C:\Windows\WID\data\adfs*

ADFS configuration create container error

Symptoms/Error:

While you try to configure ADFS for the first time on a server you may get an error as below,

You do not have sufficient privileges to create a container in Active Directory at location CN=g2a878q0-f4f5-4648-8asa-4503we478222,CN=ADFS,CN=Microsoft,CN=Program Data,DC=domain,DC=com for use with sharing certificates. Verify that you are logged on as a Domain Admin or have sufficient privileges to create this container, and try again

Now you must be thinking you are using a domain admin account to do the configuration and ADFS service account is also a domain admin, still why you are getting this error.

Reason:

There can be multiple reason for this but the one I was faced with is the DC ADFS was contacting was a one of the AD role server and the that DC can not create containers through LDAP queries.

Resolution:

Now I don’t have a fix for AD configuration. But I can help you with a workaround for this issue.

“Manually create AD containers”

Now don’t try to create AD containers using “Active Directory Users and Computers”. Please open-up “ADSI Edit” console from “Administrative Tools”.

If you are opening ADSI tool for the first time, then you will have to right click “ADSI Edit” and connect to domain.

adsi-connect

Once connected,

  1. Right click on your domain and click New > Object.
  2. Now you will see a list of object types. From the list select “container” and click Next
  3. Input the value as “Program Data”.

container-create

  1. Once “Program Data” is created right click on “Program Data” and create new container “Microsoft”
  2. Now go back to “Program Data” and right click and go to Properties.
  3. Go to Security tab and add the user account (logged in account on ADFS server) you are using to configure ADFS.
  4. Do step-6 for “Microsoft” container also.

Now everything is set. Now try ADFS configuration once again and overwrite ADFS DB.

Create a website or blog at WordPress.com

Up ↑