2022.2

Table Of Contents
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
Thisscriptaddsanemptyrowtoadetailtablecalled'myDescriptions'.
row = record.tables.myDescriptions.addRow();
set(record)
Theset()methodofthetableobjectsetsfieldvaluesinanexistingdetailtablerow.Therowisspe-
cifiedbyitsindexinthedetailtable:
record.tables.<table>[index].set(<record>)
Iftheindexisinvalid,thecallfails.
record
ThemandatoryrecordparameterisaJavaScriptobjectthatcontainsoneormorefieldsspecifiedin
thedatamodelforthedetailtable.
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.
About data types
Wherepossible,valuesareautomaticallyconvertedintothedatatypeoftherespectivedatafield.
Page 403