Venice
Lookup::SetFieldVal
 
Sets the value of a field.
 
void SetFieldVal (
    enum eLookupFld eFieldID,
    VARIANT vFieldValue
)
 
Parameters
eFieldID
[in] Identifier of the field, e.g. lkpfSysNum (C++) or eLookupFld.lkpfSysNum (C# / VB.NET).
 
Warning: DO NOT hardcode numeric values for field identifiers. The numeric value of a field (i.e. the enum value) can change from one version to the next. Always use the enum or use GetFieldID
Warning: DO NOT assume the order of fields will remain the same (do not calculate relative fields). lkpfSysNum + 15 may not be valid or the same in future versions.
Remark: In VBS, this field identifier enumerations cannot be used! You should use GetFieldID to get a valid field identifier.
Remark: Within an object, field identifiers will not change as long as the object persists. You can obtain a value with GetFieldID once and then continue using the value. However, note that custom calculation fields are unique per dossier; even if they have the same field name, they may not have the same numeric value in all dossiers.
vFieldValue
[in] A VARIANT containing the value you want to give the requested field.
 
See Also
CreateLookup
GetFieldVal
GetFieldStr
GetFieldID
 
Samples
 
C++
 
// Set the type to InvShipmentMethod
pLookup->SetFieldVal (lkpfTypeNum, ltInvShipmentMethod);

C#
 
// Set the type to InvShipmentMethod
oLookup.SetFieldVal (eLookupFld.lkpfTypeNum, eLookupType.ltInvShipmentMethod);

VBS
 
' Set the type to InvShipmentMethod
Call oLookup.SetFieldVal(oLookup.GetFieldID("TypeNum"), ltInvShipmentMethod)

VB.NET
 
' Set the type to InvShipmentMethod
oLookup.SetFieldVal(eLookupFld.lkpfTypeNum, eLookupType.ltInvShipmentMethod)