Set Sage field equal to UDF (user script?)

SOLVED

Earlier this year I created a mobile application for pulling orders. To integrate, I made a rather barbaric implementation: when the mobile application backorders an item, update SO_SalesOrderDetail.QuantityBackordered = External.QuantityBackordered. I did this because: When I checked SQL traffic against my database, it did not look like updating the Sales Order Detail screen made changes to any other columns. Unfortunately, it appears, however, that my quantity on sales order totals (CI, IM) are not matching with actually summing the quantity on sales order column, so clearly I've missed something. Rebuilding the sort file gets everything to add up again. 

So it seems like the best way to handle this would be to call the business object interface and make sage think a user went in to the sales order detail and modified the field. I've looked in to SageU, it seems a bit dated and there doesn't seem to be much support for c#? 

So the question is.. am I on the right track, or is there any easier way to do what I'm doing? 

  • 0

    If you are updating directly via SQL, don't, doing so bypasses sage's business logic. You need to go through the BOI and update the sales order properly using the SO_SalesOrder_Bus object. 

  • 0 in reply to David Speck

    Gotcha. That's what I was trying to ask. Doesn't look like they are any guides out there on how to get started with that aside from the one on sageu? And then there are seemingly no references officially to c# but I do see people are using it?

    Edit: and is boi different than user defined scripts?

  • +1 in reply to wishingforsql
    verified answer

    BOI and UDS are similar, however BOI accessed externally through pvxcom.exe (ProvideX.Script) has to have a letter prefix indicating a method's (or property) returned value's data type.

    A UDS is always in VBScript whereas externally, you can use just about any programming language that can create new objects. 

    So in a UDS, to reference the module date for the current session. You would use oSession.ModuleDate whereas externally, that would be oSession.sModuleDate.

    As far as data types go with the BOI, there are Numbers, Objects, and Strings.

    1. Numbers: oSession.nUpdating
    2. Objects: oSession.oSecurity
    3. Strings: oSession.sStartProgram

    You'll want to refer to the online file layouts on object reference.

    https://help-sage100.na.sage.com/2020/FLOR/index.htm 

    Search the forum or knowledgebase for scripting.docx for a helpful starter doc.

    You can also take the BOI course on SageU.

    As for C#, you can search this forum for examples of updating a sales order and/or its lines to get an idea of how it is done. After learning the basis, you can then search this forum for C# related posts so you can get an idea on how to adapt from the typical VBScript to C#.