Pass variable from a function to a button

LeoNavLeoNav Member Posts: 55
Hi,

I call a function on a form X :
F_JobList.FCT_Selection("Qualification Code");

The function is set up on my form Y. I have a button on this form Y. How can I pass a value from the function to the onpush() trigger of the button ? The goal is to pass the value of CodeFiltre to the button when I push it.

Here is my function FCT_Selection:


FCT_Selection(CodeFiltre : Code[10])
CLEAR(F_JobList);
F_JobList.SETTABLEVIEW(T_Job);
F_JobList.SETRECORD(T_Job);
F_JobList.LOOKUPMODE(TRUE);

IF F_JobList.RUNMODAL = ACTION::LookupOK THEN BEGIN
  CurrForm.SETSELECTIONFILTER(Rec);
  MESSAGE('CurrForm <%1>',Rec.COUNT);
END;

Answers

  • SogSog Member Posts: 1,023
    you call the function in your on_push trigger, the return value is available to you.
    edit:
    I really have to read better.
    Anyway, you cant call a onpush function. But if you want the return value made available in your trigger. You'll have to have a function in your form Y that sets a global var to the return value. Something like this
    function transfer(myreturnvalue)
    globalvalue := myreturnvalue;
    
    in your Y-form.
    In your x-form you have code like this: yform.transfer(myveryownfunction)
    In your onpush trigger you can make use of this global var.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • LeoNavLeoNav Member Posts: 55
    Yes, it works fine. Thanks a lot. :D :thumbsup:

    LeoNav
Sign In or Register to comment.