2022.2

Table Of Contents
ThemandatoryrecordparameterisaJavaScriptobjectthatcontainsoneormorefieldsspecifiedin
thedatamodelattherootlevel.
TherecordparametermaycontainasubsetofthefieldsintheDataModel.Onlythefieldsincludedin
therecordparameterareupdatedinthedatabase,whilethecontentsofallotherfieldsremain
unchanged.
Thecallfailsiftheparameterisomittedorempty,ifanyofthefieldsspecifiedintherecorddoesn't
existintheDataModel,orifavaluecannotbeconvertedtothedatatypethatisexpectedinafield.
Note: Inordertochangevaluesintherecordcopies,thefieldstomodifymusteitherhavea
defaultvalueorhaveanextractiontaskearlierintheprocessthatactuallyassignsavalueto
them.
About data types
Wherepossible,valuesareautomaticallyconvertedintothedatatypeoftherespectivedatafield.
Note: DatesmustbepassedasaDateobjecttoallowthemtobeextractedintoaDatefield.See
DateintheMozillahelpfiles.
Passinganimproperdatatypetriggersanerror.Forinstancethefollowingobjectsareallinvalid:
{ myBoolean : "true" }-ThemyBooleanfieldisbooleanandexpectsaboolean,notastring
{ myDate : "2021-03-29" }-ThemyDatefieldisadateandexpectsaDateobject:myDate:
new Date(2021,2,29),notastring
{ myPageCount : 2.5 }-ThemyPageCountfieldisanintegerandexpectsanumberwithoutany
decimals
{ myPrice : "19.99" }-ThemyPricefieldisacurrencyandexpectsanumbervalue,notastring
Example
record.copies = 3;var oneRec = {CopyFor:'',Note:''};
for(var i=0;i<record.copies;i++){
switch (i) {
case 0:
oneRec.CopyFor = "Customer";
oneRec.Note = "Payment due in 30 days";
break;
case 1:
oneRec.CopyFor = "Administration";
oneRec.Note = "Due date set to 30 days";
break;
case 2:
oneRec.CopyFor = "Archive";
}
record.setCopy(i, oneRec);
}
record
Thecurrentrecordinthemaindataset.
Page 393