Hi Everyone,
I'm using NAV 2009 SP1 UK Edition. (CRONUS UK Ltd.) and the error is with Web Services
I have the code below which is used to create a sales order however it is not working and I recieve the following error:
Fatal error: Uncaught SoapFault exception: [a:Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException] The Sales Line already exists. Identification fields and values: Document Type='Order',Document No.='1115',Line No.='10000' in ****** Stack trace: #0 ********(301): SoapClient->__call('Update', Array) #1 *******(301): NTLMSoapClient->Update(Object(stdClass)) #2 {main} thrown in ********* on line 301
This is the code (php):
******
I know the code is correct and I have tried different ways such as Arrays and it has been the same problem, I'm very sure its a bug that I'm facing.
I would appreciate if anyone knows the solution to this problem
Kind Regards
Joeh Chan
Comments
Read the error message, it clearly says what is going on: "Sales Line already exists". Figure out what makes a sales line record unique. Analyze your code whether you are taking proper precautions not to insert records that already exist. Modify your code accordingly.
RIS Plus, LLC
Thanks for your feedback
The availability of fields via WSDL is limited and doesn't let you define a unique Line Order Number, and by my research it shows by design it auto-increments.
The code I have shown above has been taken from another person who used it successfully with SP1 but another build. My code using Arrays (similar way) presented the same error thus why I tried different peoples code as I thought I may have been doing it wrong.
When I realised that the two codes were providing the same error for me then I have then the assumption that the code is correct but the WS is working incorrectly.
If I am wrong please point me towards the correct direction because I already had consideration for that and spent the last 9 hours (mixture of today and yesterday) trying from different angles.
If you know a field which will let you define the Line number please let me know because there isn't one that I can see here:
From Sales Order Page
Or Here
From Sales Line Page
BTW: If you haven't noticed the code I posted in my previous post generates a new sales order and updates the details accordingly.
Thanks
Joeh
HostLive Limited
HostLive Limited
RIS Plus, LLC
-- Any thoughts Daniel?
HostLive Limited
I have better things to do than tell you how to do your job. Good luck finding the answers though.
RIS Plus, LLC
The only thing I said that I edited out was "I know how to read and thanks for telling me something I already knew" so there is no need to be too sensitive; verily it was encouraged about your arrogant answer of "I like your optimism, but when your code generates errors that is not very realistic is it" when it shows you didn't take the effort to read the code. If you've entered a post for non-constructive criticism don't expect a shy face, you can easily raise your post count else where.
Although you don't know of my background and knowledge doesn't justify a reply of "Read the error message.. ".
If you were really replying to help then you may have considered to read the code that I had put there (which was for a purpose) and maybe you would have realised what was trying to be achieved.
Just to correct your statement: "and the fact that you bump a post after 15 minutes, that tells me a lot about you", the topic had passed under several other posts and I was just trying to maintain its visibility.
I don't want to start on the wrong foot in this forum but consider yourself in my position, although I'm new here (which doesn't mean I'm new to programming etc.) I don't really expect that when I ask for help I'm told to basically work it out for myself (even though your answer was incorrect in this instance).
HostLive Limited
The BOM Quotation already exists, Identification fields and values:
quotation id='1009', document type='quote', line no.='10000',type='item',parent item no.='1000'
How to solve this one.
You need to first:
1.Create empty sales quote header and store key.
2.Use the Key to then populate the already created sales quote header + insert blank sales quote lines (with Type => Item ) and store new line keys.
3. Use a key per line to update the new lines with quantities & item codes.
HostLive Limited