Order No on posted purchase invoice

Fommo
Member Posts: 138
Hi
I've searched for an answer, but found none about this.
When I post an invoice from the order card I get the order no. field on the posted invoice automatically. This is used to list all the posted invoices for the purchase order (accessed from the order menu button).
However, if I create the purchase invoice manually on the purchase invoice card and import the order lines to it, I wont get the order number in the "Order No." field. I guess this is quite logic since I can import lines from different orders that way.
But, I still wanna do it. We have a product that creates invoices in NAV from outside and connects them to orders. And in those cases where only one order is connected I wanna have the "Order No." field so they can be listed from the order card.
When I assign the field in Purch. Inv. Header table I'm allowed to do it with our developer license, but when the customer runs my code with their own license they get a permission error.
Is there any way to accomplish this, is there perhaps some codeunit that allows such a change on posted invoice?
Best regards
/Simon
I've searched for an answer, but found none about this.
When I post an invoice from the order card I get the order no. field on the posted invoice automatically. This is used to list all the posted invoices for the purchase order (accessed from the order menu button).
However, if I create the purchase invoice manually on the purchase invoice card and import the order lines to it, I wont get the order number in the "Order No." field. I guess this is quite logic since I can import lines from different orders that way.
But, I still wanna do it. We have a product that creates invoices in NAV from outside and connects them to orders. And in those cases where only one order is connected I wanna have the "Order No." field so they can be listed from the order card.
When I assign the field in Purch. Inv. Header table I'm allowed to do it with our developer license, but when the customer runs my code with their own license they get a permission error.
Is there any way to accomplish this, is there perhaps some codeunit that allows such a change on posted invoice?
Best regards
/Simon
0
Comments
-
Fommo wrote:When I assign the field in Purch. Inv. Header table I'm allowed to do it with our developer license,
can you explain exactly what you have done here?0 -
Permissions in customer licenses usually don't allow any modification of postingtables.
To make modifications in posting tables under said license is because the objects used to modify those tables (codeunits in general) have permissions assigned to them that superseed the license.
Check codeunit 80's propertie "permissions" for an example.
It appears that you've written your code to modify the header in an incorrect location.
The best would be to modify the posting routine (in your scenario, not in general!) But then you'll really have to know what you are doing.
The next best thing is to write your own codeunit that you'll call right after the posting routine and assing the modify permission to the table in question: purchase invoice header. (Warning: assigning permissions to an object is limited to the permissions in the license, so use your dev license to assign those)
It's not recommended to set these kind of permissions on tables.0 -
Sog wrote:Permissions in customer licenses usually don't allow any modification of postingtables.
To make modifications in posting tables under said license is because the objects used to modify those tables (codeunits in general) have permissions assigned to them that superseed the license.
Check codeunit 80's propertie "permissions" for an example.
It appears that you've written your code to modify the header in an incorrect location.
The best would be to modify the posting routine (in your scenario, not in general!) But then you'll really have to know what you are doing.
The next best thing is to write your own codeunit that you'll call right after the posting routine and assing the modify permission to the table in question: purchase invoice header. (Warning: assigning permissions to an object is limited to the permissions in the license, so use your dev license to assign those)
It's not recommended to set these kind of permissions on tables.
Thanks a lot for the explaination. I've never used permission modifications like that. I'll try it out and come back to you.
As for the previous question about more details of what I've done, I only made a simple assignment of the PurchInvHeader."Order No." field in my integration codeunit, that worked perfectly with the developer license, but obviously not with the customer one.
I'll try to look up the permission modifications now.0 -
Wow, it worked like a charm. Thanks a lot! =D>
You always learn something new on mibuso.
I realize this makes my codeunit more powerful and I should be aware of not putting the CU in wrong hands. But the customer would need a dev. license to change in it anyway.0
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