CONQRSMGR Class Methods
In this section, the CONQRSMGR class methods are presented in alphabetical order.
Syntax
CleanOutputFile()
Description
Use this method to delete the connected query output file.
Note: This method is valid only for a connected query scheduled for running to a file—that is, when the run mode is equal to RunMode_Sched_File.
Parameters
None.
Returns
None.
Syntax
Close()
Description
Use this method to clean up connected query resources.
Parameters
None.
Returns
None.
Syntax
CopyDefn(target_UserID, target_ID)
Description
Use this method to copy the connected query definition to a new ID. The user's query access security is checked prior to the copy.
Parameters
Field or Control |
Definition |
---|---|
target_UserID |
Specifies the user ID of the owner of the new connected query as a string. An empty string indicates that the new connected query is public. |
target_ID |
Specifies the ID for the new connected query as a string. |
Returns
A Boolean value: True if the copy is successful, False otherwise.
Syntax
DeleteDefn()
Description
Use this method to delete the current connected query definition.
Parameters
None.
Returns
A Boolean value: True if the delete was successful, False otherwise.
Syntax
ExistsByName( ObjName)
Description
Use this method to for the existence of a connected query definition based on the specified definition name.
Parameters
Field or Control |
Definition |
---|---|
ObjName |
Specifies the connected query definition name as a string. |
Returns
A Boolean value: True if connected query definition exists, False otherwise.
Syntax
GetSampleXMLString(RowNum)
Description
Use this method to generate and return a sample XML string. Use this string with BI Publisher data sources based on a connected query.
Parameters
Field or Control |
Definition |
---|---|
RowNum |
Sets number of rows of sample data to generate for each member query. |
Returns
A string representing the sample XML data.
Syntax
Open(IsNew)
Description
Use this method to open a new or existing connected query definition.
This method should be called after a connected query object constructor. It initializes a new or existed connected query object.
Parameters
Field or Control |
Definition |
---|---|
IsNew |
Specifies as a Boolean value whether the connected query object represents a new connected query definition (True), or an existing definition (False). |
Returns
A Boolean value: True if the open was successful, False otherwise.
Syntax
ResetQueriesPrompt()
Description
Use this method after a user clicks Cancel in a query prompt dialog.
Parameters
None.
Returns
None.
Syntax
Run(Prompts, runProcessInfo)
Description
Use this method to run the connected query. The Run method is valid for the following run modes only:
RunMode_Prev — Referred to as preview mode.
RunMode_Sched_Web or RunMode_Sched_File — Referred to as scheduled mode.
If an error results, the Run method populates an error string with error details.
Preview Mode
In preview mode, the connected query is run immediately on the application sever. The output data is displayed in a separate browser window. In preview mode, the Prompts parameter is required; the runProcessInfo parameter must be set to Null. The Prompts parameter should be retrieved using the QueriesPromptsArray property. If this array length is greater than 0, this array must be populated.
Note: If both parameters are not null, the scheduling information is used to run the connected query by Process Scheduler.
Scheduled Mode
In scheduled mode, the connected query is run by Process Scheduler. In the case of RunMode_Sched_File, the output data is written to an XML file. In the case of RunMode_Sched_Web, the output data is accessible via a hyperlink in Process Monitor. In scheduled mode, the runProcessInfo parameter is required; the Prompts parameter should be set to Null.
Note: If both parameters are not null, the scheduling information is used to run the connected query by Process Scheduler.
Parameters
Field or Control |
Definition |
---|---|
Prompts |
Specifies the prompts for execution of the queries as an array of QUERYITEMPROMPT objects. This parameter should be set to null when running in scheduled mode. |
runProcessInfo |
Specifies the scheduling information for running the queries as a SCHED_INFO object. This parameter must be null when running in preview mode. |
Returns
A Boolean value: True if the connected query was run successfully, False otherwise.
Syntax
RunToWindow()
Description
Use this method to run a connected query in background mode. Similar to preview mode, running a connected query in background mode results in the output data being displayed in a separate browser window. However, in background mode, the connected query is run through Process Scheduler with a REN server. Running a connected query in this manner prevents blocking on the application server. While the report file is generated, the user can continue working with the PeopleSoft application and the application server environment.
To specify the scheduling information, prior to invoking the RunToWindow method, you must invoke the SetRunControlData method as follows:
&res = &objConQrsInst.SetRunControlData(&objConQrsInst.Const.RunCntlId_Auto, False);
The RunToWindow method is valid for the RunMode_Window run mode only.
Parameters
None.
Returns
The process ID as a number.
Syntax
RunToXMLFormattedString(Prompts)
Description
Use this method to run the connected query immediately on the application server with output to an XML formatted string instead of an XML file.
The RunToXMLFormattedString method is valid for the RunMode_XMLFormattedString run mode only.
Parameters
Field or Control |
Definition |
---|---|
Prompts |
Specifies the prompts for execution of the queries as an array of QUERYITEMPROMPT objects. This parameter should be retrieved using the QueriesPromptsArray property. If this array length is greater than 0, this array must be populated. |
Returns
The formatted XML as a string.
Syntax
Save()
Description
Use this method to save the connected query object to the database as a connected query definition. If the connected query does not pass validation, it is saved with an inactive status.
Parameters
None.
Returns
A Boolean value: True if the save was successful, False otherwise.
Syntax
SaveRunControlParms(runCntlID)
Description
Use this method to save the in-memory process request parameter array to the database. This method is also called internally from the SetRunControlData method when IsChangeDB is true.
Parameters
Field or Control |
Definition |
---|---|
runCntlID |
Specifies the run control ID as a string. |
Returns
A Boolean value: True if the save was successful, False otherwise.
Syntax
SetRunControlData(runCntlID, IsNewCtrl, IsChangeDB)
Description
Use this as an interactive method to prompt the user if member queries have prompts. This method saves prompt data to the database using the PSCONQRSRUNPRM or PSCONQRSRUNPRMX records if the IsChangeDB parameter is passed as true. Call this method prior to scheduling a connected query to run in scheduled mode.
Parameters
Field or Control |
Definition |
---|---|
runCntlID |
Specifies the run control ID as a string. |
IsNewCtrl |
Specifies as a Boolean value whether the run control is new. |
IsChangeDB |
Specifies as a Boolean value whether to write the run control information to the database. |
Returns
A Boolean value: True if the run control parameters were set successfully, False otherwise.
Syntax
Validate()
Description
Use this method to validate the following:
The existence of each query used in the connected query.
Whether mapped fields used in the connected query object are still part of the QueryOutputFields collection for each query.
The user security access for each query.
If validation fails, Validate populates an error string with the error details.
Parameters
None.
Returns
A Boolean value: True if the connected query passes all the validation checks, False otherwise.
Syntax
ValidateIfFieldsMapped()
Description
Use this method to check whether all queries have mapped fields. Use this method to confirm that it is the report developer's intention to have unmapped fields in the queries.
If validation fails, ValidateIfFieldsMapped populates an error string with the names of the unlinked queries.
Parameters
None.
Returns
A Boolean value: True if all the queries have mapped fields, False otherwise.
Syntax
ValidateRunControlParms(runCntlID)
Description
Use this method to determine whether sufficient populated records exist in the or PSCONQRSRUNPRMX tables for the specified run control ID. ValidateRunControlParms compares the number of entries in the parameter tables with the number of prompts required for the connected query.
If validation fails, ValidateRunControlParms populates an error string with the error details.
Parameters
Field or Control |
Definition |
---|---|
runCntlID |
Specifies the run control ID as a string. |
Returns
A Boolean value: True if the validation is successful, False otherwise.