Batch Post Questions?

emulsified
emulsified Member Posts: 139
I would like to at the end of each day do a BATCH POST only for Sales Invoices (SIO) that have the "Package Tracking No." field populated.

Can anyone point me in the direction on how this can be done.

I am assuming it would involve making a modification to the 'Batch Post' CODEUNIT to only post SIO documents with a "Package Tracking No." field that is not blank.

And how can this be made to run at a specified time without user intervention?

Any help would make my headaches go away sooner...
Half-empy or half-full how do you view your database?

Thanks.

Comments

  • David_Cox
    David_Cox Member Posts: 509
    Simple filter will do for this no change required.

    Just run the Batch and where the column titled Field, drill down and select "Package Tracking No." then in the column titled Filter add <>'', this will now only process the documents where the "Package Tracking No." is not blank.

    After the first run the field will appear for filtering, next time you run it.

    You could also add the field to the report 279, item, Sales Header, properties, ReqFilterFields = No.,Status, Package Tracking No.
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • David_Cox
    David_Cox Member Posts: 509
    :oops: Read it again!

    Create a processing report, use the Integer table, filter, Number = CONST(1),with 2 variables Sales Header and Report 279 filter the SalesHeader as required, see code for minimum filters:

    Sample untested code something like this
    SalesHeader.RESET;
    SalesHeader.SETRANGE("Document Type",SalesHeader."Document Type"::Invoice);
    SalesHeader.SETRANGE(Status,SalesHeader.Status::Released);
    SalesHeader.SETFILTER("Package Tracking No.",'<>''''');
    IF SalesHeader.COUNT <> 0 THEN BEGIN
       CLEAR(BatchPostSalesInv);
       BatchPostSalesInv.SETTABLEVIEW(SalesHeader);
       BatchPostSalesInv.USEREQUESTFORM := FALSE;
       BatchPostSalesInv.RUN;
    END;
    

    Then you would need to Purchase the Job Schedule granule to run the new report un-aided, this also would require an open session to be running.
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • emulsified
    emulsified Member Posts: 139
    :-k I get the idea but seem to be missing a few steps.

    Here's what I did so far:

    Object Designer -> REPORT -> New

    DataItem Name
    Integer <Integer>

    I get lost here:

    filter, Number = CONST(1),with 2 variables Sales Header and Report 279 filter the SalesHeader as required
    Half-empy or half-full how do you view your database?

    Thanks.