Skip to content

Instantly share code, notes, and snippets.

@edegula
Created May 17, 2015 14:15
Show Gist options
  • Save edegula/603e1ef446cc1b2c1f02 to your computer and use it in GitHub Desktop.
Save edegula/603e1ef446cc1b2c1f02 to your computer and use it in GitHub Desktop.
Contact Query
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="urn:test.com:corp:sf:rng:managemasterdata">
<xsl:output omit-xml-declaration="no" indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- Create the Contact Query XML -->
<xsl:template match="/">
<Contact>
<Operation>Query</Operation>
<ObjectType>Contact</ObjectType>
<Condition>
<xsl:apply-templates select="ns0:ActivityRelationRequest/ActivityRelation[Type='Contact']" />
</Condition>
<sObjects>
<sObject>
<Id/>
<Contact_ID__c/>
</sObject>
</sObjects>
</Contact>
</xsl:template>
<!-- collect all Salesforce Ids and add to the condition node -->
<xsl:template match="ns0:ActivityRelationRequest/ActivityRelation[Type='Contact']">
Id = '<xsl:value-of select="SF_Id" />'
<xsl:if test="not(position() = last())">OR</xsl:if>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment