Friday, 27 June 2008

Updating a customer's delivery address

This is quite a simple piece of code, but it was asked for by one of our development community. Basically how to update a customer's delivery address from code, so here it is:

Private Sub btnUpdateDeliveryAddress_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdateDeliveryAddress.Click
Dim SalesRecord As SageDataObject50.SalesRecord = DirectCast(ws50.CreateObject("SalesRecord"), SageDataObject50.SalesRecord)
SalesRecord.Fields.Item("DEL_ADDRESS_1").Value = "10 William Drive"
SalesRecord.Fields.Item("DEL_ADDRESS_2").Value = "Wallaceville"
SalesRecord.Fields.Item("DEL_ADDRESS_3").Value = "co. Durham"
SalesRecord.Fields.Item("DEL_ADDRESS_4").Value = "England"
SalesRecord.Fields.Item("DEL_ADDRESS_5").Value = "NT48 9LH"
End Sub

No comments: