script for extended item description in BOM

HI

I am new to scripting and am trying to create a script for a client that will bring in the extended item description into t

Parents
  • 0
    Where are you trying to run the script from? oBusObj points to something entirely different depending on where you are running the script.

    I can see plenty of things that need to be fixed in the script, but knowing exactly where the script is executing from makes a big difference.
  • 0 in reply to TomTarget
    they are on 2016 advanced and access via TS through RDP. I really appreciate your help. I could spend hours paying with scripting, its pretty fun! But I do not have hours to play around this time :)
  • 0 in reply to [email protected]

    lfelsch,

    I'm not trying to be mean here.. If you really want to do scripting, you really need to get some training on scripting and data structures within Sage 100 to get the basics. Without an basic understanding, it is really hard to help you. Teaching sufficient basics to get you started is well beyond what we can do here. :(

    I sympathize because I remember trying to get started and was confused at first, but I did some training. If I recall correctly Sage U has some that really helped me to get jump started. It took many hours going through them but it gave me a place to start.   And even after years of doing some of this, I went to a two day class last year before Sage Summit in Chicago and learned many more things.  XKZERO has some good classes for beginners and intermediates.
     
    If you don't want to make that commitment, you really should talk with your Sage Partner (and not all Sage Partners will be fluent in coding either) to get some help. This isn't a really complex project but it's going to take a little time to code and debug.

  • 0 in reply to TomTarget
    Thanks Thom! I completely agree. I do want to take the class at Xkzeo, I went thru some of his webinars and everything makes since but if you do not continue to use what you learn you forget. that is where I am at now. I will get it figured out, I have done some really simple stuff and this doesn't seem that hard, I just need to take the time to think it thru and I have nto had the time yet. I will this weekend thou. thanks again!
  • 0 in reply to [email protected]
    I mean put something like this in your script to check on progress.
    retVal = oBusObj.GetValue("ItemCode$", ExtendedDescriptionKey)
    retVal = oSession.AsObject(oSession.UI).MessageBox("ExtendedDescriptionKey: " & ExtendedDescriptionKey)
    This will pop-up a message to show you the value of this variable, so you can make sure the value is what you expect... instead of being wrong for some reason (requiring you to figure out why and fix it).
  • 0 in reply to [email protected]
    This might help. We have two descriptions. One is the normal and one is contained in a UDF. When we write a purchase order we want the normal item description replaced with the description in the UDF. I wrote this script with the help of the Boy Wonder Elliott. Should work for you by replacing some values. Notice the part about GetChildHandle.

    Sub PostValidation_ItemCode500(column,value)

    retVal=0
    itmCode=""
    oItmSvc=0
    Notes=""
    Desc=""

    retVal=oBusObj.GetValue("ItemCode$",itmCode)
    retVal=oBusObj.GetValue("ItemCodeDesc$",Desc)
    oItmSvc = oBusObj.GetChildHandle("ItemCode")
    set oItmSvc=oSession.AsObject(oItmSvc)
    retVal=oItmSvc.Find(itmCode)
    retVal=oItmSvc.GetValue("UDF_PURCHASE_ORDER_NOTES$",Notes)
    If Notes <>"" Then retVal=oBusObj.SetValue("ItemCodeDesc$",Notes)

    End Sub
  • 0 in reply to [email protected]
    Make sure you study the file layouts. A lot of your problems revolve around trying to use fields that are not present in the file you are trying to query as Kevin mentioned.

    Also not that an extended description can be up to 4096 characters which can significantly increase the size of your data files by adding a UDF for that. That's why the extended descriptions are maintained in a separate file all to themselves and are accessed by using a key index.

    As Kevin indicated earlier in this thread, I'm not entirely sure why you would want to actually drag the description into the BM_detaillines file. When you are on the lines tab in Bill of Materials Maintenance there is a button (about half way across the panel ) that you can click and it will display the extended item description.

    And if you are trying to create a custom report or modify a report you can just link to that file to get it.
  • 0 in reply to BigLouie
    Awesome! thank you for the info!!! I will give it a try this weekend! :)
  • 0 in reply to TomTarget
    HI
    my UDF is set at 4100 and you are correct I need to study the file structure, the client it wants to visually see the ext. desc. in the lines of the BOM is why, having to click another button for ext desc. does not meet their needs
  • 0 in reply to [email protected]

    Gritting teeth. Guess I don't really understand why it is a big deal to the client. Seems like most of the time you wouldn't need to see all the extreme detail and when you do, you just click the button. I'm sure they must have a reason, but I'm not sure what it would be.

    I remember a client I had years ago that we were converting to Sage 100. They insisted that they wanted about 10 years of history including credit card information imported in. That was going to be a major undertaking that would cost a tremendous amount of dollars. Eventually asked them what they would do with all that info if they had it. After thinking about it for a while I got a sheepish look and they admitted that they had no idea. They thanked me for asking the question and saving them a lot of bucks.

    BTW,  Sorry.  I didn't not realize you were the Sage Partner.

  • 0 in reply to TomTarget
    If there is information embedded within the extended descriptions that could be broken out into a UDF in CI_Item, that could be displayed in the BM lines grid without any scripting.
  • 0 in reply to TomTarget
    no problem Tom. I completely understand what you are saying, it is because the descriptions are very long and alot of their parts can be the same descriptions, the extended description gives them the information they need need and want.
Reply Children
No Data