Solved

Edit or remove a custom field in Schema manager

Posted on 2004-09-17
7
585 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 143

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 143

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 143

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
download font website 4 85
Visual studio 2015 enterprise 5 105
Single ERP VS muttiple Application or Systems 6 129
Using Specialized Fonts in CSS 1 58
Introduction This article provides a high-level overview of the Quick Campaign and Campaign features of Microsoft CRM. The purpose of both types of campaign is to track outgoing marketing activity and customer responses in a single record. F…
Salesforce.com’s Console is a great tool to view activities, leads, contacts, accounts and opportunities all in one screen. It is particularly effective during call blocks and working numerous activities at a time in a quick, repetitive fashion (suc…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

740 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