Steps to add a progress bar
This example adds a progress bar that illustrates Opportunity Certainty for the current opportunity. You can view the complete code in Steps to add a progress bar.
Step 1: Create a custom ASP file
Add the following code to the file:
- Get the current Opportunity Certainty ID and store it in a variable:Copy
var progress=CRM.GetContextInfo('opportunity','oppo_certainty');
- Get a graphic block and store it in a variable:Copy
var progressbar=CRM.GetBlock('graphic');
- Define the dimensions and style of the progress bar.
For example:Copywith (progressbar)
{
ImageWidth=100;
ImageHeight=20;
Description='Opportunity Certainty';
GradientFill('Blue','White','L',256);
MoveTo(0,0);
LineTo(99,0);
LineTo(99,19);
LineTo(0,19);
LineTo(0,0);
Rectangle(0,0,100,20);
TextOut(40,1,progress+'%',true);
} - Show the progress bar on the screen by executing the graphic block:Copy
CRM.AddContent(progressbar.Execute());
Response.Write(CRM.GetPage());
Step 2: Add a new tab and link it to your ASP file
- In Sage CRM, go to <My Profile> | Administration | Customization.
- Click Company, and then click Tabs.
- In the Tab Group Name column, click Company.
- Under Properties, use the following options:
- Caption. Enter the new tab name.
- Action. Select customfile.
- Custom File. Enter the name of the custom ASP file you created in Step 1: Create a custom ASP file.
- Click Update, and then click Save.
To view the results, go to an Opportunity record and click the new tab you created.