Microsoft Dynamics 365/Dataverse has been a popular platform for businesses to manage their operations, customer relationship management, and financials. The platform provides various tools and features to help businesses streamline their processes, improve efficiency, and make data-driven decisions. One of the key features in Dynamics 365/Dataverse is the NavigateTo() method, which allows users to easily navigate to different areas of the platform, including records, forms, and pages.
Recently, Microsoft has made some enhancements to the
NavigateTo() method in Dynamics 365/Dataverse, making it even more powerful and
user-friendly. Here is some of the new enhancements to the NavigateTo() method
in Dynamics 365/Dataverse:
Improved Navigation: The
NavigateTo() method now provides a more streamlined navigation experience for
users, making it easier to access the areas of the platform they need. The new
navigation options allow users to jump to specific records, forms, or pages
with just a few clicks.
Better Performance: The
NavigateTo() method has been optimized to improve its performance, making it
faster and more responsive. This will make it easier for users to access the
information they need, reducing the time it takes to complete tasks and making
the platform more efficient.
Enhanced Customization: The
NavigateTo() method now supports customization options, allowing developers to
tailor the navigation experience to meet the specific needs of their
organization. This will allow businesses to create a more personalized
experience for their users, making it easier for them to access the information
they need.
Improved Security: The
NavigateTo() method has been enhanced to include improved security features,
making it even more secure. This will ensure that sensitive information is
protected and users can access only the information they need to complete their
tasks.
Use Case:
I want to determine which Business Process Flow should be
accessible by default when I open an entity record, and I also want to enlarge
the currently active stage.
In this example, I'm utilizing the Lead entity, which
has two Business Process Flows enabled for it, with Lead to Opportunity Sales BPF as the
default BPF.
When you create a business process flow in CRM, a new entity
with the name of the business process flow is created in the background. All
data pertaining to the business process flow is kept in this entity. In this
case, we would need the BPF Process Id, BPF instance Id, and Active Stage Id
values from the Business Process Flow entity fields to open the BPF records. I
am now utilizing the Dynamics 365 endpoint API to obtain the required value.
Below is the sample code that you can use to achieve this
function openRecordBPFUsingNavigateTo(){
let pageInput = {};
let navigationOptions = {};
try {
pageInput = {
pageType:"entityrecord",
entityName:"lead",
entityId:"Lead Record Id",
processId:"BPF Id",
processInstanceId:"BPF Instance Id",
isCrossEntityNavigate:true,
selectedStageId:"Stage Id"
}
navigationOptions= {
target:2,
height:{ value: 70, unit: "%" },
width:{ value: 60, unit: "%" },
position:1
};
Xrm.Navigation.navigateTo(pageInput,navigationOptions).then((success)=> {
//Code which you want to execute on success
},(error) => {
//Code which you want to execute error to handle on exception
});
} catch(error) {
//Code which you want to execute error to handle on exception
}
}
To know more about the attributes used, please follow
this link.