Search code examples
dynamics-crmdynamics-365dynamics-crm-365dynamics-crm-webapidynamics-crm-sdk

Retrieving messages supported by entity type


For each of the CRUD request there's a table with supported entities. Is there any way to obtain such info from SDK/WebAPI per entity type?

Probably some metadata properties or separate requests to check?


Solution

  • Maybe this documentation should help you.

    To verify if a message and entity combination supports execution of plug-ins using a database query, you can use the following Web API query:

    {{webapiurl}}sdkmessages?$select=name
    &$filter=isprivate eq false 
    and (name ne 'SetStateDynamicEntity' 
    and name ne 'RemoveRelated' 
    and name ne 'SetRelated' and 
    name ne 'Execute') 
    and sdkmessageid_sdkmessagefilter/any(s:s/iscustomprocessingstepallowed eq true 
    and s/isvisible eq true)
    &$expand=sdkmessageid_sdkmessagefilter($select=primaryobjecttypecode;
    $filter=iscustomprocessingstepallowed eq true and isvisible eq true)
    &$orderby=name
    

    Fetchxml version:

    <fetch>
      <entity name='sdkmessage' >
        <attribute name='name' />
        <link-entity name='sdkmessagefilter' alias='filter' to='sdkmessageid' from='sdkmessageid' link-type='inner' >
          <filter type='and' >
            <condition attribute='iscustomprocessingstepallowed' operator='eq' value='1' />
            <condition attribute='isvisible' operator='eq' value='1' />
          </filter>
          <attribute name='primaryobjecttypecode' />
        </link-entity>
        <filter>
          <condition attribute='isprivate' operator='eq' value='0' />
          <condition attribute='name' operator='not-in' >
            <value>SetStateDynamicEntity</value>
            <value>RemoveRelated</value>
            <value>SetRelated</value>
              <value>Execute</value>
          </condition>
        </filter>
        <order attribute='name' />
      </entity>
    </fetch>