Adding Items to Phys. Inventory Journal

slimerslimer Member Posts: 6
edited 2009-11-27 in NAV Three Tier
Hello,

I'm writting a C# code to update a Phys. Inventory Journal via a text file. The problems is when I tried to create a line with a Items that is not calculated by Navision and is really in stock.

I tried this code, assuming SereiInventari is a Service of the published Phys. Inventory Journal page:
                    article.Location_Code = botiga 'botiga is the catalan name for Shop
                    article.Item_No = dtarti.Rows(0)(0) 'The Item number has been tested before
                    article.Variant_Code = dtarti.Rows(0)(1) 'The variant code has been tested before
                    article.Qty_Phys_Inventory = Decimal.Parse(camps(1).Substring(camps(1).LastIndexOf(":") + 1)) 'In the case I'm trying is 1.
                    article.Qty_Phys_InventorySpecified = True
                    article.Phys_Inventory = True 'There is the field required by the message
                    article.Phys_InventorySpecified = True '
                    article.Document_No = cbDoc.Text 'The number of the document already exists.
                    article.Qty_Calculated = 0 'I'm noy sure if it is mandatory
                    article.Qty_CalculatedSpecified = True
                    ServeiInventari.Create("INVENTARI", article) 

But, even I specify the Phys_Inventori field (with his specified to true) the create function ever says the same: "El campo Phys. Inventory de la tabla Item Journal Line debe ser igual a 'Yes'. El valor actual es 'No'." (free translation: The Item Journal Line table's Psys. Inventory field must be equals to 'Yes'. The current values is 'No').

Any idea to help me?

Thanks in advance,
slimer
Sign In or Register to comment.