0

I have built a connection between NetSuite and Salesforce using the Data Manager from Analytics Studio. I have a column of data from NetSuite I would like to save (ideally automatically) to a corresponding field on Salesforce Contact records.

I also built a dashboard with the inner joined data from both sources that I display in an analytics dashboard. I was hoping I could save the value using quick actions from contact object, but I am not sure what action would pick up the value from the column and update the record.

Is it at all possible to save the external column onto Salesforce records? And if so how?

Update: There is an SDK for Analytics, I'm running experiments to see how I can extract data through it. https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_sdk.meta/bi_dev_guide_sdk/bi_sdk_overview.htm

1

The Analytics SDK proved useful, in the end I wrote a class with a method that takes for arguments the developername of the dataset as datasetName and the dataset API column names of the salesforce record ID as contactIdColumn and the NetSuite field as netsuiteColumn. Here is an example with the Contact object.

public void syncContactsWithNetSuite(String datasetName, String contactIdColumn, String netsuiteColumn) {
    // Build and execute query
    Wave.ProjectionNode[] projections = new Wave.ProjectionNode[]{
        Wave.QueryBuilder.get('\'' + String.escapeSingleQuotes(contactIdColumn) + '\'')
                        .alias(Contact.Id.getDescribe().getName()),
        Wave.QueryBuilder.get('\'' + String.escapeSingleQuotes(netsuiteColumn) + '\'')
                        .alias(Contact.NetSuite_Custom_Field__c.getDescribe().getName())
        };
    ConnectApi.LiteralJson result = Wave.QueryBuilder.loadByDeveloperName(datasetName)
        .foreach(projections)
        .cap(Limits.getLimitDmlStatements())
        .execute('q');
    String response = result.json;
    // Parse JSON response
    List<Contact> records = MyUtility.jsonParseOutContactData(response);
    // Update all records
    Database.update(records, false);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.