Order No on posted purchase invoice

FommoFommo 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

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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?
  • SogSog Member Posts: 1,023
    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.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • FommoFommo Member Posts: 138
    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.
  • FommoFommo Member Posts: 138
    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.
Sign In or Register to comment.