Message Boards

Actual date in batch detail

Edward Visser, modified 3 Years ago.

Actual date in batch detail

Post Date: 1/5/17 (Silver, 44 Posts) Recent Posts

Can someone tell me if it is possible and, if so, how to put a value in a date field when I'm placing the process in a batch?

To be more precise : We want so run 7.9.5 (Pre-Shipper/Shipper Confirm (rcsois.p)) in batch. However, in this form the shipment date and begin date are requested.

If I fill in the date of today, then this value will be in the batch detail record and so tomorrow the program will be ran with the date of today, and the day after tomorrow, etc. it will be ran everytime with the date of today. How can I prevent that? Can I enter a letter ("H" or "W" of "A") or something like that?

thumbnail
Xavier Pechadre, modified 9 Years ago.

Re: Actual date in batch detail

Post Date: 1/5/17 (Silver, 70 Posts) Recent Posts

Hello,

Perhaps in EE version ( for letter H or .. ). We are in QAD SE 2012. When you run a program in a batch you create records in bcd_det table. You can modify these records ( by a program each day in another batch ) to change the date. We do that for invoices.

Best regards. 

 

 

Edward Visser, modified 9 Years ago.

Re: Actual date in batch detail

Post Date: 1/5/17 (Silver, 44 Posts) Recent Posts

Hi Xavier,

We're still in the middle ages (v9.1E). That's an interesting approach, just fooling the system. Every day you run an program to change the date in the bcd_det-record.

Thanks for this useful advice!

Greetings,

Edward

René van Diemen, modified 9 Years ago.

Re: Actual date in batch detail

Post Date: 5/10/17 (Bronze, 2 Posts) Recent Posts

Hallo Xavier,

Can you explain in more detail what you did to have the posting Invoice program running in batch with the actual date ?

We have QAD EE2015

Edward Visser, modified 9 Years ago.

Re: Actual date in batch detail

Post Date: 5/11/17 (Silver, 44 Posts) Recent Posts

Good morning René,

I'm certainly not a programmer, but this is how I solved it finally.

I've created a form to run the program, because I didn't know another way to get this program (that on it's turn modifies the batch detail line) run in a batch. And this is what you want, because when it's in the same batch, but with a higher priority, you arrange that the requeste batch detail line is always with the actual date). The "runok = true." at the end is to set that parameter right to get the line ran again. Hope it helps you.

{mfdtitle.i "ddm a"}

FORM
with frame a SIDE-LABELS width 80.

UPDATE
WITH FRAME a.

/* SELECT BATCH */
{mfselbat.i}

DEFINE VARIABLE sbcd_parm AS CHARACTER FORMAT "x(85)".
sbcd_parm = CHR(34) + "1" + CHR(34) + " " + CHR(34) + "S" + CHR(34) + " " + CHR(34) + CHR(34) + " " + CHR(34) + " " + CHR(34) + " " + CHR(34) + "ja" + CHR(34) + " " + CHR(34) + "ja" + CHR(34) + " " + CHR(34) + STRING(TODAY) + CHR(34) + " " + CHR(34) + STRING(TODAY) + CHR(34) + " " + CHR(34) + STRING(TODAY) + CHR(34).
FOR EACH bcd_det WHERE bcd_batch = "edi3" AND bcd_exec = "rcsois.p 7.9.5" EXCLUSIVE-LOCK.
bcd_parm = sbcd_parm.
bcd_process = TRUE.
END.

runok = true.

thumbnail
Xavier Pechadre, modified 9 Years ago.

Re: Actual date in batch detail

Post Date: 5/11/17 (Silver, 70 Posts) Recent Posts

Hello,

Your program.

for each bcd_det where (bcd_batch = "permanen" or bcd_batch = "lundi" )  and

    bcd_exec begins "w1sorp10.p" 

    and bcd_domain = global_domain:

        v-place = index(bcd_parm,"/").

        v-date = substring(bcd_parm,v-place - 2, 8).

        v-chaine = replace(bcd_parm,v-date,string(today)).

        bcd_parm = v-chaine.

end.

Best regards.

 

 

 

Message place holder