You need to sign in to do that
Don't have an account?

Adding a non-salesforce ID to a custom object?
Hi All,
Ive created a custom object (advertiser__c) that I want to use to hold the name of an Avertiser as well as an Advertiser ID. I realize that by default when you create a custom object that you get a name field and an ID field but that ID field is saleforce specific. My quesiton is what do I need to do to be able to tie Advertiser name and its Advertiser ID together? (Advertiser ID would just be an integer which is determed by another system) .
The advertiser__c custom object is represented on a standard opportunity page with a lookup field. I would like the availble options to be presented to the user as the advertiser name, but on the backend when the user selects an advertiser, my process will use its associated advertiser ID.
Any insight on the best way to accomplish this would be much appreciated!
Thanks!
As far as Id in lookup is concerned then when you select the record in lookup it bind the actual salesforce Id in backend. Now if you have any relation between the salesforce record Id and your third party record Id then you can fetch it using the database queries.
You need to do this using your custom logics as salesforce will only bind the salesforce Id in backend with lookup.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
All Answers
You don't need to do any thing to tie the name with the Id. As when we create a record in salesforce it automatically generates a 15-Digit(Case sensitive or 18 - Digit case insensitive) Id for that record.
We can identify that record on the basis of that record Id. Record id will be unique all over the organization.
Lets say I have two fields on Advertiser
1) Name
2) Phone
When I navigate from UI and fill the values say, Name = "Ankit Arora" , Phone = "xxxxxxxxxx" and save the record then a record is created and a 15 - digit Id is also generated which is automatically relates to this record.
Now if you want to get the Id of this record from database, you can do something like this :
List<Advertiser__c> advLst = [select id,name,phone__c from Advertiser__c where name like 'Ankit Arora%'] ;
It will provide you the list of all records whose name starts with Ankit Arora. Now you can get the record Id from this list.
Hope this is clear you from your doubts. And if not then please do let me know.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
As far as Id in lookup is concerned then when you select the record in lookup it bind the actual salesforce Id in backend. Now if you have any relation between the salesforce record Id and your third party record Id then you can fetch it using the database queries.
You need to do this using your custom logics as salesforce will only bind the salesforce Id in backend with lookup.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Thanks!
This helped me figure out what I need to do!
Great! Then can you please mark it as solution so other may get benefit.
Thanks
Ankit Arora
Blog | Facebook | Blog Page