You have specified an unknown variable error

IrishGiriIrishGiri Member Posts: 61
In the Purchase Header Table I want to edit some of the table fields. When I try to compile the table I get the following error:
You have specified an unknown variable.

Applies-to Bill No.

Define the variable under 'Globals C/AL symbols'.

It appears from looking at a backup of the database that this variable was field 7000000. The code in the table is full of references to this field. It must have been deleted by accident at some stage. I tried to copy the field from the backup to the current database but then I get an error saying my licence won't allow me to - I've tried changing the field no. but then I just get the original error above.

I can't modify this table now in the designer at all until I can somehow get the field that was deleted back in the current table.....HELP!!

Comments

  • aliennavaliennav Member Posts: 449
    IrishGiri wrote:
    In the Purchase Header Table I want to edit some of the table fields. When I try to compile the table I get the following error:
    You have specified an unknown variable.

    Applies-to Bill No.

    Define the variable under 'Globals C/AL symbols'.

    It appears from looking at a backup of the database that this variable was field 7000000. The code in the table is full of references to this field. It must have been deleted by accident at some stage. I tried to copy the field from the backup to the current database but then I get an error saying my licence won't allow me to - I've tried changing the field no. but then I just get the original error above.

    I can't modify this table now in the designer at all until I can somehow get the field that was deleted back in the current table.....HELP!!

    TRY SAVING THE VARIABLE with the no. ur license allows.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    IrishGiri wrote:
    In the Purchase Header Table I want to edit some of the table fields. When I try to compile the table I get the following error:
    You have specified an unknown variable.

    Applies-to Bill No.

    Define the variable under 'Globals C/AL symbols'.

    It appears from looking at a backup of the database that this variable was field 7000000. The code in the table is full of references to this field. It must have been deleted by accident at some stage. I tried to copy the field from the backup to the current database but then I get an error saying my licence won't allow me to - I've tried changing the field no. but then I just get the original error above.

    I can't modify this table now in the designer at all until I can somehow get the field that was deleted back in the current table.....HELP!!

    Firstly its almost impossible to delete this field if you can not create it, so I think that the issue is much bigger than just this field, (but thats just a guess).

    The field is part of an add on, and my guess is that you have restored a backup incorrectly, or created a new database without all the objects. Its really hard to say without knowing more.

    Anyway to fix the DB, you need to find the original Object (the purchase header from the Add-On), and merge it into your database. This is not a beginers task, so if you are not 100% sure how to do this, then you need some help, otherwise you can really mess things up. The merge function in Navision can be dangerous if used wrongly.
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Hmm I wonder if from code you can't delete a record in 2000000041 that you don't have permission to (Ahmed (ar3an) is the expert here, so maybe he will comment). If so, Find out who did it, and have them put it back the same way.

    Personally though I would create a data backup, and then restore Objects only from that good backup you have, then restore the current data back into that, and start clean.
    David Singleton
  • IrishGiriIrishGiri Member Posts: 61
    Thanks for your input. The current table has new fields over that in the backupspecifically in the range 50000....50020. I've already tried to add the Applies-to Bill No. field here as I am permitted to do but I get the same error. So, I assume the field no. must be 7000000 as before but that doesn't work either. What can I do?? If I merge an outdated table with a current table do I keep all the fields in the current table I have newly defined since previous backup while having the ability to import the field I want with field no. 7000000 that doesn't cause any problems in the backed-up version.......CONFUSED!
  • IrishGiriIrishGiri Member Posts: 61
    Also, there's the issue of data that resides in the table for the newly defined-fields that I don't want to lose should I have to merge......
  • David_SingletonDavid_Singleton Member Posts: 5,479
    IrishGiri wrote:
    Also, there's the issue of data that resides in the table for the newly defined-fields that I don't want to lose should I have to merge......

    Step one it to find out how the field was deleted. personally I think the issue may go a lot deeper than you think.

    Once you know how the field was removed, then you can decide the best strategy to put it back.
    David Singleton
Sign In or Register to comment.