Error calling function on subform

ECEC Member Posts: 56
Hi.

I'm trying to call a function on a subform. However I'm receiving the following error "Form 0 does not exist".

I have given the subform a name and I have created a function in the subform.

Any helt appreciated.

/EC

Comments

  • jhoekjhoek Member Posts: 216
    Usually, I think, this error occurs when calling FORM.RUNMODAL(0, MyRecord) without setting LookupFormID in the MyRecord table. Is that perhaps the case here?
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • ECEC Member Posts: 56
    No.

    I'm calling
    CurrForm.theSubForm.FORM.MyFunction
    
    and this causes the error when trying to compile.

    /EC
  • jhoekjhoek Member Posts: 216
    Did you perhaps forget to set the SubFormID of your subform control?!
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • ECEC Member Posts: 56
    No, I have entered the subformID.

    /EC
  • kinekine Member Posts: 12,562
    In which trigger are you calling this function? You cannot call the function in OnInit (subform is not inicialized yet)...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ECEC Member Posts: 56
    It doesn't matter in which trigger I place it. The same error occurs.
Sign In or Register to comment.