Retrieving TP values for Label Content object
Retrieving parameter (TP) values for the Label Content object is different
than for other objects. For objects other than Label Content, the field names are
determined by examining the values in the FsValidationField
table.
For the Label Content object, the field names change dynamically based
upon the source object. In addition, the list of Analysis Row Tags can be
customized by the user. Consequently, there are no rows in the
FsValidationField
table.
These examples describe the ObjProperty()
calls that retrieve parameter information when the object that the script is running
against is a Label Content object. The label content is associated with four other objects
types: Formula, Item, Specification and Analysis.
The syntax for the ObjProperty()
function
varies depending on the type of object that is associated with the label content. The
syntax is the same for Formula and Item objects that are associated with the label content.
These examples provide the syntax to use with the ObjProperty()
function to retrieve the value for a specific technical
parameter. In the case of Specification and Analysis, the function retrieves one of
multiple parameter values.
- Item or Formula
Formula and Item objects can only have one value for a technical parameter. Suppose the script has to access the value for the parameter
“CALCIUM”
and the target object is an Item or Formula. Then the code to ObjProperty is shown here.-
Dim tpVal As Object = ObjProperty(“PVALUE.TP”, “”, “”, “CALCIUM”, “PARAM_CODE”)
-
- Specification
The Specification object supports three parameter values. These are the Min, Target, and Max value. The call to the
ObjProperty
to retrieve the target value for theCALCIUM
technical parameter is:-
Dim tpTargetVal As Object = ObjProperty("PVALUE_TARGET.TP", "", "", "CALCIUM", "PARAM_CODE")
-
- Analysis
For the Analysis object, the call to ObjProperty to retrieve the Proposed value for the
CALCIUM
parameter is:-
Dim tpProposedVal as Object = ObjProperty("PVALUE_PROPOSED.TP", "", "", "CALCIUM", "PARAM_CODE")
-
Suppose you request a TP Value Type
that
is invalid for the given Label Content object. For example, you request the MIN value for a
Label Content object whose source is an Item. Or, you request a RowTag
that is not included in the LABELCONTENT.ROWTAGS profile attribute. Then, a
validation error code of -5008
is returned.
Examples of Label Content arrays
ObjProperty()
can be used to retrieve a
set (i.e., an array of values) from the label content’s target object. Retrieving all
the parameter values is not useful if the script cannot determine the parameter code
that is associated with the parameter value.
To retrieve the set of parameter codes and corresponding parameter values requires calling ObjProperty twice. First to get the set of parameter codes. Second to get the set of parameter values.
Object | Array Example |
---|---|
Item or Formula |
Dim pCodes() As Object =
ObjProperty("PARAMCODE.TP","","","*")
|
Specification |
Dim pCodes() As Object =
ObjProperty("PARAMCODE.TP","","","*")
|
Analysis |
Dim pCodes() As Object =
ObjProperty("PARAMCODE.TP","","","*")
|
- The array variable
pCodes()
contains the set of parameter codes. The first parameter that is passed toObjProperty
is“PARAMCODE.TP”
. The last parameter is“*”
indicating the request to return all parameter codes instead of a specific code. - The array variable
pVals()
contains the set of parameter values. The“*”
value indicates that the request is to return all of the parameter values. -
pCodes()
andpVals()
are arrays. They hold multiple values. The parameter codepCodes(1)
value is stored inpVals(1)
when 1 is used to indicate which value out of the array to access.