Passing Journal Batch Name when creating Item Reclass

Hi (NAV 2017, oData),

Sorry if this has already been answered somewhere, I’ve had a look around and can’t seem to find anyone who has had the same error as below:

I’m using the oData method “AddToItemReclassJournal” to (obviously) post an item to the Reclass Journal, my problem is…

If I leave the “Journal_Batch_Name” field blank, it defaults to the user that appears first in alphabetical order (seems strange to me, but hey ho…). The problem comes when I try to pass my own value to override the “default” batch name.

Example: At the moment, we have a batch name called “ALAN”, so if I do no pass anything through “Journal_Batch_Name” then by default, everything is getting posted under the “ALAN” Batch name.

This is where it gets strange…if I pass “ALAN” through “Journal_Batch_Name” then, again, it posts under “ALAN”, with no errors. However, if I try and pass “API” through “Journal_Batch_Name” I get an error: “The Item Journal Line already exists. Identification fields and values: Journal Template Name=‘RECLASS’,Journal Batch Name=‘ALAN’,Line No.=‘10000’”.

By contrast, if I remove “ALAN” from the list of batch names and don’t pass anything through “Journal_Batch_Name”, everything is posted under “API” by default (assuming it’s due to this being next alphabetically). BUT…if I then pass “API” through “Journal_Batch_Name”, it posts fine, with no error (unlike before, when the default was “ALAN”).

Very strange.

Hopefully, I’m doing something silly and it’s a 10 second fix, any suggestions would be great.

Many thanks in advance!

I am guessing that you have added a page to Web Services and now try to use that webservice in odata??? If the answer is yes, then you have do understand that standard pages are not necessary made for webservices - So you kinda have to create your own version.

Have you tried to see if it works, if you use directly (in a codeunit in NAV 2017) ?

Hi,

Sorry about the slow response.

Yes, I am trying to use a Page to do the insert with, all seems to be working apart from the “batch name” field [emoticon:ca08b2c27c2f40e993e89508acf29e0b]

Unfortunately, due to the way our contract/ support contract works - we don’t have access to the development tool to create our own code units. The code units have to be created by our provider, which they bill us the earth for.

I’ve had a quick look, but not sure which “standard” code unit I could use to run a test, any ideas?

Many thanks