Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Wednesday, July 31, 2013

CRM 2011 Views – Retrieve more than 5000 records

As you probably know, by default CRM view retrieve only 5000 records for the view, to retrieve more than 5000 records we can use following method, Note that this is an unsupported change. This will applied to all Organizations in the CRM.

Database: MSCRM_CONFIG
IntColumn Value: Set to -1,

This will retrieve all records in the table.
UPDATE DeploymentProperties
SET IntColumn = '-1'
WHERE ColumnName = 'TotalRecordCountLimit'
After executing this query give a IIS Reset.

There is another way to change the registry value, But it will only applied to fetch XML, after you changed registry value still you receive only 5000 record in Entity grid. http://www.interactivewebs.com/blog/index.php/server-tips/turn-off-microsoft-crm-2011-5000-limit-on-data-retrieval-via-sdk/

Tuesday, March 20, 2012

CRM 2011 - Update user time zone from SQL query


Recently I wanted to find out users who are not in the correct time zone in CRM System. To change the time zone or user related settings we need to log in to the system by using that particular user's login details (see the below screen shot 1 and 2).


But if you system is up and running it is not possible to ask there login details. so here it the solution. login to the system as System admin, then go to the File , Option and "General" Tab Set the time zone and click "OK".

In CRM we have separate table "[UserSettingsBase] " , which contains all the user related setting information. for an example time zone, currency, language and ..... Use the following script to get the admin users time zone details from the database.


select TimeZoneBias, TimeZoneCode from [UserSettingsBase]
where SystemUserId In (select distinct SystemUserId from SystemUserBase where DomainName like '%DOMAIN\USERNAME%')

Find out which users are not in the correct time zone. use following script.
select FullName , CreatedByName, CreatedOn, DomainName, ModifiedByName from SystemUser
where SystemUserId In (
SELECT SystemUserId
FROM [UserSettingsBase]
where [TimeZoneBias] != -480
and [TimeZoneCode] != 215)
and IsDisabled = 0

If you want to update these users time zone with correct time zone you can simpy use following script. Don't forget to give an iisreset to view your changes.
update [UserSettingsBase]
set [TimeZoneBias] = -330, TimeZoneCode = 200
where SystemUserId IN (select SystemUserId from SystemUser
where SystemUserId In (select SystemUserId
from [PRM_MSCRM].[dbo].[UserSettingsBase]
where [TimeZoneBias] != -480
and [TimeZoneCode] != 215)
and IsDisabled = 0)

MS CRM 2011 KB Article customization Issue.

Recently I have encountered some issue while customizing Kb Article Entity. I was doing following configuration in Article form. 1. Add Ba...