Our business tends to have a lot of adjustments to required by dates. The process in the past has been to update the JobHead.ReqDueDate and typically ignore the OrderRel.NeedByDate (leave it how it was upon creation).
We'd like these two fields to be in sync now. When The JobHead field is changed, update the OrderRel field.
I created a customization today to allow this to happen...but I'm unable to find the proper adapter. SalesOrderAdapter only allows updates to the OrderHed (and this works, but it changes the OrderHed.NeedbyDate only). OrderRelSearchAdapter gets me the data set, but "updates aren't allowed" using this adapter.
I'm hoping someone may have alternate suggestions on how to manage this, or know the proper adapter to call to update the OrderRel table.
Here's a copy of the code:
Private Sub oTrans_jobAdapter_BeforeAdapterMethod(ByVal sender As object, ByVal args As BeforeAdapterMethodArgs) Handles oTrans_jobAdapter.BeforeAdapterMethod
Select Case args.MethodName
Case "Update"
Dim edvJobHead as EpiDataView = CType(oTrans.EpiDataViews("JobHead"), EpiDataView)
Dim ReqDueDate as string = edvJobHead.dataView(edvJobHead.row)("ReqDueDate")
Dim edvJobProd as EpiDataView = CType(oTrans.EpiDataViews("JobProd"), EpiDataView)
Dim OrderNum as string = edvJobProd.dataView(edvJobProd.row)("OrderNum")
Dim OrderLine as string = edvJobProd.dataView(edvJobProd.row)("OrderLine")
Dim OrderRelNum as string = edvJobProd.dataView(edvJobProd.row)("OrderRelNum")
Dim ORSAdapt as OrderRelSearchAdapter = New OrderRelSearchAdapter(oTrans)
ORSAdapt.BOConnect()
ORSAdapt.GetById(OrderNum, OrderLine, OrderRelNum)
ORSAdapt.OrderRelSearchData.Tables(0).Rows(0).BeginEdit()
ORSAdapt.OrderRelSearchData.Tables(0).Rows(0)("NeedByDate")=ReqDueDate
ORSAdapt.OrderRelSearchData.Tables(0).Rows(0).EndEdit()
ORSAdapt.Update()
Case Else
End Select
End Sub
Thanks,
Ken
[Non-text portions of this message have been removed]
We'd like these two fields to be in sync now. When The JobHead field is changed, update the OrderRel field.
I created a customization today to allow this to happen...but I'm unable to find the proper adapter. SalesOrderAdapter only allows updates to the OrderHed (and this works, but it changes the OrderHed.NeedbyDate only). OrderRelSearchAdapter gets me the data set, but "updates aren't allowed" using this adapter.
I'm hoping someone may have alternate suggestions on how to manage this, or know the proper adapter to call to update the OrderRel table.
Here's a copy of the code:
Private Sub oTrans_jobAdapter_BeforeAdapterMethod(ByVal sender As object, ByVal args As BeforeAdapterMethodArgs) Handles oTrans_jobAdapter.BeforeAdapterMethod
Select Case args.MethodName
Case "Update"
Dim edvJobHead as EpiDataView = CType(oTrans.EpiDataViews("JobHead"), EpiDataView)
Dim ReqDueDate as string = edvJobHead.dataView(edvJobHead.row)("ReqDueDate")
Dim edvJobProd as EpiDataView = CType(oTrans.EpiDataViews("JobProd"), EpiDataView)
Dim OrderNum as string = edvJobProd.dataView(edvJobProd.row)("OrderNum")
Dim OrderLine as string = edvJobProd.dataView(edvJobProd.row)("OrderLine")
Dim OrderRelNum as string = edvJobProd.dataView(edvJobProd.row)("OrderRelNum")
Dim ORSAdapt as OrderRelSearchAdapter = New OrderRelSearchAdapter(oTrans)
ORSAdapt.BOConnect()
ORSAdapt.GetById(OrderNum, OrderLine, OrderRelNum)
ORSAdapt.OrderRelSearchData.Tables(0).Rows(0).BeginEdit()
ORSAdapt.OrderRelSearchData.Tables(0).Rows(0)("NeedByDate")=ReqDueDate
ORSAdapt.OrderRelSearchData.Tables(0).Rows(0).EndEdit()
ORSAdapt.Update()
Case Else
End Select
End Sub
Thanks,
Ken
[Non-text portions of this message have been removed]