Cuir in eagar

formContext.data.save (Client API reference)

Saves the record asynchronously with the option to set callback functions to be executed after the save operation is completed.

By using formContext.data.save, you can set an object to control how appointment, recurring appointment, or service activity records are processed.

Note

When working with forms and you call the formContext.data.save method, ensure that you also call the preventDefault method to prevent triggering any default save operation when a user saves the form.

Syntax

formContext.data.save(saveOptions).then(successCallback, errorCallback);

Parameters

Name Type Required Description
saveOptions saveOptions No An object for specifying options for saving the record.
successCallback Function No A function to call when the operation succeeds.
errorCallback Function No A function to call when the operation fails. The function receives an object with the following properties:

- errorCode: Number. The error code.

- message: String. A localized error message.

saveOptions parameter

Name Type Description
saveMode Number (Optional) Specify a value that indicates how the save event was initiated. For a list of supported values, see the return value of the getSaveMode method.

Setting the saveMode doesn't actually take the corresponding action; it just provides information to the OnSave event handlers about the reason for the save operation.
useSchedulingEngine Boolean (Optional) Indicate whether to use the Book or Reschedule messages rather than the Create or Update messages.

This option only applies when used with appointment, recurring appointment, or service activity records records.

This property isn't supported in Unified Interface.

formContext.data.entity.save
formContext