Answered by:
Want to retrieve MetaData of an entity lead. (Only attributes that are on Form)

Question
-
I am using CRM 2011 and C#.
RetrieveEntityRequest response2 = new RetrieveEntityRequest()
{
EntityFilters = EntityFilters.All,
RetrieveAsIfPublished = true,
LogicalName = "lead",
};
// Execute the request
RetrieveEntityResponse entityResponse = (RetrieveEntityResponse)this._serviceProxy.Execute(response2);
I want to retrieve the meta data of an entity. The above logic works for me. But i want to add a condition that
Only attributes that are on Form will be retrieved.
I have checked following links but the code mentioned in the blog returns all attributes that are published. But i want only the attributes that are on the entity FORM
http://mileyja.blogspot.com/2011/08/retrieve-installed-language-packs-in_19.html
Any help will be highly appreciated
- Edited by Alex Ben CRM Wednesday, September 5, 2012 8:43 AM
Wednesday, September 5, 2012 8:38 AM
Answers
-
You would need to get the FormXml from the SystemForm Entity for your entity form. Then parse the form xml to find all the attributes on the form.
This should help - http://mscrmdev.blogspot.com/2012/01/crm-2011-form-xml.html
Blake Scarlavai - http://mscrmdev.blogspot.com/ - Sonoma Partners - http://www.sonomapartners.com/ - Follow @bscarlav
CRM 2011 JavaScript Model Generator - CRM 2011 Appender for log4net- Edited by Blake ScarlavaiMVP Thursday, September 6, 2012 2:48 PM
- Proposed as answer by Blake ScarlavaiMVP Friday, September 7, 2012 12:59 PM
- Marked as answer by Michael T. SnyderModerator Friday, October 5, 2012 2:14 PM
Thursday, September 6, 2012 2:48 PM
All replies
-
Hi,
I know you are using C# but still you can check the below link which uses Java script. Hope it helps.
http://social.microsoft.com/Forums/en-IN/crm/thread/f06bfcb5-baa3-49fd-9459-f0617bee5cfd
Thanks,
Prasad
(If you find this post helpful please mark it as answered)
Wednesday, September 5, 2012 10:21 AM -
Hi Alex,
There is a column of "DisplayMask" (I guess in the Attribute table) which contain non-zero value if present on form and zero value if not present on form.
I hope this should resolve your query.
Thanks,
- Proposed as answer by CRMExpert Wednesday, September 5, 2012 11:06 AM
- Edited by CRMExpert Wednesday, September 5, 2012 11:07 AM edit
- Unproposed as answer by Alex Ben CRM Wednesday, September 5, 2012 2:23 PM
Wednesday, September 5, 2012 11:06 AM -
I think DisplayMask is used in CRM 4.0 and i mentioned above that i am using CRM 2011.
Please some senior reply to my post.
Is there any option to achieve this.Wednesday, September 5, 2012 2:23 PM -
You would need to get the FormXml from the SystemForm Entity for your entity form. Then parse the form xml to find all the attributes on the form.
This should help - http://mscrmdev.blogspot.com/2012/01/crm-2011-form-xml.html
Blake Scarlavai - http://mscrmdev.blogspot.com/ - Sonoma Partners - http://www.sonomapartners.com/ - Follow @bscarlav
CRM 2011 JavaScript Model Generator - CRM 2011 Appender for log4net- Edited by Blake ScarlavaiMVP Thursday, September 6, 2012 2:48 PM
- Proposed as answer by Blake ScarlavaiMVP Friday, September 7, 2012 12:59 PM
- Marked as answer by Michael T. SnyderModerator Friday, October 5, 2012 2:14 PM
Thursday, September 6, 2012 2:48 PM