Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

project workspace

kamleshdhak
Tera Contributor

When I open an existing project from the list view in Project Workspace, it opens in the Planning tab by default. I want it to open directly in the Details tab instead. Could you please guide me on how to change this behavior?

1 REPLY 1

HarishKumar6668
Tera Guru

Hi @kamleshdhak ,

The default tab behaviour is controlled by the ProjectWorkspaceHelperSNC (SysId:32a5920243a311101326810d0bb8f287)S cript Include, specifically the getPlannerSubPageItems() method.
This method returns the available tabs along with the default tab.

getPlannerSubPageItems(projectId, sysClassName) {
		const plannerSubPageItems = [];
		const planningItem = {
			id: "planning",
			label: gs.getMessage("Planning"),
			route: "planning",
			icon: "Roadmap Fill",
			order: 1,
			actionable: true,
			isTableMandatoryParam: true, //We will set table param during navigation automatically
			isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
			isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
			forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
			fields: { //Mention route params here other than table sysId and timeStamp
			},
			params: {
				pageName: "planning"
			}
		};
		plannerSubPageItems.push(planningItem);

		const hasPPMFinanceReadRole = gs.getUser().hasRole('sn_ppm_finance_read');
		const hasProjectManagerRole = gs.getUser().hasRole('project_manager');
		const hasProgramManagerRole = gs.getUser().hasRole('program_manager');
		if (hasPPMFinanceReadRole || hasProjectManagerRole || hasProgramManagerRole) {
			const finacilasItem = {
				id: "financials",
				label: gs.getMessage("Financials"),
				route: "pw-financials",
				icon: "Chart Control Fill",
				order: 3,
				actionable: true,
				isTableMandatoryParam: true, //We will set table param during navigation automatically
				isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
				isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
				forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
				fields: { //Mention route params here other than table sysId and timeStamp
				},
				params: {
					pageName: "financials"
				}
			};
			plannerSubPageItems.push(finacilasItem);
		}

		const ridacItem = {
			id: "ridac-monitor",
			label: gs.getMessage("RIDAC"),
			route: "ridac-monitor",
			icon: "Table Fill",
			order: 4,
			actionable: true,
			isTableMandatoryParam: true, //We will set table param during navigation automatically
			isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
			isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
			forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
			fields: { //Mention route params here other than table sysId and timeStamp
			},
			params: {
				pageName: "ridac-monitor"
			}
		};
		plannerSubPageItems.push(ridacItem);

		const detailsPage = { //record page
			id: "details",
			label: gs.getMessage("Details"),
			route: "record",
			icon: "Form fill",
			order: 2,
			actionable: true,
			isTableMandatoryParam: true, //We will set table param during navigation automatically
			isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
			isTimeStampMandatoryParam: false, //We will set timeStamp param during navigation automatically
			forceRefreshOnNavigation: false, //On every navigation, we will update the timeStamp automatically.
			fields: { //Mention route params here other than table sysId and timeStamp
			},
			params: {
				pageName: "details",
				timeStamp: Date.now() //handling details page differently as we are using same screen of record page
			}
		};
		plannerSubPageItems.push(detailsPage);

		const analyticsPage = { //analytics page
            id: "analytics",
            label: gs.getMessage("Analytics"),
            route: "analytics",
            icon: "analytics-center-outline",
            order: 5,
            actionable: true,
            isTableMandatoryParam: true, //We will set table param during navigation automatically
            isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
            isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
            forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
            fields: { //Mention route params here other than table sysId and timeStamp
            },
            params: {
                pageName: "analytics"
            }
        };
        plannerSubPageItems.push(analyticsPage);

		const docsPage = {
            id: "docs",
            label: gs.getMessage("Docs"),
            route: "docs",
            icon: "Form fill",
            order: 6,
            actionable: true,
            isTableMandatoryParam: true, //We will set table param during navigation automatically
            isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
            isTimeStampMandatoryParam: false, //We will set timeStamp param during navigation automatically
            forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
            fields: { //Mention route params here other than table sysId and timeStamp
            },
            params: {
                pageName: "docs"
            }
        };
        plannerSubPageItems.push(docsPage);

        const statusReportPage = { //status report page
            id: "status-report",
            label: gs.getMessage("Status Reports"),
            route: "status-report",
            icon: "heartbeat-outline",
            order: 7,
            actionable: true,
            isTableMandatoryParam: true, //We will set table param during navigation automatically
            isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
            isTimeStampMandatoryParam: false, //We will set timeStamp param during navigation automatically
            forceRefreshOnNavigation: false, //On every navigation, we will update the timeStamp automatically.
            fields: { //Mention route params here other than table sysId and timeStamp
            },
            params: {
                pageName: "status-report"
            }
        };
        plannerSubPageItems.push(statusReportPage);

		plannerSubPageItems.sort((a,b) => a.order - b.order);
		return {
			plannerSubPageItems,
			defaultPage: planningItem
		};
	},

The OOB Script Include is non-editable, so I would recommend overriding the getPlannerSubPageItems() method in the ProjectWorkspaceHelper (sysId:b6d28b42432711101326810d0bb8f2cf) Script Include as shown in the below script.

var ProjectWorkspaceHelper = Class.create();
ProjectWorkspaceHelper.prototype = Object.extendsObject(ProjectWorkspaceHelperSNC, {

	getPlannerSubPageItems(projectId, sysClassName) {
		const plannerSubPageItems = [];
		const planningItem = {
			id: "planning",
			label: gs.getMessage("Planning"),
			route: "planning",
			icon: "Roadmap Fill",
			order: 1,
			actionable: true,
			isTableMandatoryParam: true, //We will set table param during navigation automatically
			isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
			isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
			forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
			fields: { //Mention route params here other than table sysId and timeStamp
			},
			params: {
				pageName: "planning"
			}
		};
		plannerSubPageItems.push(planningItem);

		const hasPPMFinanceReadRole = gs.getUser().hasRole('sn_ppm_finance_read');
		const hasProjectManagerRole = gs.getUser().hasRole('project_manager');
		const hasProgramManagerRole = gs.getUser().hasRole('program_manager');
		if (hasPPMFinanceReadRole || hasProjectManagerRole || hasProgramManagerRole) {
			const finacilasItem = {
				id: "financials",
				label: gs.getMessage("Financials"),
				route: "pw-financials",
				icon: "Chart Control Fill",
				order: 3,
				actionable: true,
				isTableMandatoryParam: true, //We will set table param during navigation automatically
				isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
				isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
				forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
				fields: { //Mention route params here other than table sysId and timeStamp
				},
				params: {
					pageName: "financials"
				}
			};
			plannerSubPageItems.push(finacilasItem);
		}

		const ridacItem = {
			id: "ridac-monitor",
			label: gs.getMessage("RIDAC"),
			route: "ridac-monitor",
			icon: "Table Fill",
			order: 4,
			actionable: true,
			isTableMandatoryParam: true, //We will set table param during navigation automatically
			isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
			isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
			forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
			fields: { //Mention route params here other than table sysId and timeStamp
			},
			params: {
				pageName: "ridac-monitor"
			}
		};
		plannerSubPageItems.push(ridacItem);

		const detailsPage = { //record page
			id: "details",
			label: gs.getMessage("Details"),
			route: "record",
			icon: "Form fill",
			order: 2,
			actionable: true,
			isTableMandatoryParam: true, //We will set table param during navigation automatically
			isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
			isTimeStampMandatoryParam: false, //We will set timeStamp param during navigation automatically
			forceRefreshOnNavigation: false, //On every navigation, we will update the timeStamp automatically.
			fields: { //Mention route params here other than table sysId and timeStamp
			},
			params: {
				pageName: "details",
				timeStamp: Date.now() //handling details page differently as we are using same screen of record page
			}
		};
		plannerSubPageItems.push(detailsPage);

		const analyticsPage = { //analytics page
            id: "analytics",
            label: gs.getMessage("Analytics"),
            route: "analytics",
            icon: "analytics-center-outline",
            order: 5,
            actionable: true,
            isTableMandatoryParam: true, //We will set table param during navigation automatically
            isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
            isTimeStampMandatoryParam: true, //We will set timeStamp param during navigation automatically
            forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
            fields: { //Mention route params here other than table sysId and timeStamp
            },
            params: {
                pageName: "analytics"
            }
        };
        plannerSubPageItems.push(analyticsPage);

		const docsPage = {
            id: "docs",
            label: gs.getMessage("Docs"),
            route: "docs",
            icon: "Form fill",
            order: 6,
            actionable: true,
            isTableMandatoryParam: true, //We will set table param during navigation automatically
            isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
            isTimeStampMandatoryParam: false, //We will set timeStamp param during navigation automatically
            forceRefreshOnNavigation: true, //On every navigation, we will update the timeStamp automatically.
            fields: { //Mention route params here other than table sysId and timeStamp
            },
            params: {
                pageName: "docs"
            }
        };
        plannerSubPageItems.push(docsPage);

        const statusReportPage = { //status report page
            id: "status-report",
            label: gs.getMessage("Status Reports"),
            route: "status-report",
            icon: "heartbeat-outline",
            order: 7,
            actionable: true,
            isTableMandatoryParam: true, //We will set table param during navigation automatically
            isSysIdMandatoryParam: true, //We will set sysId param during navigation automatically
            isTimeStampMandatoryParam: false, //We will set timeStamp param during navigation automatically
            forceRefreshOnNavigation: false, //On every navigation, we will update the timeStamp automatically.
            fields: { //Mention route params here other than table sysId and timeStamp
            },
            params: {
                pageName: "status-report"
            }
        };
        plannerSubPageItems.push(statusReportPage);

		plannerSubPageItems.sort((a,b) => a.order - b.order);
		return {
			plannerSubPageItems,
			defaultPage: detailsPage
		};
	},

    type: 'ProjectWorkspaceHelper'
});

I have just modified the default page in the overridden method .

return {
			plannerSubPageItems,
			defaultPage: detailsPage
		};

With this change, the Details tab will be opened by default when accessing the Project Workspace.

If required, you can also modify the order values to change the sequence in which the tabs are displayed.

 

Note: The script shown above does not include some additional tabs, such as Playbook, AI Identified Risks, etc. because it is in PDI.

If you find this information useful, please mark it as Helpful and Accept the Solution.

Regards,
Harish