DestinationFields object

The DestinationFields object refers to any destination field in the Integration Mapping window. It is typically used in scripts attached to fields in the Integration Mapping window, and also can be used in the Before Document Commit script.

Syntax
DestinationFields(name).[property | method]

Parameters
name—A string containing the full name of the destination field. If the destination field is part of a collection, the full name includes the names of any collections the field is part of, separated by periods.

Example
The following example is the Before Document Commit script for a vendor integration. It sets the Comment 1 field to the value “Imported by IM”.

DestinationFields(“Comment 1") = “Imported by IM”

The following example is the Before Document Commit script for a customer integration. It sets the Credit Limit Amount field, which is part of the Options collection, to the CreditLimit value returned by a query.

DestinationFields(“Options.Credit Limit Amount”) =
SourceFields(“CreditLimit”)

 

DefaultIsSet property

The DefaultIsSet property returns a boolean indicating whether a destination field is set to use the default value. True indicates it uses the default value. False indicates it does not.

Syntax
object.DefaultIsSet

Parameters
object—A destination field object.

Example
The following example is the Before Document Commit script for an integration. It examines the Transaction Date destination field to find out whether it is set to the default value. If it is, a message appears and the integration is stopped.

If DestinationFields(“Transaction Date”).DefaultIsSet = True Then
	MsgBox “Have not set the date for the transaction”
	CancelIntegration
End If

 

HasDefault property

The HasDefault property returns a boolean indicating whether a destination field has a non-empty default value. True indicates the field has a non-empty default value, while false indicates it does not.

Syntax
object.HasDefault

Parameters
object—A destination field object.

Comments
Use the HasDefault property to verify that a destination field has a default value before you use the SetToDefault method.

Example
The following example verifies that the Post Sales In destination field in the Account object has a non-empty default value. If it does, the default value is used.

If DestinationFields(“Post Sales In”).HasDefault = True Then
	DestinationFields(“Post Sales In”).SetToDefault
End If

 

SetToDefault method

The SetToDefault method specifies that a destination field will use its default value.

Syntax
object.SetToDefault

Parameters
None

Comments
You can use the HasDefault property to verify that a destination field has a non-empty default value before you use the SetToDefault method.

Example
The following example is the Before Document Commit script for a customer integration. If the CustomerType value from the Customer query is Preferred, the Finance Charge Percent is set to 8. Otherwise, it is set to use the field’s default.

If SourceFields(“CustomerType”) = “Preferred” Then
	DestinationFields(“Options.Finance Charge Percent”) = 8
Else
	DestinationFields(“Options.Finance Charge Percent”).SetToDefault
End If

 


Documentation Feedback