Codeunit Error

rnjbngrnjbng Member Posts: 82
Hi -

I have a very simple codeunit 50010 in which I am just inserting a record into table 5071 Campaign. When I run this code I get an error
'You do not have the following permission on Codeunit Insert Campaign::Execute'

Now, In the

User table --->Permission Set-->I have Super assigned and the company field is left blank.
In Codeunit 50010 I went to permission and have given indirect permission of Read, modify, Insert and Delete.
In SQL I have DBowner, Sysadmin and all SUPER permission as per other forums description about this exact error message.

My question is can't I create any codeunit with a Partners Developers license and has something changed in NAV 2016 with regard to codeunit creation using Partners Developers license.

Any help is highly appreciated.

Thanks
RS.

Answers

  • Peter+is1Peter+is1 Member Posts: 174
    Hi,

    As far as I know (and in my own experience) nothing has changed in creating codeunits with 2016.
    Have you tried in a fresh cronus?

    Good luck.
    \\
    The truth exists in seven versions.
  • rnjbngrnjbng Member Posts: 82
    Yes, even with Cronus I get the same error. One thing I noticed though is that if you create a codeunit within the customers license range then you don't get the error. You get this error only if you create a codeunit outside customers license range say the customer does not have license for codeunit 60001 and you create a codeunit 60001 using a developers license and run the codeunit you get the error.

    Has Microsoft changed the developers license ability to create objects only within the customers license range. Not sure if this is true.

    Thanks
    RS.
  • KishormKishorm Member Posts: 921
    It's not a problem with creating the codeunit but a problem running it. Although you are creating the codeunit with the developers licence in the Dev environment, when you run the codeunit it is running using the license installed in the database I.e. the customers license.
  • CodeViperCodeViper Member Posts: 28
    i am receiving this type error also. built a record insertion codeunit in the 50k range, tested it locally (direct copy of clients db) and it worked fine.
    put it in the clients db (test db) and loaded our dev license, ran it and get the error "you do not have the following permissions on Codeunit xxxx::execute".

    I have checked permissions, permission groups, running as same user in both databases as (SUPER)... even tried renumbering the object in the 60k, 70k, 80k and 90 range.

    Kishorm, you say its the Customers licence...
    When it runs, I look at the Help>About and it shows our dev license as being what its running with...

    almost at wits end on this one...

    Aaron
  • CodeViperCodeViper Member Posts: 28
    Additional comment: it MUST be some sort of license thing. My custom codeunit was numbered 50009 and would throw the error listed above.

    BUT... I changed the codeunit number to 50005 and it ran fine...

    rnjbng... try moving the codeunit to a lower number... *fingers crossed for you*
Sign In or Register to comment.