Options

Close Form

rajinivmrajinivm Member Posts: 42
Dear All,
How can I close a form from another form?
We have two forms Form A and Form B
1. I opened A
2. I opend B
3. Now I want to close a Form A from Form B.

Thanks,
Rajini

Comments

  • Options
    Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    If you have used
    FORM::RUN(FORM::"FormName")
    
    in C/AL code, or the form is opened automatiaclly by clicking lookup or drill down then you can't (without using any tricks).

    If you have used
    FormVariable.RUN
    
    then you can create new function on that form containing CURRFORM.CLOSE, and then close the form by calling that function.

    Regards,
    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • Options
    rajinivmrajinivm Member Posts: 42
    Thanks for your response....
    We derived logic for closing forms using On Timer Trigger

    Form A - Button On Push Event
    1.Form B is opend from From A - FORM.RUN(43,rec)
    2.Create Global Variable:=TRUE;
    3.FORM A.VISIBLE:=FALSE; (Optional)

    Form A - Ontimer Trigger - Timer Interval =5
    IF Global Variable=TRUE THEN
    CurrForm.CLOSE;

    Regards,
    Rajini
  • Options
    garakgarak Member Posts: 3,263
    you can also use the same principle like on "update mainform from Subform".
    viewtopic.php?f=23&t=22564

    this example you can also use for your "problem". so you doens't need the timer
    Do you make it right, it works too!
Sign In or Register to comment.