Should be easy BO question

Well, if it is really necessary to go this route (i.e. you are trying to update a record that is not part of the data in the current form)

Then, after you declare your adapter, and connect, you have to retrieve a record to be able to change the values - most likely a a GetByID method call

So:

Dim oSalesOrderAdapter As SalesOrderAdapter = New SalesOrderAdapter(SalesOrderForm)
oSalesOrderAdapter.BOConnect()

If oSalesOrderAdapter.GetByID(12345) Then
oSalesOrderAdapter.SalesOrderData.Tables("OHOrderMsc").Rows(0)("DocMiscAmt") = 99.99
oSalesOrderAdapter.ChangeMiscAmount("OHOrderMsc")
End IF

oSalesOrderAdapter.Update()
oSalesOrderAdapter.Dispose()

Not sure on whether the value in the table gets changed before or after the ChangeMiscAmount method is called - you may want to do a UI trace during a change to the amount and see what order the UI makes the calls

The 12345 should be the order number you are really working on.....

--- In vantage@yahoogroups.com, "Chris" <chris.ryhal@...> wrote:
>
> Using the BO I am trying to update the OHOrderMsc.DocMiscAmt on the Sales Order form. For testing, I'm just trying putting a simple decimal of 99.99 as you can see below. I'll convert to a variable at a later date. I also know that (0) will not always be the row I need but for now (0) IS the row. I am getting an error with this BO. Any ideas?
>
>
> Dim oSalesOrderAdapter As SalesOrderAdapter = New SalesOrderAdapter(SalesOrderForm)
> oSalesOrderAdapter.BOConnect()
>
> oSalesOrderAdapter.ChangeMiscAmount("OHOrderMsc")
>
> oSalesOrderAdapter.SalesOrderData.Tables("OHOrderMsc").Rows(0)("DocMiscAmt") = 99.99
>
> oSalesOrderAdapter.Update()
> oSalesOrderAdapter.Dispose()
>
>
> Error Detail
> ============
> Message: OHOrderMsc record not available.
> Type: Error
> Program: Server/bo/SalesOrder.p
> Method: ChangeMiscAmount
> Table: OHOrderMsc
> Row:
> Field:
>
Using the BO I am trying to update the OHOrderMsc.DocMiscAmt on the Sales Order form. For testing, I'm just trying putting a simple decimal of 99.99 as you can see below. I'll convert to a variable at a later date. I also know that (0) will not always be the row I need but for now (0) IS the row. I am getting an error with this BO. Any ideas?


Dim oSalesOrderAdapter As SalesOrderAdapter = New SalesOrderAdapter(SalesOrderForm)
oSalesOrderAdapter.BOConnect()

oSalesOrderAdapter.ChangeMiscAmount("OHOrderMsc")

oSalesOrderAdapter.SalesOrderData.Tables("OHOrderMsc").Rows(0)("DocMiscAmt") = 99.99

oSalesOrderAdapter.Update()
oSalesOrderAdapter.Dispose()


Error Detail
============
Message: OHOrderMsc record not available.
Type: Error
Program: Server/bo/SalesOrder.p
Method: ChangeMiscAmount
Table: OHOrderMsc
Row:
Field: