This topic contains 5 replies, has 0 voices, and was last updated by jt55401 7 years, 9 months ago.

  • Author
    Posts
  • #1240

    jt55401

    I have a User Event Script setup to “listen” for changes in Vendor and Contact records using only the afterSubmit handler.If I open a contact or vendor and make changes, the events fire properly. That’s great.
    If I open the vendor and attach or remove a contact with that vendor, no event is fired for either the vendor or the contact.

    What mechanic is preventing events from firing in this case, and is there anything I can do to get the events to fire?
    This is a cached copy. Click here to see the original post.

  • #1241

    j.j

    to my knowledge there is no event fired for attaching/deattaching of records and this is logged as an enhancement in NetSuite.

  • #1242

    khultquist

    The user event will trigger anytime that the record is saved. Like j.j says, the linking of records doesn’t trigger a user event, because the record is not saved.

    If you really need this, you should be able to discover changes with a scheduled script that looks for changes in attachments/detachments. The script would run every 15 minutes.

  • #1243

    jt55401

    Thank you khultquist – can you give me a hint as to what that script would look like? Are you suggesting a script that would loop through every record, and “peek” into it’s history of attachments/detachments somehow? (sorry if that’s a silly or easy question – I’m new to NetSuite…)

    or do I need to somehow track the attachments/detachments?

  • #1244

    khultquist

    np… I haven’t thought this out all the way but here’s how I would attempt it:add a custom field to vendor records (and maybe other entity records)
    put a value in this field, a key, generated by some function of all the contacts attached to this record (eg the product of the internalids of all contacts, though this is not unique)
    build a saved search that compares the key (stored on the record) to the function — any changes to attachments on a record will show up in this search
    run a scheduled script that updates the keys on results of the saved search

  • #1245

    jt55401

    khultquist – sure, thanks for the tips!

You must be logged in to reply to this topic.