cancel
Showing results for 
Search instead for 
Did you mean: 

Business One C# DI API : how to set item wharehouse stock

0 Kudos

Hi community,

I would like to set Item Wharehouse OnHand Quantity through DI API + C#.

In database, the target is this field : OITW.OnHand.


But I don't find code example.

Do you know how to do that ?

Regards,

Guillaume

Accepted Solutions (0)

Answers (1)

Answers (1)

edy_simon
Active Contributor
0 Kudos

Hi Guillaume,

The sdk doesn't provide an object to update this directly.

However you can post documents to adjust this value.

If you are in atleast 9.0pl 9, you can post the inventory counting and inventory posting to adjust.

SAP 9 PL09 Inventory Posting | SCN

Regards

Edy

0 Kudos

Hi Edy,

Thank you for your answer.

I add some precisions ...

Actually, throught DIAPI in C#, i duplicate an item.

But the new item created inherits the stock of the original item.

I think it's possible to set warehouse stock at 0 when i duplicate the item.

I'm looking for a syntax which allow to access to this property when i duplicate the item.

In the attached file, the code i use to duplicate an item.

Before oArticle.Add() instruction,; i would like to set warehouse stock.



This someone have got an idea, i will take it !


Regards,


Guillaume


former_member233854
Active Contributor
0 Kudos

Hi Guillaume,

It is weird, it shouldn't do it, sometimes we face strange situations with the Stock but usually I can fix the Stock quantity running this below

Help --> Support --> Restore --> Restore Item Balance