Sage 100

 View Only
  • 1.  Item Extended Description updated/set by script

    Posted 09-16-2024 15:34

    We have a client that wants the items description to build off multiple fields they enter.  We then currently have a pre-write script that fills in other information about the item but are struggling getting the item description to save past the 30 characters.  In a simple form on my local machine I've been playing with setting the extended description and found an old post on the Sage City area but that doesn't work either it appears.

    sExtDesc = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBB"
    If (IsObject(oUIObj)) Then
         oUIObj.SetVar "HdrExtDescriptionText$", sExtDesc
         retVal = oSession.AsObject(oSession.UI).MessageBox("", sExtDesc)
    Else
         Set myUIObj = oSession.AsObject(oScript.UIObj)
         retVal = oBusObj.SetValue("ItemCodeDesc$", sExtDesc)
         retVal = myUIObj.SetVar ("HdrExtDescriptionText$", sExtDesc)
         retVal = oSession.AsObject(oSession.UI).MessageBox("", "Second Option " + sExtDesc)
         SET myUIObj = Nothing
    End If
    I've tried different variations of this but can't seem to get the extended description to set.  Anyone have any ideas?


    ------------------------------
    Chris Mengerink
    Partner
    DWD Technology Group
    ------------------------------


  • 2.  RE: Item Extended Description updated/set by script

    Posted 09-16-2024 17:18

    SetValue on the ItemCodeDesc "should" be all that is needed. (I know in VI it is all automatic, but am not 100% sure about scripting).

    I'd expect something like a -1 retVal and warning text (about too many characters), but Sage programming "should" translate the longer item description value into the extended record automatically.



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 3.  RE: Item Extended Description updated/set by script

    Posted 09-16-2024 18:03

    Kevin, I would expect the same, it doesn't.....I found this old entry that included you in Sage City

    https://communityhub.sage.com/us/sage100/f/business-object-interface/159284/setvalue-for-itemcodedesc-creating-extended-descriptions/450744

    But that doesn't seem to be working on the Sage 100 2023 Premium they are on....



    ------------------------------
    Chris Mengerink
    Partner
    DWD Technology Group
    ------------------------------



  • 4.  RE: Item Extended Description updated/set by script

    Posted 09-16-2024 18:17



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 5.  RE: Item Extended Description updated/set by script

    Posted 09-16-2024 19:38

    Kevin,

    Thanks for feedback!  It doesn't appear to be working though on a pre-write event.  Here is what happens

    Item initially

    make a change to a field on the item, click "Accept" and this comes up

    Click "OK"

    This comes up:

    Click "OK" and the record act's like it's saved.

    Go back to the item record and notice it didn't actually create/update the extended description

    Do you think I would need to do a hidden button over accept and call my own code then the accept button?  I see yours was firing from a button.



    ------------------------------
    Chris Mengerink
    Partner
    DWD Technology Group
    ------------------------------



  • 6.  RE: Item Extended Description updated/set by script

    Posted 09-16-2024 19:44

    From what I understand, InvokeChange mimics user data entry... and the nuance of how that might work on a pre-write event is not something I can say much about. 

    My general rule: try different things until you find something that works!  Changing to an Accept+ button is certainly worth a try. 

    (I like to name enhanced Sage buttons with a "+" to have a visual indication they are running the customized button).



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 7.  RE: Item Extended Description updated/set by script

    Posted 09-16-2024 19:49

    Thanks I'll keep poking at it, really seems it should be just as simple as setvalue the itemcodedesc and Sage logic takes it from there...really wasn't expecting to get stuck on this one....I'll post back here if I figure it out just so it's "in the record"



    ------------------------------
    Chris Mengerink
    Partner
    DWD Technology Group
    ------------------------------