Custom Programs and Queues

Chris Kelleher

Administrator
Staff member
How do you get custom programs into a queue without having to go through the "backdoor" so to speak.

Letron
 

Chris Kelleher

Administrator
Staff member
here's how i do it:

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
/*nightly*/

def var x-name like batchrpt.prog-name no-undo.
def var t as char format "x(20)" no-undo.

t = "NIGHTLY 1.1".

display
x-name no-label
with frame main title t centered.

set
x-name
with frame main.

create batchrpt.
assign
prog-name = x-name
prog-parm = ""
user-num = 29
que = "main"
batchrpt.stat = "Q"
req-date = today + 1
req-time = 36000
req-freq = "W"
rank = 1
init-date = today + 1
dest-type = ""
destination = ""
append-file = no
rpt-name = ""
.
[/code]

darrin.
 

Chris Kelleher

Administrator
Staff member
It is always easiest to use the standard include
files, lib/rpt-def.i, lib/rpt-opt.i, lib/rpt-open.i
and lib/rpt-cloz.i.Pick your favorite easy report
and dissect it. There is also a class and a book,
but it should be fairly simple to replicate a standard
report.

Patrick T. Gordon
Senior Software Engineer
Software Services
Symix Computer Systems, Inc.
Columbus, OH 43231
Phone: 614/523-7000
Fax: 614/895-1195
 

Chris Kelleher

Administrator
Staff member
This is a list of the steps I use to develop programs in SyteLine
(4.00.02), using the standard SyteLine include files. This makes the
screens look like the standard reports; and allows you to use the
background queues and printer defaults.
1. Open a copy of SyteLine and stay on Main Menu
2. Open a copy of SyteLine / Get into Process Query Editor
3. From Progress Query Editor write program. Needed components are:

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
def var RcsId as char init "$Header: item/itemrpt.p $".

{lib/rpt-def.i &name="ITEMRPT"}
{menu/g-permit.i """Item Maintenance""}
{menu/can-run.i}

assign record-desc = "@item"
menu-id = "std-im-rpt".

{lib/rpt-opt.i
&opt1=symex.ex-beg.item &type1=ch &at1="colon 40"
&opt2=symex.ex-end.item &type2=ch 7at2="colon 40"
&dest40="colon 40"
}

PROCEDURE do-PROCESS:
do on error undo, return:
run validate-destination.
end.
{lib/rpt-open.i}

for each symix.item no-lock where
{lib/rangcond.i &file=item &field=item &type=ch}:

display item.item
item.description
with stream-io frame f-item.

end. /* for each */

{lib/rpt-cloz.i}
end. /* PROCEDURE */
[/code]

4. Make sure all "Input" comands for report opt's say "input frame f-in"
5. Make sure all display "with's" say "with stream-io", if you are not
using a output stream

6. Select Compile / Check syntax
7. When syntax is OK; then run the following command from another buffer in
Query Editor
compile item/itemrpt.p save v6frame

8. Go into other SyteLine (Main Menu) session
- Check for / add sys-text record
- Add report to a menu or hot key
- Try running report
 

Chris Kelleher

Administrator
Staff member
Very nice Denise!

A few comments:

I see no need to init rcsid - they just need it for their purposes, so:
def var RcsId as char.

PROCEDURE do-PROCESS:
Here you missed the crucial line:
def input parameter p-text as ch no-undo.

Here is a wonderful trick I've been using for years on Symix and it works in
Syteline too :
form with frame f-in.

Put it at the top of any procedure referring to f-in variables - now you do
not need to include all these references to f-in!

Jake Kacher
 
Top