Archive for the ‘Pivotal Rich Client’ Category
May 12, 2008
This is the sample code on how to default the Global Search to certain Business Object such as Companies.
'***************************************************
' Name: OnPortalLoaded
' -> Default the Global Search to "Companies" BO
'***************************************************
Sub OnPortalLoaded(ParameterList)
Dim objInput
Set objInput = UIMaster.documentMenu. _
body.getElementsByTagName("INPUT")
objInput(0).Value = "Companies"
....
....
....
End Sub
'***************************************************
' Name: OnGlobalQuickSearchLoaded
' -> Handle the Companies Global Search to run
' Company Quick Search
'***************************************************
Function OnGlobalQuickSearchLoaded(vntParameters)
Dim objInput
Dim strSearchText
Dim objSearchFactory
On Error Resume Next
Set objInput = UIMaster.documentMenu._
body.getElementsByTagName("INPUT")
If objInput(0).Value = "Companies" Then
strSearchText = objInput(1).Value
Set objSearchFactory = _
UIMaster.CreateCenterReference("quicksearch")
With objSearchFactory
.SearchType = 1 'A non-global quick search.
Set .Table = _
UIMaster.RSysClient.GetTable("Company")
.SearchText = strSearchText
End With
UIMaster.ShowCenterReference _
actionAskUser, objSearchFactory, Null
End If
OnGlobalQuickSearchLoaded = True
End Function
Posted in Client Script, Pivotal Rich Client | 1 Comment »
October 20, 2007
'**********************************************
' Name : ChangeTabTitle
' Purpose : Use DHTML to Change the Tab Title
'**********************************************
Sub ChangeTabTitle(sTabName, sNewTabTitle)
Dim sTabId
sTabId = "Tab_" + _
CStr((UIMaster.RUICenter.Form.Tabs(sTabName). _
Ordinal - 2))
UIMaster.documentCenter. _
GetElementById(sTabId).innerText = sNewTabTitle
End Sub
Posted in Client Script, Pivotal Rich Client | Leave a Comment »
September 10, 2007
IRRecordset2 rstDeleted;
rstDeleted = (IRRecordset2) pForm.SecondaryFromVariantArray(
Recordsets, “Assistants”);
foreach (object deletedId in rstDeleted.DeletedRecordIds)
{
//Do Something with your id here
}
Posted in Appserver Rule, Pivotal Rich Client | Leave a Comment »
September 10, 2007
'**********************************************************************
' Name : HideForeignFieldEx
' Purpose : To Hide FK Field using DHTML
'**********************************************************************
' Inputs:
' sTabName : tab name
' sSegmentName : segment name
' sFieldName : field name
' Returns:
' N/A
'**********************************************************************
Sub HideForeignFieldEx(sTabName, sSegmentName, sFieldName)
Dim oField
Set oField = UIMaster.RUICenter.GetForeignFieldEx(sTabName, _
sSegmentName, sFieldName)
Dim oTDs
Dim oTD
'Hide the label
UIMaster.RUICenter.GetFieldLabelEx(sTabName, _
sSegmentName, sFieldName).style.display = "none"
'Hide the Input
oField.InputElement.style.display = "none"
Set oTDs = oField.ParentElement.GetElementsByTagName("TD")
For Each oTD In oTDs
oTD.style.display = "none"
Next
End Sub
Posted in Client Script, Pivotal Rich Client | Leave a Comment »
August 20, 2007
Below is the function to hide business object from the left hand menu.
'**********************************************
' Name: HideBusinessObject
' Purpose: To Hide Business Object
' from Left Hand Navigation
' Info: To be called from OnMainWindowOpen
'**********************************************
' 1.0 8/20/2007 JM
'**********************************************
Sub HideBusinessObject(strBusinessObjectName)
Dim objHTMLDoc
For Each objHTMLDoc in _
UIMaster.documentMenu.all
If objHTMLDoc.tagName = "DIV" _
and UCase(objHTMLDoc.title) = _
UCase(strBusinessObjectName) Then
objHTMLDoc.parentElement.parentElement. _
parentElement.parentElement. _
parentElement.parentElement. _
style.display="none"
End If
Next
End Sub
Posted in Client Script, Pivotal Rich Client | Leave a Comment »
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.
Posted in Client Script, Pivotal Rich Client | Leave a Comment »
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
Posted in Client Script, Pivotal Rich Client | Leave a Comment »
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;”;
}
Posted in Appserver Rule, Pivotal Rich Client | Leave a Comment »