Have you ever needed to be able to associate more than the default number of child cases that a parent case can have in CRM? Out-of-the-box CRM allows for a parent case to have up to 100 child cases, but in today’s blog, we’ll show you how to increase that when necessary.
NOTE: This solution will only work in an on-premises environment.
While the DBSettings tool, available from CodePlex, won’t let you configure, it does let you make some pretty cool changes in a CRM Online environment and we’d strongly encourage you to check it out!
Many settings like this appear in the MSCRM_CONFIG database. Here is a SQL script that searches any database for a string:
- declare @TableName char(256)
- declare @ColumnName char(256)
- declare @FindString char(256)
- declare @sql char(8000)
/*Replace X with character(s) you which to find and Y with its replacement*/ set @FindString = 'STRING' /*select o.name, c.name from syscolumns c inner join sysobjects o on o.id = c.id where o.xtype = 'U'*/ declare T_cursor cursor for select o.name, c.name from sysobjects o inner join syscolumns c on o.id = c.id where o.xtype = 'U' and c.xtype in (175,239,99,231,35,167) open T_cursor fetch next from T_cursor into @TableName, @ColumnName while (@@fetch_status <> -1) begin set @sql = 'if exists (select * from ' + rtrim(@TableName) + ' where ' + rtrim(@ColumnName) + ' like ''%' + rtrim(@FindString) + '%'') begin print ''Table = ' + rtrim(@TableName) + ' Column = ' + rtrim(@ColumnName) + ''' end' exec(@sql) fetch next from T_cursor into @TableName, @ColumnName end close T_cursor deallocate T_cursor
To use the script, replace the word STRING with the word you want to find. You’ll also want to add a USE statement to the beginning of the script or change the context of the database that you are running this against in the SQL Management Studio.
When the script finished, it will return a column in the OrganizationProperties table called MaxChildIncidentNumber. Keep in mind that the settings held in this table appear on a per-organization basis, so the script below will update every organization if run as-is.
UPDATE OrganizationProperties SET IntColumn = /* Number of cases you want a parent to be able to have*/ WHERE ColumnName = 'MaxChildIncidentNumber'
When you run the script, perform an IIS reset, and the change will have taken effect!
We’re always writing great technical blogs here at PowerObjects for fun projects like this! Check out these fun reads next:
- Debugging Your Plug-ins with the Plug-in Trace Log
- Access Is Denied: How to Identify and Fix a Security Role Issue