locked
How to determine if an Attribute is Readonly with AttributeMetaData RRS feed

  • Question

  • Hi all,

    i have to create an alternative UI for CRM, i want to display Attributes similar to the original Attributes. It's no problem to retrieve the metadata an create the Attributes on my website, but how can i determine if an attribute is readonly?
    In the SDK they say i have to retrieve the AttributeRequiredLevel, but it always show the value "none".

    Here is the code i use:

    RetrieveEntityRequest rer = new RetrieveEntityRequest();
    rer.LogicalName = entityname;
    //rer.EntityItems = EntityItems.All;
    rer.EntityItems = EntityItems.IncludeAttributes;

    EntityMetadata entitymeta = ((RetrieveEntityResponse)CrmConnector.Instance.CRMMetaService.Execute(rer)).EntityMetadata;

    It does not make a difference if i retrieve EntityItems.All or EntityItems.IncludeAttributes.

    Thanks for your help!

    Edit: I have forgotten to say i'm using CRM 4.0 :)

    Thursday, March 26, 2009 8:34 AM

Answers

  • Hi,

    Read Only is something you do in the form designer, and not a capability with the attribute. So that is something you need to keep in sync yourself.

    The Required level is something evaluated by the GUI, but not by the business logic. You can for instance insert a record with SDK, not filling in mandatory attributes.

    So, my best suggestion; do this manually .... until next version ...

    Morten

     

    Thursday, March 26, 2009 9:16 AM

All replies

  • Hi,

    Read Only is something you do in the form designer, and not a capability with the attribute. So that is something you need to keep in sync yourself.

    The Required level is something evaluated by the GUI, but not by the business logic. You can for instance insert a record with SDK, not filling in mandatory attributes.

    So, my best suggestion; do this manually .... until next version ...

    Morten

     

    Thursday, March 26, 2009 9:16 AM
  • Is this something that is now possible in CRM 2011?
    Wednesday, August 31, 2011 5:06 PM
  • This implementation has not changed in CRM2011, so Morten's previous response still stands.
    Daniel Cai | http://danielcai.blogspot.com
    Wednesday, August 31, 2011 5:38 PM