Archive
Intermittent 404 error while accessing F5 load balanced CRM
We recently configured F5 load balancer with 2 CRM application servers and deployed our build.
Within no time we started getting “404 Not Found” randomly while navigating with in the CRM application and up on refresh CRM screen loading properly.
Reason and Fix
- In one of the 2 CRM application servers, CRM website running on different port other than 80.
- So, when request made from load balancer to the wrongly bind CRM server, it was looking for CRM website from port 80 which was not available.
- Up on refresh, if Load Balancer connects to the Application server with CRM on 80 port, its showing up.
- We corrected CRM application port binding to 80 to fix the issue.
🙂
Script error with navigate() statement while navigate between forms – CRM Jscript
We have a Custom entity with 3 forms and the requirement is to navigate to a different form based on a field value .
So we registered a script on form ‘load’ event to navigate to a specific form based on an option set value.
Navigation worked as expected except few user’s that too when application should take User to ‘Form 2’.
Reason and Fix
- We configured new Security Roles recently.
- Our forms were role based and we missed enabling newly added “Security Role” for ‘Form 2’.
- By enabling newly added Security Role for ‘Form 2’ script started working.
🙂
Error initializing component with element id=’xxxx’ and with type=’null’: Object doesn’t support this action – CRM
Recently we configured F5 load balancer and from then we were frequently getting Script Error Notifications while navigating in CRM application.
In error report there is below content
<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Error initializing component with element id=’xxxx’ and with type=’null’: Object doesn’t support this action</Message>
Reason
- ‘Anonymous Authentication’ has been disabled for one of the CRM application in NLB.
- CRM authenticates once for the session and then uses ‘Anonymous’ access to load the components like web resources,Notifications etc. Hence its required to enable Anonymous Authentication.
Fix
- Enable ‘Anonymous Authentication’ and reset the IIS.
🙂
SQL Server Timeout Error – Importing CSV file
Other day I got a SQL Timeout error while importing Article’s using a CSV file which is of 75 KB size.
Below are my troubleshooting steps and Fix .
Troubleshoot steps
- Verified both SQL Server and CRM App server’s event viewer.
- On CRM App server there was only one warning with an ‘Insert’ query. However there was no error information in the log, it’s just that Query was not completely written in the log.
- On SQL Server machine there were no Error or Warning event logs. But there was an Information log around same time which had useful information.
Reason
- In the SQL Server event log, there was an event with below details
“Autogrow of file ‘mscrm’ in database ‘XXXX_MSCRM’ was cancelled by user or timed out after 30824 milliseconds” information.
- So, the issue was with my CRM DB (i.e.XXXX_MSCRM) setting’s “AutoGrowth” property which has higher ‘File Growth’ value.
- It is recommended to keep 1024 MB for data files and 256 MB for log files.
Fix
- Open ‘XXXX_MSCRM’ AutoGrowth setting by following below steps
- Right click on the database.
- Go to Properties.
- Then go to the Files section.
- Click on either the data or log autogrowth column (Click the …)
- Provide the recommended ‘File Growth’ setting
Refer MSDN AutoGrowth Settings article for more details
🙂
SQL Timeout error while exporting solution – CRM
Other day my CRM solution export stopped working and I was getting ‘SQL Timeout’ exception while export.
In the event viewer there was an entry with below content
Query execution time of 30.7 seconds exceeded the threshold of 10 seconds. Thread: 38; Database: {Organization_MSCRM}; Server:192.168.36.7; Query: update [WorkflowBase] set [SupportingSolutionId]=’00000000-0000-0000-0000-000000000000′, [OverwriteTime]=’01/01/1900 00:00:00′
Its bit surprising because my solution hardly had 10 components and timeout due to oversize is unlikely.
Troubleshoot steps
- Reset IIS and Restarted CRM Async & SQL Services
- Finally restarted both CRM Application server and DB Server to complete software updates. But no luck.
Reason
With failed restart machines solution I dig deeper in to event viewer log and found the reason
- In my case since my event viewer log pointing to “update [WorkflowBase]” query I thought problem would be with workflow. I removed all workflows from my solution and tried exporting. But no luck.
- Then I removed my ‘SLA’ from the solution since SLA create workflows when you configure SLA Items. Now solution export worked.
Fix
- By fixing the SLA issue (i.e., In our case we delete a field from Case entity and same not updated in SLA Success criteria). After correcting my SLA I was able to include SLA in my solution and export .
🙂
Trigger USD event from CRM Hosted Control’s Jscript
In one of our requirement we had to trigger a USD Event from CRM Hosted Control’s onchange event of an option set.
Below are the steps to invoke USD event from option set’s ‘onchange’ event.
- Assume your USD event name is “USDOnChange”
- In my CRM Hosted Control’s onchange event placed this statement
function TriggerUSDOnchangeEvent() {
window.open(“http://event/?eventname= USDOnChange“);
}
🙂
‘Saved’ event not triggering on ‘CRM Page’ hosted control – USD
We have an Account form hosted in ‘CRM Page’ hosted control on USD. We got a requirement to navigate another page on CRM form Save event.
Below are the steps I initially followed
- Created a new Hosted Control of type ‘CRM Page’
- Go to ‘Events’ from Command Bar and open ‘Saved’ event
- On ‘Saved’ event of Hosted Control, added a new ‘Action’ to Navigate to Bing
- Save and close
- Open the USD and open ‘Account’ record
But the ‘Saved’ event did not trigger when I click Save button from CRM page.
Reason –
- Looks like this is known issue with my USD version (Got fixed in latest USD version)
Fix –
To fix this, below are workaround steps to hook the ‘Saved’ event to CRM hosted control.
- Open ‘PageLoadComplete’ event of Hosted Control
- Create a new ‘Action Call’
- Action : ExecutionTimeout (Note : Create a new UII action if you can’t find ExecutionTimeout)
- Data : milliseconds=6000
- Create a new ‘Sub Action Call’
- Add below Script using ‘RunXrmCommand’ Action
Script :
function hookSavedEvent(execContext)
{
window.open(“http://event/?eventname=Saved”); // notify USD of save
setTimeout(“top.ScanForData();”, 4000);
}
// Add ‘hookSavedEvent’ to Save event of CRM form
Xrm.Page.data.entity.addOnSave(hookSavedEvent);
- Save & Close the forms
- Close and reopen the USD client application to test the behavior now
- Open ‘Account’ form, click on ‘Save’
- We get a new tab with Bing page
🙂
Display Custom Entity on IPad or Windows 8 CRM App Home Screen
I recently got a chance to work with CRM on Tablets. The requirement was to display a Custom entity on Tablets home screen. It’s very easy to achieve with below steps. Enable entity for tablets
- I have a Custom entity ‘Change Of Address’
- To enable this for tablets, Go to Customization and check ‘CRM for tablets’ check box
Getting Entity on Tablet home screen
- By default ‘Sales Dashboard’ will get displayed on Tablet Home screen
- So to get ‘Change Of Address’ entity on home screen, I added ‘Change Of Address’ entity view to the ‘Sales Dashboard’. (Note : Only 6 sections of Sales Dashboard visible on Tablet home screen)
- Once you publish the changes and reopen the CRM application those changes will take effect
Points to be noted while working with Tablets Form Limitations
- We get the ‘Main’ form of the entity on tablet but with below limitations
- Tabs cannot be expanded or collapsed
- IFRAMES in forms are not displayed in CRM for tablets
- Cannot switch between forms if the entity has multiple forms
- We can differentiate scripts running on Web or Tablet with below check
if (Xrm.Page.context.client.getClient() != "Mobile"){ //Code that should not run in CRM for tablets can be included here }
- All Custom entities can be configured to view on Tablet but not all OOB entities viewable on Tablets (Below are list)
Customization changes Sync between Server and Tablet
- New Customization changes will take effect in Tablet on reopening of application also when its idle for more than 20 hours.
Unsupported SDK messages
- Below are list of unsupported SDK messages on Tablet
Off line Support
- CRM application data will be cached on HTML5 local store.
- Attachments of Records are not available offline.
- You cannot search data when offline.
- Only visited records using tablet gets cached; for example the records which i never opened with my tablet won’t come up when offline.
- Few more points
- We can only create new records. To edit existing records, you need to be connected. You can edit records that you created while you were offline, however.
- You can only create records offline with the Quick Create form, not the full form.
- While disconnected, you can only create standalone records or associate records to those that are cached on your tablet for offline access. For example, you can create an opportunity for an account only if that account was created before you went offline and if it’s cached for offline access. You can’t create an account while offline and then create an opportunity for that account.
- When you’re offline, you can’t set the value for lookup fields. If you create a record that is associated with another record, such as adding a phone call to a contact, some lookup fields might populate automatically (in this case, the To and From fields might pre-populate). You need to fill these fields in once you re-connect while you review and save your drafts.
- Article Work Offline
Refer below MSDN resources for more details
🙂
Executing Failed Workflow Async Jobs – CRM
In my CRM application we trigger workflows on creation of Orders.
Other day because SQL server was down, there were 600 System Jobs failed with ‘SQL Time Out’ error.
Once SQL server issue fixed we had the problem of fixing failed workflow jobs, Since I cannot re-execute the failed jobs from the CRM ‘System Jobs’ UI, only way is to create 600 Orders again which was tedious.
After exploring I came to know that we can re-execute failed ‘System Jobs’ using ‘ExecuteWorkflowRequest’ SDK message.
ExecuteWorkflowRequest SDK message requires
- WorkflowId
- EntityId
Sample Code –
// Create an ExecuteWorkflow request.
ExecuteWorkflowRequest request = new ExecuteWorkflowRequest(){
WorkflowId = _workflowId,
EntityId = _OrderId
};
// Execute the workflow.
ExecuteWorkflowResponse response = (ExecuteWorkflowResponse)_serviceProxy.Execute(request);
Refer article for source code and execution steps for failed jobs.
🙂
SQL Server Error While Exporting Advanced Find Records To Excel
Few Users reported that they were getting “SQL Server Error” while trying to export the Advanced Find records to Excel.
Reason :
- The filter they used in Advanced Find resulted more than 10000 records.
- CRM has OOB limit of 10000 records to export.
- If your CRM instance is on premise, you can check the limit by querying OrganizationName_MSCRM database.
- Below is the query
- SELECT MaxRecordsForExportToExcel FROM OrganizationBase
Fix :
- You can increase the value of “MaxRecordsForExportToExcel”.
Supported Way
- Updating the MaxRecordsForExportToExcel using CRM SDK call is Supported.
- This will work for both on premise and online instances
Organization organization = new Organization();
organization.Id = {Oragnization GUId}; // Get Org GUID from MSCRM_Config DB’s Organization table.
organization.MaxRecordsForExportToExcel = 300000; // Set desired value
service.Update(organization);
Unsupported Way
- As you aware its strictly not recommended to update CRM database directly and also this approach only works for on premise.
- Run below query by connecting to your OrganizationName_MSCRM Database.
UPDATE OrganizationBase
SET
MaxRecordsForExportToExcel = 100000
🙂