We have requirement to save first tab of crm form before going into next tab without using business process flow.
We have requirement to save first tab of crm form before going into next tab without using business process flow.
U can show hide different tabs as per your requirement. else you can add multiple sections on the same tab and then you can show hide it....
Thank you,
Amit Katariya
This is perfect, but my problem is our client don't want to have business process flow in our app.
We have few nested business rules which are depends on other tab's data, and we have few plugins too. I am not sure how everything will fit in JavaScript.
We have nested business rules, and plugins which runs depends on tab [A],[B] and few related entity.
Hi,
You can refer to the following JavaScript code.
var Acc = {}; Acc.formEvents = { form_load: function (e) { var fc = e.getFormContext(); // use the below code to remove a registered event handler. //fc.data.process.removeOnPreStageChange(Acc.formEvents.handlePreStage); fc.data.process.addOnPreStageChange(Acc.formEvents.handlePreStage); }, handlePreStage: function (e) { // debugger; // get the event arguments var bpfArgs = e.getEventArgs(); var ageValue= e.getFormContext().getAttribute("crd9d33_age").getValue() if (bpfArgs.getDirection() === "Next" && ageValue==null) { // only next stage movement is allowed. You can stop it depending on custom business logic as well // stop the stage movement bpfArgs.preventDefault(); alertStrings = { confirmButtonLabel: "OK", text: "Next stage movement is not allowed", title: "Sample title" }; alertOptions = { height: 120, width: 260 }; Xrm.Navigation.openAlertDialog(alertStrings, alertOptions); return; } // you can also play with the other properties of eventargs // get the stage - bpfArgs.getStage(); // get the steps - bpfArgs.getStage().getSteps(); } };
Add On-Load event to the form.
In my test, the prompt box will pop up if the age field is not filled in and will prevent you to move on to the next stage.
Hi,
By default hide second tab from the form editor.
Now add javascript code on onsave event handler to check if first tab data is entered then show second tab.
Hi Poonam,
You can add on-change events on the tabs and loop through to check the required fields. If the value is not provided for the field then restrict the user to navigate to next tab.
André Arnaud de Cal...
292,187
Super User 2025 Season 1
Martin Dráb
230,966
Most Valuable Professional
nmaenpaa
101,156