Hi!
I suppose you try to save your form from Javascript ;). I suggest you to use Power Apps features if you can (business rule, calculated fields, PowerFX fields then save button). If you really need to save your entity from Javascript, yes you can use this:
You need to bind the form on your function passing the context as parameter. And you need to make sure your Javascript function has parameter 'executionContext'.
It should look like that:
function newFunctionToSave(executionContext) {
try {
const formContext = executionContext.getFormContext();
formContext.data.entity.save(saveOption)
}
} catch (error) {
console.error("An error occurred in newFunctionToSave:", error);
}
}
saveOptions is a parameter to indicates if you need to save and close or save and New Command (saveandclose, saveandnew). make sure to use this properly because you can create weird behaviors using that!
I hope it helps!
___________________________________________________________
Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.