Skip to Content
avatar image
Former Member

Di Add-on Adresses BP Error

Hello experts ,

I am trying to create an add-on for updating addresses at business partner .It works fine for sap fields although in udfs i received the error 'invalid field name' . The name from udf is correct.The code is the following :

oBusPartner.Addresses.AddressType = SAPbobsCOM.BoAddressType.bo_BillTo
oBusPartner.Addresses.AddressName = rsBP.Fields.Item("IDAddress").Value.ToString
oBusPartner.Addresses.UserFields.Fields.Item("U_RegLocal").Value = rsBP.Fields.Item("U_RegLocal").Value.ToString

Please advice.

Kind Regards ,

Ifigenia Koumbarda

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 09, 2017 at 11:29 AM

    Hi Ifigenia,

    Replace this:

    oBusPartner.Addresses.UserFields.Fields.Item("U_RegLocal").Value = rsBP.Fields.Item("U_RegLocal").Value.ToString

    By this:

    oBusPartner.Addresses.UserFields.Fields.Item("U_RegLocal").Value = rsBP.Fields.Item("U_RegLocal").Value;

    Hope it helps.

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded

  • May 09, 2017 at 12:12 PM

    Hi,

    The problem is in your rsBP, you query is missing the field "U_RegLocal" or "IDAddress", double check if you have the field on the query you are running for rsBP.

    Add comment
    10|10000 characters needed characters exceeded