Service Quote Make Order Error

derekj22
Member Posts: 16
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
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
Best Answers
-
No, that seems fine, it's just the line that is causing the error is very strange and shouldn't be there.
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.5 -
EDIT: It's just occurred to me...you can't reserve against service quote lines (not in standard NAV anyway) - that's why that line of code has never caused any problems before. It looks like there has been some customisation to allow for reservation against quotes - they just forgot to test through to converting to an order.5
Answers
-
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi Derek,
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
Kishor0 -
@Kishorm
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,
dj0 -
@Kishorm
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,
dj0 -
No, that seems fine, it's just the line that is causing the error is very strange and shouldn't be there.
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.5 -
EDIT: It's just occurred to me...you can't reserve against service quote lines (not in standard NAV anyway) - that's why that line of code has never caused any problems before. It looks like there has been some customisation to allow for reservation against quotes - they just forgot to test through to converting to an order.5
-
@Kishorm
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
0 -
No, I have no concerns removing that statement. Like I said just test to make sure the reservations get transferred across to the order correctly.1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions