Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFAdjustments.Add Method (String, String, Object, UOM)

AFAdjustments.Add Method (String, String, Object, UOM)

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFAdjustments.Add Method (String, String, Object, UOM)
The Add method creates a new adjustment to the value of an attribute within the context of an AFCase object and adds the adjustment to the collection.

Namespace:  OSIsoft.AF.Analysis
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public AFAdjustment Add(
	string creator,
	string comment,
	Object adjustedValue,
	UOM specifiedUOM
)
Public Function Add ( 
	creator As String,
	comment As String,
	adjustedValue As Object,
	specifiedUOM As UOM
) As AFAdjustment

Dim instance As AFAdjustments
Dim creator As String
Dim comment As String
Dim adjustedValue As Object
Dim specifiedUOM As UOM
Dim returnValue As AFAdjustment

returnValue = instance.Add(creator, comment, 
	adjustedValue, specifiedUOM)
public:
AFAdjustment^ Add(
	String^ creator, 
	String^ comment, 
	Object^ adjustedValue, 
	UOM^ specifiedUOM
)
member Add : 
        creator : string * 
        comment : string * 
        adjustedValue : Object * 
        specifiedUOM : UOM -> AFAdjustment 

Parameters

creator
Type: SystemString
The name of the user creating the adjustment. If this parameter is or an empty string, then it defaults to the user name of the person that started the current thread. The maximum length of this parameter is 50 characters.
comment
Type: SystemString
The user's descriptive comment describing the adjustment. The maximum length of this parameter is 1000 characters.
adjustedValue
Type: SystemObject
The adjusted value for the attribute.
specifiedUOM
Type: OSIsoft.AF.UnitsOfMeasureUOM
The unit of measure of the adjustedValue parameter. If , then the unit of measure may be specified as part of the value in string format (e.g. "100.0 ft"). Otherwise, the unit of measure of the value is assumed to be in terms of the attribute's DefaultUOM property.

Return Value

Type: AFAdjustment
Returns the newly created object that was added.

Exceptions

ExceptionCondition
InvalidCastException Thrown when the conversion to the configured AFAttribute.Type cannot be performed.

Remarks

This method is usually called after the input values for the case have been added by the analysis and before the analysis is executed (by the AFAnalysis.Run() method). The adjustments to AFAttribute values allow the actual values read from external sources to be overridden within the context of the case.

Multiple adjustments for the same attribute are allowed by calling this method again for the same attribute. If an adjustment for the attribute has already been created but the changes have not been saved to the server by calling CheckIn or ApplyChanges, then the existing adjustment is modified. If previous changes to the adjustment for the attribute have already been saved to the server, then a new adjustment is created. Once an adjustment has been saved to the server, it cannot be deleted. Instead, the adjustment can be cleared using the Clear(String, String) method to remove the affect of the adjustments. This provides an audit trail of all the overrides made to an attribute's value.

Version Information

AFSDK


See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in