Sunday, 28 October 2018

Reporting Error: Error while fetching data extension






Resolution You might use either of the below two solutions or both:
  
1)      SQL Server Reporting Service is not running on server. 

Check SQL Server Reporting Service for its status. Start the service if its already not running. Follow these steps:

ü  Start > Administrative Tools > Services
ü  Right click SQL Server Reporting Service > Properties > Start
ü  Check SQL Reporting Services URL for the Organization

2)      The SQL Report Server URL must have been configured incorrectly

Follow below steps to resolve:

ü  Open Deployment Manager
ü  Disable the Organization for which Reports are not running
ü  Click Edit Organization
ü  Check Report Server URL is correct or not. If it is not correct, update the Report Server URL. It might be of the kind http://crmsrv:5555/ReportServer
ü  Follow the wizard further and click Finish
ü  Enable the CRM Organization

* To know the correct URL for Report Server, open Reporting Services Configuration Manager and click on Web Service URL and check the URL towards the below of dialog window.


Sunday, 21 October 2018

Validation are allowed in MSCRM using JavaScript

1. The contacts first and last name must be alphabets ([A-Z][a-z])
function validateLastName(executionContext) {
   var formContext = typeof executionContext != 'undefined' ? executionContext.getFormContext() : Xrm.Page; // get formContext
   
   var pattern = /[^a-z]/ig;
   var fieldName = 'lastname';
   var currentValue = formContext.getAttribute('lastname').getValue(); 
   if (pattern.test(currentValue)) {
     formContext.getControl(fieldName).setNotification('Invalid value, please only enter letters.');
   } else {
     formContext.getControl(fieldName).clearNotification();
   }

}
2. The account names can have 8 special characters such as & , ', ",  #, -, /, <, >
function validateAccountName(executionContext) {
   var formContext = typeof executionContext != 'undefined' ? executionContext.getFormContext() : Xrm.Page; // get formContext
   
   var pattern = /[^a-z0-9&\'"#\-\/<>]/ig;
   var fieldName = 'name';
   var currentValue = formContext.getAttribute(fieldName).getValue(); 
   if (pattern.test(currentValue)) {
     formContext.getControl(fieldName).setNotification('Invalid value, only these special characters are allowed: &\'" #-/<>');
   } else {
     formContext.getControl(fieldName).clearNotification();
   }

}
3. The city name must be alphabets ([A-Z][a-z])
function validateCity1(executionContext) {
   var formContext = typeof executionContext != 'undefined' ? executionContext.getFormContext() : Xrm.Page; // get formContext
   
   var pattern = /[^a-z]/ig;
   var fieldName = 'address1_city';
   var currentValue = formContext.getAttribute(fieldName).getValue(); 
   if (pattern.test(currentValue)) {
     formContext.getControl(fieldName).setNotification('Invalid value, please enter only letters.');
   } else {
     formContext.getControl(fieldName).clearNotification();
   }

}
4. The phone number attribute can have only  0-9, -, (,) characters as a valid characters
function validateTelephone1(executionContext) {
   var formContext = executionContext ? executionContext.getFormContext() : Xrm.Page; // get formContext
   
   var pattern = /[^0-9,\-]/ig;
   var fieldName = 'telephone1';
   var currentValue = formContext.getAttribute(fieldName).getValue(); 
   if (pattern.test(currentValue)) {
     formContext.getControl(fieldName).setNotification('Invalid value, please enter only numbers or - and ,');
   } else {
     formContext.getControl(fieldName).clearNotification();
   }
}
5. The postal code attribute can have only 0-9, - characters as a valid characters
function validatePostalCode(executionContext) {
   var formContext = typeof executionContext != 'undefined' ? executionContext.getFormContext() : Xrm.Page; // get formContext
   var pattern = /[^0-9\-]/ig;
   var fieldName = 'address1_postalcode';
   var currentValue = formContext.getAttribute(fieldName).getValue(); 
   if (pattern.test(currentValue)) {
     formContext.getControl(fieldName).setNotification('Invalid value, please enter only numbers or -');
   } else {
     formContext.getControl(fieldName).clearNotification();
   }
}