Which code is Execute when I click OK & New on a card page

I have written a code on OnQueryClosePage trigger it works. But the problem is when I click OK & New button that time OnQueryClosePage  trigger not executed.

Please suggest your opinion which trigger gets execute when users clicks OK & New button instead of New button.

  • Hello,

    try putting the code also in the OnNewRecord, OnFindRecord and OnNextRecord.

    best regards,

  • In reply to THomas Barbut:

    Thanks thomos,

    I tried but OnNewRecord and OnNextRecord those triggers are executed but I trying to check some mandatory fields on close page.

    Thanks & regards,

    Pravin Deore.
  • In reply to Pravin Deore:

    Ok, do this.
    Create a variable for the form and in the record type select form/page, in the form/page create a function Set parameter to the variable record, whichever record you are referring to and the code will be like below

    Variable Data type Value
    ChangeStatusForm Form/Page Production Order

    In Changestatusform new function
    Set(ProdOrder);

    ChangeStatusForm.Set(Prodorder);
    IF ChangeStatusForm.RUNMODAL() = ACTION::Yes THEN BEGIN
    (Your Code)
    end;
  • In reply to sbhatbng:

    Thanks sbhatbng,

    I have written code on default customer card.


    Thanks & regards,
Related