Sage 100

 View Only
  • 1.  How to get Next Transaction Number in Work Order Transaction Entry import

    Posted 05-07-2019 13:23
    Edited by Alnoor Cassim 05-07-2019 14:56
    For client on 4.50 Advanced creating a V/I import into W/O Transaction Entry. For the TRANS_NUMBER is there a way to get the Next Transaction No from W/O Options? Operation = Next in the Data tab doesn't appear by default so I tried defining the NEXT ON value in the Records tab after unchecking the box for Header Information Included in Detail Line. My memory tells me this was the traditional way of exposing Next as a choice for the Operation.

    However, there is no way to define the NEXT ON in Records tab ergo no way to choose Operation = Next. Also I cannot File Assign it. Am I missing something obvious? This happens to be for Release transactions where the import goes into WO.TXREL but same issue with importing into regular WO.TRNSENT file (for Material Issues, Labor, etc)
    #VI #WO​​​

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

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


  • 2.  RE: How to get Next Transaction Number in Work Order Transaction Entry import

    Posted 05-10-2019 02:19
    I don't have a version that old so "Operation = Next" works for me in v2018.2. I attempted to try another route by using perform logic in the before assign event calling the same program and statement used by the transaction entry ui object, "../WO/WOWDBB;next_new" but this results in an error 47 at line 7045 in WOWDBB. Only way else i can see you accomplishing this is to use some perform logic to open the WO0 file, read the record for the "WOXXX" key, extract the next trans number, then either write your own increment logic or use the NextNumber function from the CI_NextNumber object if available. http://help-sage100.na.sage.com/2018/FLOR/index.htm#Object_Reference/CI/CI_NextNumber.html
    Then piece together the full record with the incremented trans number and then write the record back to WO0. 
    You would need additional logic to determine if the current record is part of the previous record so you're not incrementing the trans number from one line to the next. 
    Another approach i suppose if you still have MD access would be to inspect these programs and the statements on a version where the "Next" feature works.

    I couldn't find any indication that the "Next" functionality exists in the compiled vi job pictured above so i imagine it is happening in one of those referenced programs.

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 3.  RE: How to get Next Transaction Number in Work Order Transaction Entry import

    Posted 05-13-2019 04:12
    Thank you for the advice David. Prior to me posting, I was really hoping there was a conventional front-end way so I didn't have to mimic / recreate the NEXT_NEW from WOWDBB or from one of the VI programs you mentioned. But I did. This wasn't for V/I but rather for a mod that auto-releases Work Orders during W/O Traveler Printing.

    Just so you know, you can never CALL or PERFORM to that routine not just b/c it's Legacy it's but Old Skool Legacy. Some old skool stuff is cool but mostly it's not (e.g. EXTRACT to lock records, Line Index files, 2 file scheme for data entry Batch header files, the Sy0ctl dumping ground to store most system data, on and on)

    Also in case you ever need to do the same, it's a little different than what you mentioned:
    * EXTRACT the [W/Oxxx] key in Sy0ctl and get the value of Next from superstring position (163,7 in this case). A copy of all WO0 recs as well as every legacy module's xx0 file recs are stored in here. Even when you select W/O Options that UI is showing you a copy of the Sy0ctl recs for it.
    * Don't EXTRACT or READ from WO0
    * If the Next Number is all numeric then add 1
    * WRITE the updated Options record to Sy0ctl which releases the EXTRACT record lock
    * WRITE the updated Options record to WO0 which was never EXTRACTed (and if you think this could make the 2 go out of sync you would be right it did!) 

    It also does all this SWAPCH and SWAFILE$ stuff for re-purposing same channel numbers. Eg On last step Ch 6 for Sy0ctl WRITE is re-purposed for the WO0 WRITE. This was done in the late 90s to support a Novell NLM compatibility for faster BBx code execution at the time. In spite of the NLM never being released from beta, that SWAP crap never get removed until modules went to Framework. Also I know from J/C Dev where we had to write a JC_Options_svc sub-class that inherited CI_NextNumber, you can't use the CI_NextNumber simply b/c W/O is not in Framework (which will change imminently but who knows how). 

    I appreciate your response and ideas!

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

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



  • 4.  RE: How to get Next Transaction Number in Work Order Transaction Entry import

    Posted 05-14-2019 11:48
    Wow, that is a lot to take in, thanks for taking the time to post all of that. Great info.


    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------