These are functions for dealing with the entity data on a form.
When just opening a create form and entering data, you might not even want to save your data. If you just try to navigate away without saving, then a confirm message will appear, reminding you that you have unsaved data.
await xrmTest.Entity.noSubmit();
If you really want to navigate to a different page without saving, call the xrmTest.Entity.noSubmit
function for setting all attributes to submitMode never
, so that none would be saved and thus CRM does not show the prompt.
Saves the data on your current form.
await xrmTest.Entity.save();
This does not use the save button, but the SDK function for saving
Gets the ID of the current record.
const id = await xrmTest.Entity.getId();
Gets the logical name of the current record (entity)
await xrmTest.Entity.getEntityName();
Gets an entity reference pointing to the current record.
const { id, entityName, name } = await xrmTest.Entity.getEntityReference();
The return object has the schema { id: string, entityName: string, name: string }
Deletes the current record.
await xrmTest.Entity.delete();
This function uses the delete button of the form.
Activates the current record
await xrmTest.Entity.activate();
This function uses the activate button of the form
Deactivates the current record
await xrmTest.Entity.deactivate();
This function uses the deactivate button of the form
Generated using TypeDoc