Error during inserting a record in table

SupSup Member Posts: 11
Hi,
I have created two tables. And created a codeunit in which I try to insert values into these tables.
I get the following error:
You cannot make any changes to the database until a transaction has been started.

Any idea why I am getting this error? Do I need to set some properties on the table or CodeUnit?

Thanks & Regards,
Sup

Comments

  • SupSup Member Posts: 11
    Now it works when I run it independently but when I try to call this CodeUnit from form 10038 - Sales Order Stats then it gives me that error.
    You cannot make any changes to the database until a transaction has been started.

    Thanks & Regards,
    Sup
  • krikikriki Member, Moderator Posts: 9,118
    #-o That is a new one! Is this word-by-word and character-by-character the error Navision shows?
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • jelias56jelias56 Member Posts: 10
    YES..
    I know this is an old posting but I got the samw error. I consulted with two other developers who had never heard of it. The solution was to move my code away from the OnInitDataport trigger to the OnPreDataport trigger.
    Don't blame me. It's the hardware.
    j
  • thaugthaug Member Posts: 106
    I've seen that error before, and what you did to solve it is what I did to solve it. It was a stupid coding mistake on my part.
    There is no data, only bool!
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Thaug and Jelias56,

    can you please describe the error and the solution so that others can avoid this problem? And then maybe put [SOLVED] in the topic?
  • RuleRule Member Posts: 34
    I think he had put the code in a wrong trigger.
    It think it is not possible to write data in a table on the onInit trigger.

    Correct me if i'm wrong
    Realisations are only limited by the borders of imagination
Sign In or Register to comment.