cancel
Showing results for 
Search instead for 
Did you mean: 

How to Update ItemCodes using B1Tech

Former Member
0 Kudos

Hi All,

I want to update hundreds of ItemCodes (In OITM Table) to new ItemCodes.

I know this can be done manually. Is there any way to do this via B1Tech Ver 2007?

Testing on a single Item using this code in B1Tech:

Item1= get(ITEM,'AAAA')

Item1.ItemCode='BBBB'

update(Item1)

I get a -5002 error message in B1Tech.

1. Does any one know what this error message means?

2. Did any one try changing hundreds of Itemcodes via B1Tech and has the correct syntax for this?

3. Is there any other better way to change ItemCodes using other tools (DTW, est.)?

Thanks,

Asaf

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

please refer below Notes

1 . 1303019 DI_Cannot add an invoice with Withholding Tax data

2 . 1336306 LOC_CEE_DI_Cannot copy FC Invoice to Correction Invoice

3 . 1281188 DI_Can't add DPM, error DPM sum cannot be greater than total

4 . 1286672 DI_Cannot add Correction Invoice for item with no warehouse

5 . 1262795 DI_Cannot create document with batches and serial numbers

Thanks

Kevin

Former Member
0 Kudos

Hi Kevin,

Thanks. Most of these notes state that error -5002 is solved in 2007 A SP01 PL05. I am using version 2007 A SP01 PL06 and the latest version of B1TCH (B1TCH R1.0 Patch Level 3).

I am still wondering if any one succeeded in updating ItemCodes for Items via the B1TCH.

Thanks,

Asaf

Former Member
0 Kudos

Hi Asaf,

Maybe the error is due to the probable fact that the B1TCH Add-On was compiled in the earlier Patches of 2007A (Any other patch earlier than your installed patch).

Just a wild guess ;).

HTH,

Siju Dasan

Former Member
0 Kudos

Hi Asaf

As far as I know B1TCH uses the ItemCode as the ObjectKey when editing an object (it actually uses the DI API in the background) so if you change the key it will lose its link to the object and give an error. So it will probably not be possible to change the ItemCode using B1TCH (or the DI API).

I can only think of 2 possible solutions

1) Export all relevant items to excel, change item codes

then use B1TCH to delete items

and re-import using DTW

2) Use B1TCH to create a new item based on the old(incorrect) one and then delete the old items with B1TCH

The following series of steps can do it for one item in B1TCH:

itm=get(ITEM, 'OldItem')

itm2=itm

itm.Remove()

itm2.ItemCode = 'NewCode'

add(itm2)

The trick will be to create a script to do it all in one go using something the 'for itm in browse(ITEM, query(""SQL Query)):' method.

If you already have the New ItemCode somewhere on the Old Item master record then it would be relatively easy. Else I suggest you import the new code into one of the Existing fields on the item master (such as the BarCode) and then you can use 'itm2.ItemCode = itm2.BarCode' to set the new itemcode before you add the new item.

Good luck

Edu

Former Member
0 Kudos

Hi Asaf,

I am afraid you are referring the tool B1TCH. As pointed out by Eddy, it would not be possible to update ItemCodes if those items have any transactions associated.

When you mentioned: I know this can be done manually. Have you tried?

Thanks,

Gordon

Former Member
0 Kudos

Hi Gordon,

Yes, I mean the B1TCH tool.

I can update the ItemCodes Manually via the Business One user interface since these Items (all of them) do not have transactions on file related to them.

Changing the Itemcodes manually for these Items is not an option since there are over 5000 Itemcodes that we want to change.

Do you know if it's possible to change the ItemCodes via the B1TECH or DTW or is this possible only manually?

When trying to change just one ItemCode via the B1TCH I get the error -5002.

Thanks,

Asaf

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

asaf amsterdam,

Apologies as I am not sure what "B1Tech" is. I am assuming that this is a tool similar to the DTW for data import and/or update into SAP Business One.

With respect to the Item Master, if you have an item that has transactions on file for that item, you cannot make a change to the ItemCode. The system prevents this until all transactions are reversed or removed. This is also the case if you try to change the item code via the Business One user interface ... you will not be allowed.

If you have an item or items that do not have ANY transactions on file, then the system does let you change the ItemCode property. Again, you can test this via the user interface for Business One.

Any application/add-on that uses the DI API will follow the same rules as above with respect to a key property on a master record. The DTW, which uses the DI API, would also error if you tried to update an ItemCode that has transaction on file for it also.

Hope that helps,

Eddy