I have a part reserved on a Service Quote. When I go to make the service quote an order I get the following error: "The primary key in the reservation entry table can contain only one field, and its type must be integer".
I have looked into the action "Make Order" Action 33 on the Service Quote (Page 5964).
I have followed the code path to Code Unit 5922 then to Code Unit 5923 which calls a function ServLine.VALIDATE("Reserved Qty. (Base)",0);
This runs through each item that is on the service item worksheet. Once it finds a item that has a reservation the Validate piece stops and the next line does not run and the error is thrown.
But I haven't been able to trace where that is occurring or what is going wrong.
I could use some help being pointed in the right direction, or enlightenment on what I am missing.
Thank you,
dj
0
Answers
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I've not got NAV open right now so I can't check but it looks like the error is occurring on that line because the "Reserved Qty. (Base)" is a flowfield so when you validate a value in there NAV tries to create a new record in the related table. In this situation the table in the flow field expression (Reservation Entry in this case) must have a single integer field as the key.
You might think this is a strange thing but this is how budgets work in NAV - the budget amount is a flowfield, you adjust the value on the form/page and behind the scenes NAV creates additional records in the budget entry table.
Regards
Kishor
Thank you for your reply! Upon further investigation, it looks as though when I make a reservation from the Service Quote (Service Item Worksheet) it sets the Source Type to Database::"Service Line" (Which I would expect), Source SubType to DocumentType (which I would expect) and the source id to Document No. [Page: 498, Line Number: 427, Function: SetServiceLine] (this is done with out first scrubbing the "SQ" from SQ00000 when the doc type is quote.)
My question is, should I change the way nav enters quotes into the reservation entries table?
Thank you,
dj
My previous assumption was incorrect. Upon pressing Make Order, I still get the error: "The primary key in the reservation entry table can contain only one field, and its type must be integer"
I modified the Quote numbering sequence to remove the SQ prefix, and the clicked make order. This did not change the way the error was represented.
After looking at the table "Reservation Entry" 337, the primary keys look to be "Entry No." and "Positive" (I looked in SQL Server Management Studio).
At this point I am at a loss, I can test what is causing the issue by removing the validation in CodeUnit 5923, Function OnRun, Line Number 18, ServLine.VALIDATE("Reserved Qty. (Base)",0); However, this is not a fix and is only a hack.
My hope is to understand the root cause and fix the primary issue.
Thank you,
dj
It could be that MS want to error if there are any reservations against the service line but in that case they should have used a TESTFIELD instead of a VALIDATE. It's definitely a bug in standard NAV - I'd suggest you raise a support case with Microsoft.
Having said that I've looked at the code and that part of the code is just checking stuff but further down the code there is some code which moves any existing reservations against the service quote to the service order so I would suggest...
a) Remove the offending VALIDATE line and test to make sure reservations are transferred over to the service order correctly (it looks like it should be OK)
- OR -
b) Change it to a TESTFIELD in which case you will still get an error but it will be a bit more meaningful. In this case the user would need to manually cancel the reservations against the quote first, convert to an order and then re-create against the order.
I'd definitely suggest option a) to begin with.
P.S. Looks like the issue has been there for a while - it was in ver 5 and is still in 2016.
Thank you for your replies, that makes a lot of sense. When I comment out the validate section, I am able to move through the process of converting to an order.
You are correct, there have been changes to native nav to allow for reservations through quotes, the client's process dictates they reserve and even order parts during the quote stage to maintain their SLAs with their clients.
My concern with the removing of the validation is the potential for other errors that could emerge because of this change.
If you were in my situation, would there be any specific areas you see for concern?
Thank you,
dj
Thank you! I really appreciate your insight!