Wednesday, April 1, 2015

Fetch Xml to Get Workflow Id by Name

 <fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>  
  <entity name='workflow'>  
   <attribute name='workflowid' />  
   <attribute name='name' />  
   <attribute name='category' />  
   <attribute name='primaryentity' />  
   <attribute name='statecode' />  
   <attribute name='createdon' />  
   <attribute name='ownerid' />  
   <attribute name='owningbusinessunit' />  
   <attribute name='type' />  
   <order attribute='name' descending='false' />  
   <filter type='and'>  
    <condition attribute='type' operator='eq' value='1' />  
    <filter type='or'>  
     <condition attribute='category' operator='eq' value='0' />  
     <filter type='and'>  
      <condition attribute='category' operator='eq' value='1' />  
      <condition attribute='languagecode' operator='eq-userlanguage' />  
     </filter>  
    </filter>  
    <condition attribute='name' operator='eq' value='WORKFLOW NAME' />  
   </filter>  
  </entity>  
 </fetch>