Request Form Permissions

b2amolb2amol Member Posts: 64
Hi,

Just wondering how permissions on request forms (for report) are controlled. All my reports have run permission for all roles, but some users dont see all check-box options on request form. Checked corresponding tables & granted permissions, but that doesnt seem to help.

Second, is it possible to have default values for controls in request forms? For a check box as an example, which property can be used for default?

Thanks,

Amol

Comments

  • kapamaroukapamarou Member Posts: 1,152
    b2amol wrote:
    Just wondering how permissions on request forms (for report) are controlled. All my reports have run permission for all roles, but some users dont see all check-box options on request form. Checked corresponding tables & granted permissions, but that doesnt seem to help.

    If you can, check the C/AL code on the request form to see if there is any logic there.
    b2amol wrote:
    Second, is it possible to have default values for controls in request forms? For a check box as an example, which property can be used for default?

    You can do this with code but I prefer to set the property of SaveValues in order to keep the settings of the last run.
  • dorenthasdorenthas Member Posts: 31
    kapamarou wrote:
    b2amol wrote:
    Second, is it possible to have default values for controls in request forms? For a check box as an example, which property can be used for default?


    You can do this with code but I prefer to set the property of SaveValues in order to keep the settings of the last run.

    I'm not sure I'd say SaveValues really solves this problem. It does - so long as you don't change the values of the request form. Doing so would cause the previous value to be "forgotten" and institute a new, misnamed "default value".

    There might be reasons to populate the request form fields through code. For instance, you might want the fields to always have a given value by default. In this case, a solution would be to set the values in the Request Form when it is opened (in either the OnOpenForm or OnInit trigger).

    Another reason might be to have default values determined by circumstances - based on the user, on values in a table or form, on a workflow, etc. A solution for this would be to add an initialization function to the report that takes as parameters the "default values" and assigns them to the Request Form controls. Then you just need to call this function prior to running the report.

    E.g.
    MyReport.InitializeControls(MyValue1, MyValue2);
    MyReport.RUNMODAL();
    

    Strangely, I recently ran into a report (that my Customer license doesn't let me modify because of permissions issues) that has an initialization function defined, but it doesn't work - I suspect it's because the SaveValues property of the report is set to Yes, and it causes the values set with the initialization function to be overwritten by the saved values when the report is opened. If I'm right, then it means the SaveValues property has a big flaw that makes it prevent using code-driven initialization.

    Has anyone ever encountered a similar issue or can confirm this behavior?
Sign In or Register to comment.