How to an option always appears non-market on run report

markyT
markyT Member Posts: 120
Hello, I think this/s easy. I've a report with an option on request form. Each time that I mark the option it remains marked for the next time. Is there any way to this option always appears non-market on run report?.
Thank you.

Comments

  • Savatage
    Savatage Member Posts: 7,142
    Go into the designer

    View->Request Form->f9

    add code
    on init or onopenform..(didn't test)
    Myoption := Myoption::"Non-Market"; or whatever the option is called.
  • DenSter
    DenSter Member Posts: 8,307
    You could also try turning off all the save options on the request form.
  • garak
    garak Member Posts: 3,263
    DenSter wrote:
    You could also try turning off all the save options on the request form.


    <- thats also possible, but markyT doen't forgett,if you have other controls on the req.form, where the user can define anything and this should be stored for the next run, these are also be reseted to the "default"
    Do you make it right, it works too!
  • markyT
    markyT Member Posts: 120
    Thanks both for reply. Both options are ok; but in case: Myoption := Myoption::"Non-Market"; what function is "Not-Market", you mean True or false or so?.
    Thanks for help.
  • garak
    garak Member Posts: 3,263
    What Harry mean is:

    1. Option Variable like "MyOptionVar" with Options " ,Option1,Option2"
    2. On the RequestForm a textBox or RadioButtons with the SourceEXPr = MyOptionVar
    3. OnInit() MyOptionVar := MyOp0tionVar::"";

    So, the Option BLANK is ever the default.
    Do you make it right, it works too!
  • markyT
    markyT Member Posts: 120
    Perfect!!, well, ni my case it's a boolean type, then I've put "no" and It runs perfectly, and it goes on OnOpenForm.
    Thanks both for help.
  • DenSter
    DenSter Member Posts: 8,307
    That trigger will work, but in my opinion a better place for this type of thing is the OnInitReport trigger. Make it a habit to always put variable initialization for reports in that trigger, and your objects will be cleaner and easier to maintain. Then use the OnPreReport to process variables from the request form. Use form triggers only for display code.