title | description | author | ms.author | ms.date | ms.reviewer | ms.topic | applies_to | search.audienceType | contributors | ||
---|---|---|---|---|---|---|---|---|---|---|---|
getNavigationBehavior (Client API reference) in model-driven apps| MicrosoftDocs |
Returns a navigation behavior object for stage that can be used to define whether the create button is available for users. |
HemantGaur |
hemantg |
03/12/2022 |
jdaly |
reference |
Dynamics 365 (online) |
|
|
[!INCLUDE./includes/getNavigationBehavior-description.md]
Note
This method is available only for Unified Interface.
stageObj.getNavigationBehavior().allowCreateNew = function () {
return true|false;
}
[!INCLUDEcc-terminology]
Type: Object
Description: An object with the allowCreateNew
property that lets you define whether the Create button will be available in a stage so that user can create an instance of tableB from the tableA form in a cross-table business process flow navigation scenario.
For example, here is the Create button in the Develop stage of the AccountToContactProcess sample business process flow that lets you create a Contact record from the Account form.
The allowCreateNew
property will return undefined for business process flow records that do not implement cross-table navigation.
The following sample code shows how you can hide or display the Create button for an active stage of a business process flow depending on its name.
function sampleFunction(executionContext) {
var formContext = executionContext.getFormContext();
formContext.data.process.getActiveStage().getNavigationBehavior().allowCreateNew = function () {
if (formContext.data.process.getName() === 'Test Process') {
return false; // Create button is not available
}
else {
return true; // Create button is available
}
}
}
[!INCLUDEfooter-include]