mardi 13 mars 2007

Active Searches with parameters

Detail
Is there any sample code available that can be used in an App Server Rule, to get a recordset from an Active Search. The search will have parameters, some of them optional.

Resolution
The following simple example shows how to run a search in AppServerRules.

Dim objSearchCriteria As IRSearchCriteria4
Dim objSearch As IRSearch3
Dim rstResult As ADODB.Recordset
Dim vntCompanyId As Variant

vntCompanyId = mrdaSystem.StringToId("0x00000000000001C2")

Set objSearch = mrdaSystem.Searches("Opportunities with Company ? and Status")
Set objSearchCriteria = objSearch.CreateSearchCriteria
With objSearchCriteria
.Parameter = vntCompanyId
.Parameter = "In Progress"
Set rstResult = .LoadSearchResults
End With

The link below has additional information on how to write AppServer Rules
http://eservice.pivotal.com/Pivotal/Docs/690_Customization_r51_TK.pdf

Aucun commentaire: