SO_InvoiceTracking Lines?

SOLVED

I have a pre-write event script where I'm trying to loop through all  packages. When I try this I get an error that .Lines is not supported on that object

Set oLines = oBusObj.AsObject(oBusObj.Lines)

And because of what I just observed I guess I know why. The script fires after moving focus off of a line in the tracking UI, not what I expect for a "Table pre-write" event. So there is not collection here.

What is the best object to use to trap for when an invoice is created with tracking numbers? What object can I use to iterate through all of the packages for an invoice. I'm new to BOI and I'm having sorting out the relationships between these objects. I'm using the File Layouts and Object Ref but it's not clear to me.

Thanks -Ken

Parents
  • +1
    verified answer

    The Lines property is only available on Header Class objects, like SO_Invoice_Bus. 

    Table event scripts apply to that specific table and oBusObj contains the handle to that specific class object.

    So if you put the script on the pre-write of the SO_InvoiceTracking table, then oBusObj already refers to that table.

    If you were to move your script to the pre-write of SO_InvoiceHeader then oBusObj refers to SO_Invoice_Bus and oBusObj.Lines refers to SO_InvoiceDetail_Bus. At the moment, i'm not aware of an object property that is exposed that allows you to get the object handle to SO_InvoiceTracking_Bus from SO_Invoice_Bus so you may need to get you own handle using GetObject and then loop make sure you set the browse filter for the current invoice and then loop through the records.

  • 0 in reply to David Speck

    Thanks for that explanation, I'll have to test where I can capture all of the tracking #s for each invoice. It appears that attaching to SO_InvoiceTracking pre-write that package is already set so the handle is to a single record

    KPRIMARY: InvoiceNo+PackageNo

    I wonder if in scripting I can get a handle to all tracking entries for a particular InvoiceNo and loop through them. 

    Thanks for the help -Ken

  • 0 in reply to kdc415

    Refer to my last paragraph from my last post.

    You will however need to set the browse filter for the current invoice number so while looping, you only see records related to the current invoice.

    You can search on here for more examples of SetBrowseFilter and can also review this page for more info on the method.

    http://help-sage100.na.sage.com/2019/FLOR/#Object_Reference/BaseSystem/SY_Service.htm

  • 0 in reply to David Speck

    Thanks David, that's helpful, I hadn't thought of that method, still learning the ropes

  • 0 in reply to kdc415
    SUGGESTED

    One thing about creating a new object... you will only be able to see data that has previously been saved.  New data (new record / changes in memory only) will be inaccessible.

Reply Children