Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Couple of options here.</p> <ol> <li>Use the metadata services e.g. Your link, I agree this feels like a bit of an overkill, but you could add caching to reduce the overhead of multiple service calls. If you really don't know what the value is going to be at run time then this is probably the best way.</li> <li>Just hard code it, if you know at compile time what the values will be then this is probably the quickest option. I've done this before and its usually fine. However this will obviously break if someone changes CRM.</li> <li>Use the strongly typed classes, this is effectively hard coding just the system does it for you. However you will have regenerate them if CRM changes.</li> </ol> <p>So none of these are a perfect option I'm afraid, but they all get the job done.</p> <hr> <p>Edit</p> <p>Re: option 3; I mean the early bound entities described here: <a href="http://msdn.microsoft.com/en-us/library/gg328210.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/gg328210.aspx</a>. I'm not sure how much they will help in this situation. They are strongly types classes which are used instead of the entity class. E.g. contact.firstname instead of entity["firstname"]. I suppose you might be able to use them as a form of metadata - never tried it myself though. Also it has the same problem as option 2, when CRM changes they need to be updated and then compiled.</p> <p>In this case I'm veering towards option 1 and querying the metadata services, if you do this once and cache the results at the beginning of your process you will always have the most up to date information. This example shows how to get all the metadata in the system <a href="http://msdn.microsoft.com/en-us/library/jj603008" rel="nofollow">http://msdn.microsoft.com/en-us/library/jj603008</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload