How do you add a column to the Allocation workbench?

ChristineP
Mega Expert

We have created two new calculated fields on the Resource Plan Table and would like to add these to the Resource Allocation workbench.  According to ServiceNow HI Portal we can do this?  Does anyone have any insight on how to go about adding columns to the Workbench?

9 REPLIES 9

Manoj6
Tera Expert

 We can add custom column to Allocation workbench. 

There is a script include named 'ResourceGridCustomMetadata' in which you can add columns to it. (You can look at 'ResourceGridSeededMetadata' script include OOB and use it as a reference to add columns in 'ResourceGridCustomMetadata'.). See the example below

If you want to add the column to make it available in your highlighted area then you need to add a line for "LEFT_GROUPED_COLUMNS" .

Lets say i have created a Reference Field , field "Audit Engagement" and i want to add in then : 

ResourceGridCustomMetadata.LEFT_GROUPED_COLUMNS = [{ Audit_Engagement: { column: 'u_audit_engagement', snDataType: 'reference', valueGetter: 'labelGetter', headerName: gs.getMessage('Audit Engagement') ,columnGroupShow: 'open' } }];

 Please mark answer helpful if this helped you. 

But I think its still just read only, isn't it?

Manoj6
Tera Expert

@Robert Fedoruk  No it wont be. The new column you add will be editable. The reason "Resource Name" is non-editable is in script include "ResourceGridSeededMetadata" , it has been made disable. You can make Resource Name editable by making "snDisableConfig: false". 

 

Refer the below code : (line number 15 in ResourceGridSeededMetadata to be precise)

{ name: { headerName: gs.getMessage(' Resource name'), showRowGroup: true, cellRenderer: 'agGroupCellRenderer' , cellClassRules: 'nameClassRules', snDisableConfig: true} },

 

Mark helpful if this helped you.

Thanks.

Hello,

Is it possible to pull the demand/project number in using the script include "ResourceGridSeededMetadata" ?

Thanks, Kathryn

44sharan
Mega Contributor

Is it possible to add multiple columns? When i tried adding multiple columns for example if i add resource type and cost type, whichever column i have written in my code last will be visible on the allocation workbench. So its adding only single column that is the latest one which is been added to the code.

ResourceGridCustomMetadata.LEFT_GROUPED_COLUMNS = [{ u_cost_type: { column: 'u_cost_type', snDataType: 'reference', valueGetter: 'labelGetter', headerName: gs.getMessage('Cost type') ,columnGroupShow: 'open' } }];

ResourceGridCustomMetadata.LEFT_GROUPED_COLUMNS = [{ u_code_block: { column: 'u_code_block', snDataType: 'string', valueGetter: 'labelGetter', headerName: gs.getMessage('Codeblock') ,columnGroupShow: 'open' } }];

I have added these two lines in my code. However in the workbench only "Codeblock" is visible