Started by Jofar ArcharNov 9, 2021

Open
Mule Salesforce query

0 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 0 VIEWES SHARE

I'm seeking to populate a joiner desk in salesforce from data in a database. The joiner desk has two lookups (of course to two exclusive items).

My waft begins from querying a database. The question fetches have two fields nt_account & cxm_id - those exist as separate gadgets in salesforce so I need to research salesforce to get their corresponding salesforce IDs to create a report in my joiner desk. I am no longer certain of the precise manner to do this

Below is the waft I've which takes nt_account and did a query against sf to get its id in sfdc and create the joiner report. Now my question is what's the right manner to populate the alternative loop in my joiner that is (a look up on sfdc for cxm_id in a database). Will it be a good choice to query for cxm_id in sfdc for its corresponding SFDC id and combine each payload and pass it on creating (if yes any pointers on a way to try this will help)?

<batch:job name="Batch2">
        <batch:threading-profile poolExhaustedAction="WAIT"/>
        <batch:input>
            <poll doc:name="Poll">
                <fixed-frequency-scheduler frequency="1000"/>
                <db:select config-ref="Generic_Database_Configuration" doc:name="Database">
                    <db:parameterized-query><![CDATA[SELECT NT_ACCOUNT,CXM_ID from Table where lastmodifieddate = 'within last 24 hours';]]></db:parameterized-query>
                </db:select>
            </poll>
        </batch:input>
        <batch:process-records>
            <batch:step name="Batch_Step_1">
                    <sfdc:query-single config-ref="Salesforce__Basic_authentication1" query="dsql:#[&quot;SELECT id FROM FM_Account__c WHERE account_number__c = '&quot;+payload.NT_ACCOUNT+&quot;' LIMIT 1&quot;]" doc:name="Salesforce"/>
            <batch:commit size="200" doc:name="Batch Commit">
                    <data-mapper:transform config-ref="Map_To_Map_1" doc:name="Map To Map"/>
                    <sfdc:create config-ref="Salesforce__Basic_authentication1" type="Joiner_Table__c" doc:name="Salesforce">
                        <sfdc:objects ref="#[payload]"/>
                    </sfdc:create>
                    <logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
            </batch:commit>  
            </batch:step>
        </batch:process-records>
    </batch:job>

0 Replies

You must be Logged in to reply
Techiio

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

facebooklinkdeintwitter

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Copyright techiio.com @2020 Kolkata, India
made with by Abhishek & Priyanka Jalan
Copyright techiio.com @2020
made with by Abhishek & Priyanka Jalan