how do i Getting all the fields from serviceappointment object.

Answered how do i Getting all the fields from serviceappointment object.

  • 12 มีนาคม 2551 9:55
     
     

     

    I want to retrieve all the text fields.

     

    Or just convert serviceappointment to DOM or directly to Doc.

     

     

ตอบทั้งหมด

  • 12 มีนาคม 2551 10:18
    ผู้ดูแล
     
     คำตอบ
  • 12 มีนาคม 2551 11:50
     
     

     

    If I already got the "serviceappointment" object from Crmservice , it is  possible to convert it to Metadata and retrieve it  fields ? ( I means all the text fields ).

     

  • 12 มีนาคม 2551 13:49
     
     

     

    I think that I can rephrase my question as :

     

    1 ) How do I retrieve metadata from a {GUID}

    2) And how I can collect all its fields.

     

    Thank alot.

     

     

    CWild.

     

     

  • 13 มีนาคม 2551 11:15
     
     

    Hello CWild,

     

    don't know, if I get you right.

     

    In CRM metadata is static information on the "class" or construction rules for CRM objects. To access it, you would want to read the the EntityShemaName ( serviceappointment )  or  objecttypecode from your serviceappointment ( since this is a system entity, the code will be predictable: 4214 ) and move on from there.

     

    On your system you should take a look at

    Kind regards,

    Markus

     

  • 13 มีนาคม 2551 13:55
     
     

     

    10x.

     

    Since I have serviceappointment from the <crmService >

     

    serviceappointment sa = (serviceappointment ) crmService.Retrieve("serviceappointment", contactGuid, new AllColumns());

    How could I retrieve its metadata into a some king  of an  Array with its all of his fields & Custom fields.

     

    Is there a simple code to do it ?

     

    Thank alot.

     

    CWild.

     

     

     

  • 13 มีนาคม 2551 15:29
     
     

    Hello CWild,

     

    the MetadataService will only return field names, limits and information about relations to other entities and so on.

    From what you are writing, I understand, that you are seeking to get the information contained in the object, not setup information about the entity.

     

    Can you clarifiy that ?

     

     

    In case you still need the Meta(!)Data, here's code from the SDK.

     

    Code Snippet

    // Retrieve the metadata for the specified entity.

    RetrieveEntityRequest entityRequest = new RetrieveEntityRequest();

    entityRequest.LogicalName = "serviceappointment";

    // Set the amount of data to retrieve.

    // For better performance, do not retrieve All unless you really need it.

    entityRequest.EntityItems = EntityItems.All;

    RetrieveEntityResponse entityResponse = (RetrieveEntityResponse)service.Execute(entityRequest);

     

     

     

    Kind regards,

    Markus

     

     

  • 16 มีนาคม 2551 9:04
     
     

     

    Could I retrieve all the entity fields and its custom fields, by running  some kind of a LOOP inside the metadata

    if I've got only the { GUID } of the entity ?.

     

     

    And can you please in-light me a little bit more about the "RetrieveEntityRequest".

     

    10x.

  • 17 มีนาคม 2551 13:29
     
     คำตอบ

    Hello CWild,

     

    yes. Of course you can loop through metadata.

     

    Generally: I would propose that you open a new thread ( this one is marked as solved ) and rephrase your question there.

    And please: Provide any details you can provide. It's not very useful if I have to keep on guessing, what your question is aiming at. Especially: Please try to distinct between "Data" vs. "Metadata" and "Entity" vs. "Instance/Object".

     

    Thank's for your understanding,

    kind regards,

    Markus