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
Garry LindsayGarry Lindsay 

Updating records help

Does anybody have any sample source for updating certain fields in the Lead object based on the Lead record id in VBSCRIPT

i.e. something like normal ANSI SQL

Update Lead Set Lastname = "Lindsay" Set Firstname = "Garry" Where id = 1234

Any ideas on how I use the COM object API to do this?

Cheers

Garry

DevAngelDevAngel

Hi Garry,

Our SOQL language only supports select.

To do the update you require, you would do a query using the criteria you have below.  This will populate an SObject with the current data for the object, and more importantly, return the id of the object.  The update requires a valid id to know which object to update due to the lack of an update type SOQL statement.

You would then set the Last and First name fields to the values you want, then call the update method on the SObject.