| |
| Gets the value of a field as a variant. |
| |
 |
VARIANT GetFieldVal ( enum eSalesFld eFieldID ) |
|
| |
| Parameters | | eFieldID | [in] Identifier of the field, e.g. salfSysNum (C++) or eSalesFld.salfSysNum (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). salfSysNum + 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. |
| | | | Return value |
A VARIANT containing the value of the requested field. Be aware that this can be a null-object in some cases, e.g. if the value of a system field (e.g. Crc1) is requested. |
| |
| See Also |
|
|
|
| |
| Samples |
| |
 |
C++ |
| |
// Retrieving the value of all standard fields (excludes calculation fields)
_variant_t vValue;
for (int nFieldID = 0; nFieldID <= salfMax; nFieldID++)
{
vValue = pSales->GetFieldVal ((eSalesFld)nFieldID);
if (vValue.vt != VT_EMPTY)
{
// Process data
}
}
|
|
 |
C# |
| |
// Retrieving the value of all standard fields (excludes calculation fields)
object oValue = null;
for (int nFieldID = 0; nFieldID <= (int)eSalesFld.salfMax; nFieldID++)
{
oValue = oSales.GetFieldVal ((eSalesFld)nFieldID);
if (oValue != null)
{
// Process data
}
}
|
|
 |
VBS |
| |
' Retrieving the value of all standard fields (excludes calculation fields)
Dim vValue
Dim iFld
For iFld=0 To oSales.GetFieldID("FutureUse")
vValue = oSales.GetFieldVal(iFld)
If VarType(vValue) <> vbNull Then
' Process data
End If
Next
|
|
 |
VB.NET |
| |
' Retrieving the value of all standard fields (excludes calculation fields)
Dim oValue As Object
For iFieldID As Integer = 0 To eSalesFld.salfMax
oValue = oSales.GetFieldVal(iFieldID)
If Not oValue Is Nothing Then
' Process data
End If
Next
|
|