isCreate()
Last updated 16/09/2024
Example One
The following code shows a message if a new Catergories record is being created, else will show another message if a new Inventories record is being created.
Creating a new Category or Inventory record shows a message
function NewCategoryInventory(five: Five, context: any, result: FiveError) : FiveError {
if(five.actionID() === 'Categories' && five.isCreate()) {
five.showMessage('Enter in the details for a new category.')
} else if(five.actionID() === 'Inventories' && five.isCreate()) {
five.showMessage('Enter in the details for a new inventory.')
}
return five.success(result);
}
Creating a new Category or Inventory record shows a message
function NewCategoryInventory(five, context, result) {
if(five.actionID() === 'Categories' && five.isCreate()) {
five.showMessage('Enter in the details for a new category.')
} else if(five.actionID() === 'Inventories' && five.isCreate()) {
five.showMessage('Enter in the details for a new inventory.')
}
return five.success(result);
}