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:

  1. Get the current Opportunity Certainty ID and store it in a variable:
    Copy
    var progress=CRM.GetContextInfo('opportunity','oppo_certainty');
  2. Get a graphic block and store it in a variable:
    Copy
    var progressbar=CRM.GetBlock('graphic');
  3. Define the dimensions and style of the progress bar.
    For example:
    Copy
    with (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);
    }
  4. 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

  1. In Sage CRM, go to <My Profile> | Administration | Customization.
  2. Click Company, and then click Tabs.
  3. In the Tab Group Name column, click Company.
  4. Under Properties, use the following options:
  5. Click Update, and then click Save.

To view the results, go to an Opportunity record and click the new tab you created.