Set options on report requestform via code?

dlerouxdleroux Member Posts: 87
Basically, I have a need to batch post Purchase Orders that meet certain critera. I have no problem setting this up in code, but what I need to do is force the report (496) to always set the "Receive" and "Invoice" option on the report to True. (This is something which can not be trusted to the operator)

Basically, what I have now is something like this:

// rptBatchPO is defined as report 496
// POhdr is defined as record for the Purchase Header table

POhdr.RESET;
POhdr.SETFILTER(field1, value1);
POhdr.SETFILTER(field2, value2);
rptBatchPO.SETTABLEVIEW(POhdr);

rptBatchPO.RUNMODAL;

I do not seem to have access to the option values on the request form. Can anyone give me some pointers on how to set these - or tell me if it is "unpossible"?

Thanks in advance

Comments

  • SavatageSavatage Member Posts: 7,142
    go to the report using the designer

    Vew->Request Form->View C/al Code

    OnOpenForm()
    ReceiveReq := TRUE;
    InvReq := TRUE;

    plus any other changes you need.

    Maybe Like
    "Posting Date" := TODAY;
  • dlerouxdleroux Member Posts: 87
    That should do the trick - I have this great reluctance to modify anything relating to the posting routines which is probably why I did not think of going there. I think I'll make a copy of the report and modify it just to be safe.

    Thanks
  • SavatageSavatage Member Posts: 7,142
    that will not modify any posting routines. what it will do is place the checks in the boxes so the user doesn't have to - or if they forget.

    Works like a charm for us.
Sign In or Register to comment.