help please...messed up a form

TrintTrint Member Posts: 44
edited 2006-12-12 in Navision Attain
i'm a vs.net programmer. however, my boss wanted me to see if i could fix a navision program. we have several customers using navision, so i thought i would use what looked like an exact form to fix another database...i went to:
sales & receivables
orders
did object designer
selected form 573 and copied it...deleted the one in the other database and pasted the new 573 in its place...
now when i go to orders and select a new sell-to customer, and hit tab, i get this same little virticle screen...but when i select 'balance amount' or 'overdue amount' i get this error message:
"the form does not recognize the control 1"....
can anyone help me??
thanks,
Trint

Comments

  • eromeineromein Member Posts: 589
    Navision has something called subforms. This is a form displayed in another form. I think this is why you see the same things.

    To solve the missing controle issue, complile the forms that you have imported (copied). Goto object designer, select the forms, hit F11.

    If you don't know what form gives the error, compile all! Also compile all, if you're not quite know what you are doing. I second thought... compile all (no offence). Don't go compiling all objects (or only forms) when people are using the database. They will all get errors.

    If you don't get an error after compiling, things should be ok. If you do (i think you will) fix'm. I think you have to open the object, compile it again (F11) and Navision will jump to the problem. I think you have a field in the form that does not exists in the table. Delete this field. Compile again, and again, and again till no errors occur.

    Ooooooh, and tell you boss he isn't a smart man, putting a vs.net programmer to fix a problem in a live customer database.

    Good luck man, I realy hope you can fix this shit!
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • lakshmivallurulakshmivalluru Member Posts: 168
    Well Trint....what to say...... if u r clever, i would think u might have saved the form before u deleted.If the answer is yes, import that back and try to srot it.Any errors we r here to help u.

    Never import any objects from one customer database to another.This may overright the exixting functionality.And u need not delete the form if u want to import a new version.u can replace it instead.

    Good luck.
    LR
  • vnovikovvnovikov Member Posts: 2
    I have the same message. No subforms, no object import. Just a form with a lot of controls and code. Everything compiles Ok.
    The objects that cause problem are just textboxes and frames. when i comment the code, that refers to them, problem disapears. The code is not a problem cause ANY reference to the control compiles well, but causes error on form view. (For example: message(format(currform.txtA.height));))
    I think it's some internal error of Navision compiler.

    I have anotrher funny example of such error:
    EMPTY FORM with
    NO CONTROLS,
    NO VARIABLES,
    NO FUNCTIONS,
    NO TABLE RELATION.
    It compiles OK, but returns error "The form does not recognize control 1000000"
  • nelsonnelson Member Posts: 107
    I bet you are trying to do something in the OnInitForm trigger (before the controls are created).
    Change this code to the OnOpenForm trigger.
    Nelson Alberto
  • vnovikovvnovikov Member Posts: 2
    Yeah, I had "on init" code "currform.editable(true)". Removed it and all worked perfectly. This line did not refered to any controls, so I did not mind.
    Thanx a lot!
    (But another case with empty form does not have any code at all :( )
  • hendrihendri Member Posts: 3
    nelson wrote:
    I bet you are trying to do something in the OnInitForm trigger (before the controls are created).
    Change this code to the OnOpenForm trigger.

    I have the same problem also. My code is even put in onCloseForm(). I have try to put in OnOpenForm, onAfterGetRecord, etc.

    It still says it can't recognize the control
    CurrForm.Description.Activate := TRUE;
    
    Smile :D
  • SavatageSavatage Member Posts: 7,142
    Why would you activate OnClose?

    Maybe you can explain more what you are trying to do.

    Thanks
  • hendrihendri Member Posts: 3
    Eh... Nope that is not I want to do.
    Actually, I want to disable editing the control at onOpenForm
    CurrForm.Description.EDITABLE = FALSE;
    

    And make it editable again when some conditions are met when clicking button, etc.
    I found out If I REMOVE this line
    CurrForm.Editable = FALSE;
    

    I have no problem anymore. Why?
    Smile :D
  • SavatageSavatage Member Posts: 7,142
    hendri wrote:
    CurrForm.Editable = FALSE;
    
    I have no problem anymore. Why?

    Just look at it.

    Your making the form not editable with this code

    For example we use this to make a price EDITABLE for only Internet orders. For manually entered orders prices are NOT editable
    OnAfterGetCurrRecord()
    CurrForm."Unit Price".EDITABLE("Internet Order");
    
  • hendrihendri Member Posts: 3
    Is it the navision's rule/behaviour that If I put this
    onOpenForm()
    CurrForm.Editable = FALSE
    

    so what ever controls I specify would not be recognized by the form?

    By the way, I am a .NET/Java programmer, too. This behaviour really puzzles me a lot. :lol:

    I think there must be certain reasons why controls are not recognized when I specifiy the code above. :-k
    Smile :D
Sign In or Register to comment.