A new way to post requests to PBS XML Interface

April 11, 2007

In the past when posting a request to PBS XML Interface, we need to do the tedious work of building the xml string for it. As the PBS XML Reference comes with the xsd files, we can make our life easier by generating classes from those xsd files and use it in object oriented way. This approach is much elegant and easy to use than concatenating string.

Please download the full article here:

A New Way to Post Requests.doc

Advertisements

How to reset Pivotal License Info

April 11, 2007

You need to run this script to totally reset all the license information from your Pivotal BM or ED.

use <your_bm_or_ed>
go
 
update users set lkey = null

update rsys_system_flags
set rn_value = null
where rn_flag like 'plm%'

update rsys_system_flags
set rn_value = NEWID()
where rn_flag = 'MasterSourceDatabaseId'

update rsys_system_flags
set rn_value = NEWID()
where rn_flag = 'DatabaseId'

Worry free "stop" statement

April 11, 2007

When working on a Pivotal Client Script, we often add the “stop” statement to launch the script debugger and then remove it from the release version. Most of the time we forget to do it, right?

Fortunately, Pivotal has a feature to turn on the debug flag (UIMaster.DbgFlag) by adding &debug at the end of the url to launch Active Access as below:

http://localhost/epower/rdaui.htm?cms59&http://localhost&debug

I found this flag is very useful when it is combined with our favorite “stop”statement.

If DbgFlag Then Stop

We can just leave the code on the release version and it won’t be executed unless we add the &debug at the end.

Using Non-default Search Result List

April 11, 2007

Since Version 5.0 Pivotal allows us to use non default search result list to display results from an active search.

Although it is very straight forward deal, we still need to pay a little bit attention to the SearchSource parameter that is expected by UseSearchResultsList function. It expects Business Object Internal Name instead of table name and Business Object has to be made visible.

Sub ShowNonDefaultSearchResult(strBusinessObject, _
                                strSearchName, _ 
                                strSearchResultName)
 
    Const strSEARCH_TYPE = "search"
 
    Dim objSearchFactory 
    Set objSearchFactory = _ 
        UIMaster.CreateCenterReference(strSEARCH_TYPE)
 
    objSearchFactory.SearchType = searchTypeRegular   
 
    objSearchFactory.Options.UseSearchResultsList _ 
        strBusinessObject, strSearchResultName
 
    Set objSearchFactory.Search = _ 
        UIMaster.RSysClient.GetSearch(strSearchName)
 
    objSearchFactory.Options.AutoRun = True
    objSearchFactory.UsePlatformButtons = True  
    objSearchFactory.Parameters(0) = _ 
        UIMaster.RUICenter.RecordId
    UIMaster.ShowMultiSelectModal objSearchFactory, Null
End Sub

How to get Pivotal Connection String

April 11, 2007

The C# code below shows us on how to build the trusted connection string from the registry stored by Pivotal.

using Microsoft.Win32;

 

private string GetConStringByPivotalSystem(string systemName)

{

    string pivotalKey =

            “Software\\Pivotal\\Relationship\\Connections\\”

            + systemName;

    string odbcKey = “SOFTWARE\\ODBC\\ODBC.INI\\”;

    string sODBC;

    string serverName;

    string dbName;

 

    RegistryKey key =

       Registry.LocalMachine.OpenSubKey(pivotalKey, true);

 

    sODBC = Convert.ToString(key.GetValue(“User Data”));

 

    odbcKey = odbcKey + sODBC;

    key = Registry.LocalMachine.OpenSubKey(odbcKey, true);

    serverName = Convert.ToString(key.GetValue(“Server”));

    dbName = Convert.ToString(key.GetValue(“Database”));

    return “Data Source=” +

                serverName + “;Initial Catalog=” +

                dbName + “;Integrated Security=SSPI;”;

}

How to add version number to Pivotal BM?

April 10, 2007

During Pivotal Development often we need to be able to track which version the users/testers are running against. Below is the sample client script code to show the version number. The version number itself stored as a global variable. Please note that you need to make the client script as global script.

    1 Dim strVersion                              

    2 Dim objNewCell

    3 

    4 strVersion = “5.9.1.1”

    5 

    6 Set objNewCell = _

    7     UIMaster.documentMenu._

    8     getElementsByTagName(“TABLE”)(0). _

    9     insertRow(1).insertCell(0)

   10 

   11 objNewCell.className = “FindTitleCell”

   12 objNewCell.innerText = “BM Version: “ + strVersion