Update a record with no form involved.

I’m working within a web service ws_create() method, and I need to update a SQL Server table with an integer PK.

I can create a new record easily enough:

var idx = customerFoundset.newRecord();
var customerRec = customerFoundset.getRecord(idx);
customerRec.servoyusername = userIn.servoyusername;
customerRec.accountcode = userIn.accountcode;
customerRec.address1 = userIn.address1;
customerRec.address2 = userIn.address2;
customerRec.address3 = userIn.address3;
customerRec.address4 = userIn.address4;
customerRec.addresspc = userIn.addresspc;
customerRec.source_entity = userIn.companycode;

I can also determine if a particular record already exists and needs to be updated (as opposed to created) by using find() / search().

What is the best way of updating a single record in this situation ?

Never mind - Search() of course changes the foundset index if the search is successful (which isn’t mentioned in the docs), and from that you can get a record and update it.