Skip to main content
Solved

Retrieve object that triggered business event


Hi everyone,

I’m using a generic inquiry to trigger a business event. The business event then has a custom data provider as a subscriber to send data to a remote API.

Whilst this is mostly working, I’m trying to use the GI field “Captions” to provide a known name for columns that may have a function attached (or if the user wants to customise the column names). 

At the moment in the EventAction’s Process(MatchedRows] eventRows, CancellationToken cancellation) method, Captions aren’t pulled through from the GI, only the original field names or randomly generated names for the columns containing functions.

I’d like to be able to get hold of the GI that triggered the business event so I can retrieve the caption names for some of the fields.

Is there a way to get a reference to the triggering object (in this case a GI) within the “Process” method or elsewhere?

Many thanks

2 replies

Userlevel 2
Badge

Just to update;

It looks like the CreateActionHandler method (from IBPSubscriberActionHandlerFactory) accepts a Guid handlerId which relates to the particular handler in BPEventHandler. From here you can get back to the BPEvent that the handler is associated with (and from there onto whatever triggered the event)

Userlevel 7
Badge

Thank you for sharing your solution with the community @neil40 !

Reply