Context Object Parameters
Parameter Name
|
Type
|
Read/Write
|
Comments
|
Validation
|
Boolean
|
Write
|
TRUE if the part can be assigned and FALSE
otherwise.
|
oForceAssignment
|
Boolean
|
Write
|
TRUE if the user is authorized ti force
assignment and FALSE otherwise.
|
Sample
The following sample determines if a product or a part can be assigned to an item.
Let iPart(ProductOccurrence)
Let AttValue(String)
Let PartInstance(VPMInstance)
Let PartName(String)
Let PartTest(String)
Let ReturnMessage(String)
Validation = true
ReturnMessage =""
/* If the 3 first characters of the name is Not, the part is not assignable else it is */
set iPart = ThisObject
if ( NULL <> iPart)
{
PartInstance = iPart.Instance
if (PartInstance <> NULL)
{
PartName = PartInstance->GetAttributeString("PLM_ExternalID")
PartTest=PartName.Extract(0,3)
if (PartTest <> "Not")
{
Validation = false
ReturnMessage = "The business logic does not allow assignation of "+PartName
Parameters.SetAttributeBoolean ("oForceAssignment", false)
}
}
}
Parameters.SetAttributeString("Message",ReturnMessage)