azure data factory - salesforce lookup - salesforce

I am utilizing azure data factory upsert salesforce.
I have two tables in salesforce
contacts__c (holds the the individual first and last name )
contactdetails__c (holds additional information about contact)
since I can not use dataflows directly with salesforce (for lookup), I upsert contact__c (sourcesystemid__c hold our internal contact ID).
when trying upsert contactdetails__c, I have to perform a lookup on the fly to know the salesforce internal ID associated for each contact and use that to upsert contactdetails__c.
I saw article suggesting to use contact__r.sourcesystemid__c which doesn't work for me .
I use copy data activity for contactdetails with source being my data in azure sql (with our internal contact ID) and sink is contactdetails__c on the mapping of the contactID I use
source sink
contactid contact__r.sourcesystemid__c
but it doesn't work
would appreciate any suggestion as to how I can lookup internal id of contact while upserting contactdetails table
thanks

Your question is missing a lot of details. I do not know how you are trying to do this, but assuming you are using the REST API then take a look at the section named Upserting Records and Associating with an External ID of this document.
One question... Why are you using custom sObjects for this? Why not use the standard Contact sObject. Also having the data denormalized like you are indicating is a bad idea in Salesforce.

Related

What field should I use when collecting external system user info in SF Marketing Cloud?

I've been wondering which field should I use when collecting user purchases, views, etc. There are a couple of different resources in Salesforce about this and both of them tell differently.
First one is under Email Recommendations -> Implementation, inside marketing cloud itself:
And it says that Subscriber Key should be used.
The other one is from Salesforce Docs (https://help.salesforce.com/s/articleView?id=sf.mc_ctc_set_user_info.htm&type=5):
This one says that Subscriber ID should be used.
As far as I understand it, these two are completely different. I use Contact Id from Salesforce as my SubscriberKey and I think Subscriber Id is generated inside marketing cloud itself.
The JSON itself has a field that's named "email" - the name suggests that email should be used.

convert candidate to account salesforce

i am new in salesforce sales cloud. I created custom fields in candidate, but When I transform on account I do not see those fields. Is there any configuration for that? Or should I create those same fields in accounts?
Thanks friends.
First you need to create fields in both objects and then map them thru Lead Conversion Mapping in setup. Then when you convert lead to account, you will see that the content will be transferred.
You must create them on Accounts as well. Each table must be configured independently.

How to find Uniqueness in Azure Usage Records from Billing APIs

I am building an Azure Chargeback solution and for that I am pulling the Azure Usage data from Azure Billing REST APIs for multiple subscriptions and different dates. I need to store this into custom MS SQL database as per customer’s requirements. I get various usage records from Azure.
Problem: From these Usage records, I am not able to find any combination of the columns in the data I receive which will give me a
Unique Key to identify a Usage record for a particular subscription
and for a specific date. Only column I see as different is Quantity
but even that can be duplicated. E.g. If there are 2 VMs of type A1
with no data or applications on them, in the same cloud service, then
they will have exact quantity of usage. I do not get the exact name
of the VM or any other resource via the Usage APIs.
One Custom Solution (Ineffective): I can append a counter or unique ID to the usage records but if I fetch the data next time the
order may shuffle or new data may be introduced thereby affecting the
logic for uniqueness. Any logic I build to checking if any data is
missing in DB will result in bugs if there is any alteration in the
order the usage records are returned (for a specific subscription for
a specific date).
I am sure that Microsoft stores this data in some database. I can’t find the unique id to identify a usage record from many records returned by the Billing API. Maybe I am missing something here.
I will appreciate any help or any pointers on this.
When you call the Usage API set the ShowDetails parameter to true: &showDetails=true
MSDN Doc
This will populate the instance data in the returned JSON with the unique URI for the resource which includes the name for example:
Website:
"instanceData": "{\"Microsoft.Resources\":{\"resourceUri\":\"/subscriptions/xxx-xxxx/resourceGroups/mygoup/providers/Microsoft.Web/sites/WebsiteName\",\"...
Virtual Machine:
"instanceData": "{\"Microsoft.Resources\":{\"resourceUri\":\"/subscriptions/xxx-xxxx/resourceGroups/TESTINGBillGroup/providers/Microsoft.Compute/virtualMachines/TestingBillVM\",\...
If ShowDetails is false all your resources will be aggregated on the server side based on the resource type, all your websites will show as one entry.
The resource URI, date range and meterid will form a unique key as far as I know.
NOTE: If you are using the legacy API your VMs will be aggregated under the cloud service hosting them.

Is it possible to update/delete User by externalId

We are trying to develop a SCIM enabled Provisioning system for provisioning data from an Enterprise Cloud Subscriber(ECS) to Salesforce(Cloud Service Provider-CSP). We are following SCIM 1.1 standard.
What are we able to do:
We are able to perform CRUD operations on User object using Salesforce auto-generated userId field
Exact Problem:
We are not able to update/delete User object using externalId provided by ECS.
Tried something as below... But it is not working, Unknown_Exception is thrown...
XXX/my.salesforce.com/services/scim/v1/Users/701984?fields=externalId
Please note that it is not possible to store Salesforce userId in ECS's database due to some compliance reasons. So we have to completely depend upon externalId only.
Possible Workaround:
Step1: Read the userId based on externalId from Salesforce
Step2: Update the User object using the salesforce UserId obtained in Step1.
But this two step process would definitely degrade the performance.
Is there any way to update/delete the User by externalId
Could you please guide us on this..
Thanks so much....
I realize this is old thread but wanted to note that you CAN update Users from REST using an external ID. The endpoint in above question is incorrect. Following is how it should be set, send as a PATCH request:
[instance]/services/data/v37.0/sobjects/user/[external_id__c]/[external id value]
Instance = your instance i.e. https://test.salesforce.com/
external_id__c = API name of your custom external Id field on User
external id value = whatever the value of the user's external Id
NOTES:
Salesforce responds with an HTTP 204 status code with No Content in the body, this isn't usual for patch requests, but it is 'success' response
The external id on user has to be a custom field, make sure it is set
as UNIQUE
Ensure the profile/permission set of the user that is making the call
has the Manage Users permission & has access to the external id field
It is pretty common pattern for other applications, too, to search first and then perform on update on the returned object. Your workaround seems fine to me. What performance problem are you concerned about? Are you concerned about Salesforce not being able to process more requests or are you concerned about the higher response time in your application because you need to make multiple requests? Have you actually measured how much an extra call costs?

External Ids in Salesforce

How do I create an External Id on objects like Profile (for which isCreatable is false). I have to create External Id on Profile for upsert operation, but I am not able to create it.
Is there any work around for this? Or Can we ask salesforce to allow us to create external ids.
Any links or references would be useful!!
Follow up of Create new Profile Object in salesforce?
You can't create external Ids on the metadata components (Profiles, classes, visualforce pages, custom fields). Most of the time they're guarded by having Name or DeveloperName unique. (with addition of namespace but let's ignore managed packages for now)
Profile object doesn't support create but similarly it doesn't support upsert ;) Compare http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_account.htm and http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_profile.htm
I don't understand what exactly are you trying to achieve?

Resources