編輯

共用方式為


formContext.data.entity (Client API reference)

Provides properties and methods to retrieve information specific to the record displayed on the page, the save method, and a collection of all the columns included in the form. Column data is limited to columns represented on the form.

Properties

Name Description
attributes Collection of columns for a record displayed on the form.
More information: Collections and Columns.

Methods

Name Description
addOnSave Adds a function to be called when the OnSave event is triggered. The event occurs before the save occurs, giving the handler an option to cancel the save operation.
addOnPostSave Adds an event handler to the PostSave Event event.
getDataXml Returns a string representing the XML that will be sent to the server when the record is saved. Only data in columns that have changed or have their submit mode set to "always" are sent to the server.
getEntityName Returns a string representing the logical name of the table for the record.
getEntityReference Returns a lookup value that references the record.
getId Returns a string representing the GUID value for the record.
getIsDirty Gets a boolean value indicating whether any columns in the form have been modified.
getPrimaryAttributeValue Gets a string for the value of the primary column of the table.
isValid Gets a boolean value indicating whether all of the table data is valid.
removeOnPostSave Removes an event handler from the PostSave Event event.
removeOnSave Removes a function to be called when the record is saved.
save Saves the record synchronously with the options to close the form or open a new form after the save is completed.

Understand Xrm object model
Controls (Client API reference)