If you have a solution where BigMachines is connected to Salesforce, this is the way
how two import a Salesforce field to a commerce process main document attribute.
Make sure you have the API name of the Salesforce field that you want to import. Then make sure you have the attribute variable name of the main document of the commerce process to which you want to import the value of the Salesforce field to.
Now, you have to do two things:1. Create an integration XSL file.
2. Add this integration to the Commerce process action to make the integration take place when creating a new quote. If you have a custom action for editing an quote, add to this one as well.
1. The Generator Here is an example file for the generator on how to import the Id of a specific Record Type in Salesforce.
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:output method="xml"/> <xsl:variable name="main_doc" select="/transaction/data_xml/document[@data_type=0]"/> <xsl:strip-space elements="*"/> <xsl:template match="/"> <!-- Begin SOAP XML --> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Header> <QueryOptions xmlns="urn:partner.soap.sforce.com"> <batchSize>2000</batchSize> </QueryOptions> <SessionHeader xmlns="urn:partner.soap.sforce.com"> <sessionId> <xsl:value-of select="/transaction/user_info/session_id"/> </sessionId> </SessionHeader> </soap:Header> <soap:Body> <query xmlns="urn:partner.soap.sforce.com"> <queryString> Select Id, Name From RecordType where Name = 'A Record Type' </queryString> </query> </soap:Body> </soap:Envelope> <!-- End SOAP XML --> </xsl:template> </xsl:stylesheet>
|
1. The Parser <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf2="urn:partner.soap.sforce.com" xmlns:sf="urn:sobject.partner.soap.sforce.com"> <xsl:output method="xml"/> <xsl:template match="*"> <data_xml> <document document_var_name="documentVarName"> <commerceProcessMainDocAttribute> <xsl:value-of select="//sf:Id"/> </commerceProcessMainDocAttribute> </document> </data_xml> </xsl:template> </xsl:stylesheet>
|
The attribute 'commerceProcessMainDocAttribute' is as the name says the attribute of the main document in the commerce process. The tag inside this tag specifies which Salesforce field to be put in this attribute. You can choose from the ones selected in the Generator query.
You can find the name of 'document_var_name' in process definitions -> Documents (List) -> The top document (click on it). The variable name is what you're searching for.
Further on, when specifying the integrator XSL you have to specify an id. This should be the on the form <document_var_name>.<commerceProcessMainDocAttribute> in this case.
2. Add integration file to actions
Press the link 'Commerce Process' and make the new integration XSL file as selected on the integration tab.
This is all that has to be done!
It is also possible to import it further on to a specific configuration, but that's for another time.