cancel
Showing results for 
Search instead for 
Did you mean: 

Field cannot be updated (ODBC -1029)

Former Member
0 Kudos

I am using DI API to add the existing draft AP credit memo to AP credit memo, but it cannot be added and prompts "-1029 [RPC1.AcctCode][line: 1] , 'Field cannot be updated (ODBC -1029)'". I use the function GetByKey to get the document and call the function SaveDraftToDocument to add the document. I do nothing on account code of each line and there is a value of account code on each line. Can anyone tell me what the problem might be?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Wang,

I hope there is some default value for GL codes set for the documents.

Open the document you are accessing in SBO.

Goto Form Settings, under the document Tab check the GL Account.

I hope this value might be coming over there.

edy_simon
Active Contributor
0 Kudos

Hi,

I have not try to convert the AP CN through this new method.

But  I did encounter the same error when creating the AP CN through XML load for Item Type document.

I get by this error by removing the account code before adding the AP CN :

For i as integer = 0 to oDoc.Lines.Count-1

     oDoc.Lines.SetCurrentLine(i)

     oDoc.oDoc.Lines.AccountCode = ""

Next

If yours is of Item Type also, you might want to try above.

Regards
Edy

Message was edited by: Edy Simon

Former Member
0 Kudos

Hi Edy,

I tried it before, but it didn't work.

Best Regards,

Wang

edy_simon
Active Contributor
0 Kudos

Hi,

On which 882 PL are you running this ?

I have just tried it on 882 PL 8, and it is working fine without having to change anything on the above.

Can you try yours on 882 PL8?

I suspect it is a bug in older PL.

Just FYI, i still found some problem with this method in PL8.

When your price and amount is of 2 decimal digits,

for a certain calculation, you can end up with a discount of 0.01 percent in your line.

Regards
Edy

pedro_magueija
Active Contributor
0 Kudos

Hi Wong,

Can you please post your code so we can take a look?

Are you using the draft document to call the GetByKey()?

Documents d = PMXLight.mCompany.GetBusinessObject(BoObjectTypes.oDrafts);

d.GetByKey();

Best regards,

Pedro Magueija

Former Member
0 Kudos

Hi Pedro,

Yes, I am using the draft document to call GetByKey() just as yours.

And then I use SaveDraftToDocument to add AP credit memo from draft.

Best Regards,

Wang