Solved

Edit or remove a custom field in Schema manager

Posted on 2004-09-17
7
583 Views
Last Modified: 2013-12-03
Is there any way to edit or remove a custom field attribute which has already been published in CRM 1.2
We want to remove some obsoleted customizations and alter the type of some established schema field (from string to picklist, etc)
Thanks-
PTM
0
Comment
Question by:PTMANG
  • 3
  • 2
7 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 12123500
Yes, but NOT with the CRM GUI.
Now, unfortunately, this won't be very "easy" unless you have practice with SQL Server: Profiler & Query Analyser.
In short, the REASON why CRM doesn't allow to remove a column is due to the simple fact that SQL Server doesn't allow to drop a column. You might say: STOP, EM allows to drop columns! Indeed, but if you look at the script that is generated by EM to "drop" the column, it basically renames the table, creates a new one without the "dropped" column, and copies over the data. So in fact you can still blame M$, but not CRM :-)


To know EXACTLY what happens, you should (on a test environment) prepare everything so you are alone on the environment. Don't forget to disable all the SQL jobs for CRM etc...

Then, before adding a new property, start the SQL Profiler to trace all SQL acticity (SQL statements & PROCs).
First, there will be some SELECT's to check if what you entered is valid:
* check if the attribute name is unique for the schema item
* check if the updated underlying schema item table would not become to large (it needs to stay < 8KB size)
* etc

The first insert will look like this:
INSERT INTO Attribute (AttributeId, EntityId, AttributeTypeId, Name, PhysicalName, LogicalName, Description, LocalizedName, Length, IsNullable, ValidForUpdateAPI, ValidForCreateAPI, ValidForReadAPI, VisibleToPlatform, RequiresPlatformAuthorization, ColumnNumber, IsPKAttribute, IsCustomField,IsRequiredForGrid,IsLogical ,ReferencedEntityObjectTypeCode, DisplayMask) VALUES(N'{EFC0BC0E-CEB4-4178-9821-90A2015855F2}', N'{115A1377-9CAC-4267-A169-BB7067F6B6D6}', N'{00000000-0000-0000-00AA-11000000001E}', N'CFSghe2', N'CFSghe2', N'CFSghe2', N'ghe4', N'ghe3', 82, 1,  1, 1, 1, 1, 0, 157, 0, 1,0,0,0, 402653184)
This would be the last DELETE to perform to rollback the new item.

Note that the underlying table for a Schema Item called "XY" will be "XYBase"

Then, the table is altered, adding the column, so you need to remove that column (this will require the table to be recreated)

Now, after that replication part needs to be solved:
exec sp_repladdcolumn  'AccountBase', 'CFSghe2', 'nvarchar (41) NULL'

Also here, there is no function sp_repldelcolumn, you have to recreate the entire article (ie table) for the replication.
Now, if you don't want to replicate among different SQL servers, you could live without this...

Hope this helps
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 12309228
Grade C ????
0
 

Author Comment

by:PTMANG
ID: 12309244
Sorry, didn't look before click- meant B...could the mods change this?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 12311972
Thanks!
it's not for the points, just wanted to understand :-)
Cheers
0
 

Author Comment

by:PTMANG
ID: 12312030
No prob. It turns out that its just not feasable to do this, unless we rename fields, or change the picklist criteria.
This all happened beacuse someone who was adding in fields was specifying up to 1000 lines per entry within contact lists
(which ate up precious SQL db allocated space)
Thanks for the effort.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello All, In previous article we used Hortonworks sandbox to work with Hadoop. Now, lets think to create own single node Hadoop on Linux. Here we Install and Configure Apache Hadoop on UI based Oracle Linux. I assume, you have VMware installe…
Messaging apps are amazing tools with the power to do a lot of good, but the truth is the process of collaborating with coworkers requires relationships established through meaningful communication - the kind of communication that only happens face-…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question