Examples: DUOSObjectCombineID method

The following procedure runs when the user clicks the Save button in the Item Vendors Maintenance window. It uses the DUOSObjectsCombineID method to combine the values of two window fields (Vendor ID and Item Number) to construct a unique object ID:

Private Sub Save_BeforeUserChanged(KeepFocus As Boolean, _
CancelLogic As Boolean)
	Dim VendorCollection As DUOSObjects
	Dim VendorObject As DUOSObject
	Dim ObjectID As String

	'Specify a vendors collection
	Set VendorCollection = DUOSObjectsGet("Vendors")
	'Combine two field values to create a unique object ID
	ObjectID = DUOSObjectCombineID(VendorID, ItemNumber)
	'Create the object, using the combined ID
	Set VendorObject = Vendors.Item(ObjectID)
	'Set the object’s properties using window fields
	VendorObject.Properties("Discount Quantity") = DiscountQuantity
	VendorObject.Properties("Discount Percent") = DiscountPercent
End Sub

Documentation Feedback