cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot update sales order link on an activity

Former Member
0 Kudos

I have an addon that creates CRM activities after an order has been updated. This is working fine in the SBODemo_UK database but fails when I run it against a customer database. An extract of the code is: -

oItem = oForm.Items.Item("8")

act1.GetByKey(ActKey)

SorderNo = oItem.Specific.value - 1

act1.DocType = "17"

If act1.DocEntry = "" Then act1.DocEntry = SorderNo

act1.Details = Remarks

act1.Update()

GetDIConnection.GetLastError(nErr, errMsg)

If (nErr <> 0) Then

SBO_Application.MessageBox("Failed to update order activity " & errMsg)

End If

This code is executed after the order has been updated and I have verified this by stopping the code at the start of the section above and used Enterprise manager to see that the order has hit the database.

The only difference that I can see between the two databases is their size with the customer database having 5000 orders in it. I wondered if there was some sort of delay in the SDK seeing the new order being added because of the size of the database but I deleted all but 200 orders and still have the problem.

Does anyone have any ideas?

Accepted Solutions (1)

Accepted Solutions (1)

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Gordon,

Is there a difference between the version of SAP Business One you are using and what the client it using ... including the patch level? If it works successfully with the Demo database it should also work in a production database.

Eddy

Former Member
0 Kudos

Edward,

not only are the systems the same I am running the databases on the same machine which is my development laptop. I have just created a database from scratch and installed my addin and it works OK there. The addin auto creates the fields and tables required so it should be doing the same for all databases that I install it to.

Gordon

Answers (1)

Answers (1)

Former Member
0 Kudos

What version and patch are you on?

I have encountered issues with the getbykey when the source of the order is a duplicated document. When the order is created from scratch getbykey works fine.

I only get this in 2007 though...

Message was edited by:

John O'Neill

Former Member
0 Kudos

John,

That's useful to know but I dont think it is the cause of my problems as I am creating orders from scracth and am on 2005 SP01.

Thanks anyway