User Level
Business Administrators can create new inquiry objects if they have the Inquiry administrative access.
User LevelBusiness Administrators can create new inquiry objects if they have the Inquiry administrative access. SyntaxThe command uses this syntax.
Add InquiryTo define an inquiry from within MQL use the Add Inquiry command. Syntax
The Add Inquiry clauses are:
Pattern ClauseJPOs are another option in addition to inquiries that can be used for building table IDs. In some cases a JPO should be used in place of an inquiry because of inquiry limitations. Multi-value selectables or relationship based selectables should not be used with inquiries since they might not produce a consistent pattern. JPOs should be used in this case because they do not parse and don’t require you to match an explicit pattern. Only attributes and basics should be used with inquiries. This clause indicates the expected pattern of the results of the evaluated code, and shows how the output should be parsed. It sets the desired field to an RPE variable or macro. Since inquiries are designed to produce a list of business objects, generally the macro that is set is OID. When you execute a temp query in MQL, the business objects found are returned in a list that includes the type, name and revision, as well as any selectable information specified. For more information, see Temporary Query. For example, the following code: temp query bus Part * * select id dump; would return a list like: Part,PT-6170-01,1,21762.30027.65182.63525 Part,PT-6180-01,1,21762.30027.50161.30295 Part,PT-6190-01,1,21762.30027.56625.19298 Part,PT-6200-01,1,21762.30027.37094.65388 To indicate that there are four fields that will be returned, delimited with a comma, and the last field is the OID, you would use the following pattern: *,*,*,${OID} For an expand bus Person "Test Buyer" - from relationship "Assigned Buyer" select businessobject id dump |; 1|Assigned Buyer|to|Buyer Desk|Buy 001|-|37819.19807.45300.63521 To parse this output, you need to indicate that the first six fields, delimited by “|”, should be ignored, and the seventh field is the OID. You would use: *|*|*|*|*|*|${OID} For more information, see Expand Business Object. Format ClauseThis clause defines what part of the output results should be saved in the inquiry’s list. It references variables or macros specified in the Pattern, and can include delimiters. The syntax is:
For example:
Code ClauseThis clause Code clause of the Add Inquiry command is used to provide the code to be evaluated to produce a list of one or more business objects. The syntax is:
The code provided is generally an MQL
temp query bus "Package" * * where "('Project'==to[Vaulted Documents Rev2].businessobject.to[Workspace Vaults] .businessobject.type) && ('${USER}'==to[Vaulted Documents Rev2].businessobject.to[Workspace Vaults] .businessobject.from[Project Members].businessobject.to[Project Membership].businessobject.name)" select id dump |; When macros are included in the code (${USER} in example above), they should be surrounded by single or double quotes, in case the substitution contains a space. Quotes around both the macro in the code and the Argument when it contains a space ensures that the macro substitution is handled correctly. File ClauseThis clause does not need to be included in the Add Inquiry command itself. It can be written in an external editor. The syntax is:
Argument ClauseThis clause is used to provide any input arguments that the inquiry might need. Arguments are name/value pairs that can be added to an Inquiry as necessary to be used by the inquiry code. Depending upon how you write the code in both the Inquiry and the JSP, you might or might not use arguments. The syntax is:
Quotes around both the macro in the code and the Argument when it contains a space ensures that the macro substitution is handled correctly. History Clause The
Copy InquiryAfter an inquiry is defined, you can clone the definition with the Copy Inquiry command. Cloning a inquiry definition requires Business Administrator privileges, except that you can copy a inquiry definition to your own context from a group, role or association in which you are defined. SyntaxThis command lets you duplicate defining clauses with the option to change the value of clause arguments:
History Clause The
Modify InquiryThe List Inquiry command displays a list of all inquiries that are currently defined. It is useful in confirming the existence or exact name of an inquiry that you want to modify, since it is case-sensitive.
For more information, see List Admintype Command. Use the list of all the existing inquiries along with the
Use the Modify Inquiry command to add or remove defining clauses and change the value of clause arguments:
Each modification clause is related to the arguments that define the inquiry. To change the value of one of the defining clauses or add a new one, use the Modify clause that corresponds to the desired change. When modifying an inquiry, you can make the changes from a script or while working interactively with MQL.
Evaluate InquiryYou can evaluate the Inquiry to determine if it will parse the output as you have
designed the JSP to expect to receive it. Use the To override any specified Arguments, or include input that the inquiry might otherwise receive from the JSP, enter name/value pairs. Include only a space between multiple inputs, using quotes around values that contain spaces. The syntax is:
Delete InquiryIf an inquiry is no longer required, you can delete it using the Delete Inquiry command.
Searches the list of defined inquiries. If the name is found, that inquiry is deleted. If the name is not found, an error message is displayed. For example, to delete the inquiry named “sub-assembly parts,” enter the following:
After this command is processed, the inquiry is deleted and you receive an MQL prompt for another command. |