Sage 100

 View Only
  • 1.  Can a batch created by Visual Integrator be marked

    Posted 01-26-2018 13:08
      |   view attached
    Can a batch created by Visual Integrator be marked as ""Private""? It's going to be auto-posted and I don't want users opening / editing / posting the automated batch by mistake.


  • 2.  RE: Can a batch created by Visual Integrator be marked

    Posted 01-26-2018 13:37
    Hmm I don't think so unless you did something like this (haven't tested this so don't shoot messenger): 1. Click on Perform button and choose On Execution. For Command, point ot to a file like ..\CM\Script\PvtBatch.pl 2. Create a text file called PvtBatch.pl with this in it: ! the ! symbol a.k.a. bang symbol means comment line in ProvideX ! 2nd arg is Private Batch flag ! 3rd arg is Batch Comment IF NUL(%NewBatch4Kev$) { coBusiness'SelectNewBatch(%NewBatch4Kev$, ""Y"" ,""Batch Comment is 3rd arg"") } EXIT 3. On the Data tab, you would add H.BatchNo and place it at the top. Operation = Calculated and Calculation = %NewBatch4Kev$ What I don't know is if On Execution if the main business object (represented as coBusiness just like oBusObj) has been instantiated already. If not try After Read instead and if you have to do that, verify a new batch doesn't get created for each record (shouldn't).


  • 3.  RE: Can a batch created by Visual Integrator be marked

    Posted 01-26-2018 14:46
    Thanks Alnoor! I'll test this next week and see if I can get something to work (with a lot of that code being foreign to me). Note: I don't need an auto-batch #, as I'm hard coding it (with multiple imports into the same batch... and it is necessary to have a specific batch # for the auto-posting settings within Task Scheduler, so I don't auto-post user batches).


  • 4.  RE: Can a batch created by Visual Integrator be marked

    Posted 01-28-2018 22:26
    I (boldly) presume then you will be re-using the very same Batch No each time the Task Scheduler job runs. In that case you can hard code it right in the Perform with this slight twist: %SameBatch4Kev$ = ""TASKB"" ! to represent Task Scheduler batch No or whatever you want here retVal = coBusiness'SelectNewBatch(%SameBatch4Kev$, ""Y"" ,""Created by Task Scheduler job"") ! If batch exists already no problem as SelectNewBatch will select it as an existing batch EXIT On Data tab, place H.BatchNo at the top, Operation = Calculated, and Calculation = %SameBatch4Kev$ On Configuration tab, click Perform button. For Perform Type, either choose After Read OR Before Assign on Header of BatchNo column. Just see which one works out better. If you run into trouble, send me a chat.


  • 5.  RE: Can a batch created by Visual Integrator be marked

    Posted 01-30-2018 06:46
    It seems so simple to read, but I'd have never come up with the pl. Thanks again!


  • 6.  RE: Can a batch created by Visual Integrator be marked

    Posted 01-31-2018 15:03
    FYI, when implementing on the customer system the pl didn't set the correct batch # on the first couple records. Entering a default value for BatchNo, matching the value set within the pl, fixed that.


  • 7.  RE: Can a batch created by Visual Integrator be marked

    Posted 01-31-2018 17:35
    Very interesting the ole default value coming into play. It's always about figuring out the timing about what things fire off when. Well done!


  • 8.  RE: Can a batch created by Visual Integrator be marked

    Posted 06-19-2019 11:45
    I had this same experience borrowing the PL

    I had to use one BATCH assign to whatever the batch number was being set to
    The immediately following I added the BATCH again and used calculated as per Kevin's screen above

    If I didn't do that I got one batch that seemed like a sequential number and Sage would create a batch ( with totals ) but sometimes blank ( if the batch was only holding one entry )


    ------------------------------
    Wayne Schulz - Schulz Consulting - 860-516-8990
    ------------------------------



  • 9.  RE: Can a batch created by Visual Integrator be marked

    Posted 06-19-2019 14:08
    I posted that as an untested quick and dirty reply, as something to try. Clearly it's a timing issue. You've got it working so don't fix it but it sounds like the Perform should be moved to either the Job Execution or After Read event, both of which run before the Before Assign of BatchNo.

    ------------------------------
    Alnoor Cassim

    Free Agent Developer and Consultant
    CallForHelp.biz
    Email: alnoor@callforhelp.biz
    Orange County, CA
    ------------------------------