You can import location data directly from your Salesforce Account into MetaLocator. To import your data, click Data, then Import. Choose the Salesforce icon as your Data Source:
Click next to show the Salesforce Connection information. Here you must provide your Salesforce credentials to connect your account.
Once you provide a username, password and security token, click Sign In. This will load the Salesforce Objects available to your account in the Object drop-down box. To choose fields to import, choose the Salesforce object first from the Object drop-down box. That will load the list of Salesforce Fields available from that object in the Fields drop-down box. Choose a desired field and click Add to add it to the Selected Fields. Continue adding fields as needed.
You may encounter connection issues if your password contains XML-reserved characters such as
<
>
&
"
'
Sandbox Accounts
Those requiring access to a Salesforce Sandbox Account must provide the Sandbox Partner WSDL from their SFDC account. Click the Upload WSDL file button which appears after choosing Sandbox from the Salesforce Environment drop-down as shown below:
Similarly, if a specific version of Salesforce is required for items like compound objects contact the helpdesk to have a custom version of the Partner WSDL configured in your account.
Be sure to include basic location information for your records and a field for the name. The data you choose to import should include at a minimum, Name (E.g. location name), Street Address City, State and Postal code.
Salesforce SOQL Queries
MetaLocator can import fields from a single object at a time using the Field Chooser. To create more complex queries, including those with joins from multiple tables, you must author SOQL and add it to the Custom Query tab. The query must return the columns directly in the result, or as within a single relation.
An example SOQL query is provided below:
SELECT Name,ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode FROM Account
This simple SOQL example pulls 5 columns from the Account object. Users commonly include filters in "WHERE" clauses to limit the data, such as in the following example which uses a custom field called "Account_Status":
SELECT Name,ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode FROM Account WHERE Account_Status__c = 'Active'
Salesforce Relations and Relationship Fields
MetaLocator's data importer consumes 2-dimensional data, however; SOQL can produce multi-dimensional data sets, where a single column referenced in the query returns multiple rows as in a one-to-many relationship. In this case, the data is returned with each row in the the "one" side of the relationship repeated for every related row in the relation.
For example:
SELECT Account.Name, Id, (SELECT Contact.LastName FROM Account.Contacts) FROM Account
In this example, the related Contacts object includes multiple contacts for each Account. This causes the Account rows to repeat.
Relationship fields will be appended to end of the data set. The following query will produce the same response as the example above.
SELECT (SELECT Contact.LastName FROM Account.Contacts), Account.Name, Id FROM Account
For very complex transformations involving multiple tables and filters, SOQL may be too limited. In these cases, some customers have used tools like dataloader.io to instead create a CSV from Salesforce and then used our SFTP or CSV Import instead of connecting MetaLocator directly to Salesforce.
Mapping Fields
Once you have either chosen fields or written a custom query, click Next, and the import process will continue as usual. Be sure to appropriately map your SalesForce columns to MetaLocator System columns as provided during the next step in the import process.
Modifying Salesforce Job and Import Mapping
Once a Salesforce import is running, you may want to modify the import rules, schedule, or query. The import is comprised of two elements, the Job and the Import Configuration.
Modify the Job Fields:
Note: updating the query will require a re-run of the job and new mappings to be applied. See the Modify the Import and Mapping blow for next steps.
Click the processes icon as shown
Select the name of the job to edit the Job fields
From there you can update the Username, Password, Token, Execution Schedule, Salesforce Query
Save the edits by clicking Save in the upper right
Modify the Import and Mapping:
Anytime a new field is added column mapping for the job will need to be re-done. Import options can also be changed from this process (E.g. Update Existing & Insert New).
Navigate to the Tools menu in the upper right and select Import History
Select the Edit Action for the most recent file from the job (find the file name by following the steps in Modify the Job fields section above)
Map the existing or any new fields to fields within MetaLocator and select Next (this will save your mapping choices to the job)
On the next screen update any import options such as Update Existing & Insert New
Select Finish to save the updates
The job now has updated field mappings and options that it will use the next time it is scheduled to run.
Invalid or Incomplete Country information
Add a setting to your Salesforce job called clean_country_data with a value of 1 to invoke a process which tries to complete TLD and country data where it is provided empty.
MetaLocator looks for empty country fields with a TLD value, and sets the country name based on our internal database of country names. It only does this when the country name is not populated.
Similarly, if a country is provided, and a TLD is not provided, we look up the TLD by country name. This process should be considered a fallback. Ideally, complete country and TLD data should come directly from Salesforce.
Add a setting to your Salesforce job called correct_country_data with a value of 1 to invoke a process which tries to complete TLD and country data. This option will overwrite provided country data with MetaLocator's standard English country spelling. This can be used in the case of inconsistent data in the country field.
Changing the WSDL Version of an existing Import
When connecting to the Salesforce API, MetaLocator users can choose which Salesforce API version the connection should use. The API version is determined by the WSDL selection.
Existing background jobs may have WSDL options already set. To update an existing Salesforce background import job to a different WSDL, go to the Background jobs in the upper right:
Edit the job by clicking the Job Name or Type,
Clear any value from the wsdl
option if it is displayed:
Provide the value partner.55.wsdl.xml
or partner.50.wsdl.xml
for the partner_wsdl
option.
If the partner_wsdl
is not displayed, add it as shown below:
Save the job and Force it as shown:
You will receive an error or confirmation of success via email.
If you see the following error:
Error. Salesforce said: Element {}item invalid at this location
This is an indication you are using the Enterprise WSDL, when instead the Partner WSDL should be provided.