There are things that you cannot do with business rules etc,
Yes would be in a Web Resource that you added to the Form Properties (not embedded/inserted in the form), and then hooked up to the From on OnLoad to call your JS functon.
Your talking about a few lines of JavaScript in the scheme of things (1,000's of lines already there from Microsoft) generally would not be noticeable to other users.
Forgive my ignorance, but would this JS be put into a web resource for the Contact entity? Would it slow things down in other apps if it's always checking what app is being used and if it's in a create mode?
I've always been told that JS is a last resort. Is this a safe use of it or should this be avoided?
How about setting a security role on a form?
For the App, only include the specific form and not multiple forms.
One possible way, create a specific form for the App, in the onload add JavaScript to check the Form Type "formContext.ui.getFormType()" this will tell you if the form is in create, edit, readonly etc mode - codes are at the link following. If 'create' put a Dialog (e.g. openConfirmDialog or openErrorDialog) up and on close of the dialog perform a formContext.ui.close();
docs.microsoft.com/.../getformtype
You can also do things such as check the App being used
Hello,
You can force a specific entity form to be opened in javascript.
Check the following link for more details: docs.microsoft.com/.../openform
André Arnaud de Cal... 291,759 Super User 2024 Season 2
Martin Dráb 230,468 Most Valuable Professional
nmaenpaa 101,156