Tuesday, April 14, 2015

Adding print button on runBaseBatch dialog

Take a look at class 'CustPrintOutInvoiceJob'

Sunday, April 5, 2015

copy recurrence data from previous batch job

static void main(Args args)
{
    AutoReserveTransferOrdersBatch    autoReserveTransferOrdersBatch;
    batch                                                  batch;
    BatchJob                                            batchJob;
    SysRecurrenceData                            sysRecurrenceData;
    ;
   //Batch Job class declaration probably of type RunBaseBatch
   autoReserveTransferOrdersBatch = AutoReserveTransferOrdersBatch::construct();
 
  //Selection of existing batch job
    select firstOnly batchJob order by RecId desc
        join batch
        where batchJob.RecId == batch.BatchJobId
            && batch.ClassNumber == classnum(AutoReserveTransferOrdersBatch);
    if(batchJob)
    {
        sysRecurrenceData = batchJob.RecurrenceData;//Getting the Recurrence data
    }
   //Running second batch job
    if (autoReserveTransferOrdersBatch.prompt())
    {
        autoReserveTransferOrdersBatch.run();
    }
    batchJob.clear();
    batch.clear();
    //Adding the recurrence to the second batch job
    ttsbegin;
    select forupdate firstOnly batchJob order by RecId desc
        join batch
        where batchJob.RecId == batch.BatchJobId
            && batch.ClassNumber == classnum(AutoReserveTransferOrdersBatch);
    if(batchJob && sysRecurrenceData)
    {
        batchJob.RecurrenceData = sysRecurrenceData;
        batchJob.update();
    }
    ttscommit;
}

Thursday, April 2, 2015

Sales order picking list posting

reference: