AddReferences

You can use this function for Optiva Workflows and Copy Methods.

Purpose

References one object to another.

Syntax


Dim variable As Integer = AddReferences(Symbol, Object, ReferenceSymbol, ReferenceObject1 [, ReferenceObject2, ReferenceObject3...])

Arguments

Part Description
Symbol Type of object. Use empty quotation marks to indicate the current symbol for the workflow or copy method.
Object Object code for which references are added. Use empty quotation marks to indicate the current object for the workflow or copy method.
ReferenceSymbol Type of object that is referenced.
ReferenceObject1 First object code to be referenced (shown on the References tab) of the Object. You can use the object ID in place of the object code.
ReferenceObject2, ReferenceObject3 Optional. Additional object codes to be referenced (shown on the References tab) of the Object. You can use object IDs in place of the object code.

Description

AddReferences adds objects, as references, to another object. References are listed on the References tab of objects. The system must be configured to allow the reference before using this function. For example, to use AddReferences to reference specifications to formulas, formulas must already be configured to reference specifications.

See the Infor PLM for Process Application Configuration Guide.

Examples

In this example, the PIZZASAUCE\199 and PIZZASAUCE\202 specifications are referenced to the PIZZASAUCE\002 formula.


Dim iAddref As Integer = AddReferences("FORMULA", 
"PIZZASAUCE\002","SPECIFICATION","PIZZASAUCE\199","PIZZASAUCE\202")

If the formula is the object of the workflow or copy method, then specify empty quotation marks for the symbol and object.


Dim iAddref As Integer = AddReferences("","","SPECIFICATION", 
"PIZZASAUCE\199","PIZZASAUCE\202")

In this example, the first statement retrieves the manufacturing item code of the formula. The next line retrieves the object code of the specification. The specification is referenced on the References tab of the item.

The specification is added to the References tab of the formula.


Dim oItem, ospec As Object
Dim iAddref As Integer
oItem = ObjProperty("ITEMCODE")
oSpec = ObjProperty("OBJECTCODE.REF.V\REFITEM3","ITEM",oItem, 
"SPECIFICATION",2)
iAddref = AddReferences("","","SPECIFICATION",oSpec)

Copy Method example

This copy method adds the customer name as a reference to the new object.


Dim rc As Long
rc = AddReferences("","","CUSTOMER",CopyMethod.Context.GetSegData(2), 
"","")

Duplicate References example

The LINE_ID column, in the FSOBJECTREFERENCE table, supports duplicate references. In this example, SP-0001\0001 is added to the SPECIFICATION object twice.


Dim iAddref As Integer = AddReferences("","",

"SPECIFICATION","SP-0001\0001","SP-0002\0003","SP-0001\0001")