cancel
Showing results for 
Search instead for 
Did you mean: 

Not a valid open sales order [OWOR.OriginAbs]

Former Member
0 Kudos

I have the following code and encounter the error message "Not a valid open sales order [OWOR.OriginAbs]


        Dim oWO, oWo2 As SAPbobsCOM.ProductionOrders
        Dim xmlDoc As New System.Xml.XmlDocument
        oWO = DirectCast(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders), SAPbobsCOM.ProductionOrders)
        oWo2 = DirectCast(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders), SAPbobsCOM.ProductionOrders)
        Dim s As String = "c:\2334.xml"
        If (oWO.GetByKey(34)) Then
            oWO.SaveXML(s)
            oWO = Nothing
            oWo2 = oCompany.GetBusinessObjectFromXML(s, 0)
            Dim i As Integer = 0
            i = oWo2.Update()
            If (i <> 0) Then
                MsgBox(oCompany.GetLastErrorDescription)
            End If
        End If

Does anyone have any idea why does this so?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hwee Yee Eng,

The issue can solve after remove Note OriginAbs in the xml file, seems a SDK issue.

Maybe you can update Product order directly but not use xml to avoid this issue.

Best Regards

Jane Jing

SAP Business One Forums team

Answers (3)

Answers (3)

Former Member
0 Kudos

Dear Jane Jing

Thanks for the update, it solve my problem.

I use XML because i might need to remove some production order line in my SDK but DI doesn't provide the method to remove production order line.

Anyway, thanks for your help.

Regards

Hwee Yee

Former Member
0 Kudos

Dear Jane Jing

I am able to open that production order in B1 and there is no link between production order and sales order. Does this mean link between Sales Order and Production Order have problem?

I managed to update Production Order Remarks in B1 and there should be no problem if i update through DI.

Does it make sense?

Please advice

Regards

Hwee Yee

Former Member
0 Kudos

Dear Hwee Yee Eng,

By the error seems the Sales Order linked with the Order has problem,

you could check if can open the order in the B1 application.

Best Regards

Jane Jing

SAP Business One Forums team