Controlling Tabs with the Client Side API

1 minute read time.

One of the common requirements that I hear during my conversations with partners and customers who are implementing Sage CRM is that at different points within a workflow or business process the organisation may need to make a user concentrate on only certain options that are most relevant at the time for that business process.

An example rule I was given was that when the Opportunity reaches a certain workflow step then the ability to enter new notes or even upload documents should be limited.

The new Client Side API makes this easy because it provides away of controlling tab options with the current screen.

In the image below the value of the opportunity stage field is 'Negotiating' and the 'Notes' and 'Documents' tabs are visible.

To make the Notes and Documents tab 'disappear' when the Opportunity Stage is 'Quoted' we can add the following code into the Custom Content box of the OpportunityDetailBox screen.

[code language="javascript"]


The hideTab() and showTab() methods work by allowing you to pass in the tab's translation information. You will need to use the caption family (normally 'Tabnames') and the caption code.

Note: The value of the opportunity stage is 'Quoted' the text of the field is 'Proposal Submitted'.

The tabs disappear when the Opportunity Stage is 'Quoted'.