function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Peter UchytilPeter Uchytil 

Classic ASP, ID from create?

Hi. I have an application where our company's resellers apply for a reward/discount program. The application is currently online and I'm trying to adapt it to dump data into Salesforce. I want to be able to create an Account, Contact and Opportunity. I'm to the point where I can create the records, but I don't see a way to get the newly created record ID back. In SQL I did that on the INSERT statement. Looking at the docs and playing around a bit, I didn't see return value from the create.

I was hoping for something like this: newId = sfobj.Create( NewAccount, false )

Can anyone point me in the right direction? Thanks!

Pete

werewolfwerewolf
Hi Pete,

That Create call modifies the object in place; so if the create didn't result in an error, then you can just get the value of the "Id" field on the same SObject you just used in the Create call.  That Id field will now be populated with the newly-created ID.
Peter UchytilPeter Uchytil
Fabulous! Thank you so much for the quick response. Silly me for not checking the ID. Thanks again.

Pete