0

I am loading accounts records from external system using SOAP API..I want to specify RecordType ID on the account records..As far as I know, I think I need to query salesforce first for the RecordType ID and then use it in the account message. Just wanted to know If this is the right approach OR any better suggestions.

Thanks for your feedback.

2 Answers 2

1

You're going in the right direction, you should never hardcode IDs for this kind of thing.

You'll want to use the SObjectType and DeveloperName fields on RecordType to determine the ID of the recordtype that you want. You shouldn't use the general Name field as this could get changed by an Administrator at any time.

An alternative if you want to keep that kind of code in Salesforce for maintenance purposes would be to expose a custom Apex SOAP API that takes care of assigning the RecordTypeId field. That way the calling code wouldn't have to worry about it at all, and if requirements changed down the line you'd be able to make changes in Salesforce only and not on both ends.

2

Yes that's the right approach.

Query RecordType for the correct SObject and then use the Id in that SObject record's recordtypeId.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .