EventSubscriber - Get Calling Record

headley27headley27 OntarioMember Posts: 235
Hello,

I am looking at using this EventSubscriber to change the IsHandled value based on a condition.

[EventSubscriber(ObjectType::Table, database::"Sales Line", 'OnBeforeValidateBlanketOrderLineNo', '', true, true)]

local procedure OnBeforeValidateBlanketOrderLineNo(var IsHandled: Boolean)
begin
end;

As there is no reference to the Sales Line in the OnBeforeValidateBlanketOrderLineNo Local Procedure itself, is there any way that I can get access to which Record (Sales Line) is calling the EventSubscriber/Local Procedure?

Thank you,
headley27

Answers

  • DenSterDenSter Member Posts: 8,276
    Looks like Rec is part of the signature of the eventpublisher in the Sales Line table
    ow8yt3b1e5dg.png
    The parameter name is SalesLine and you should be able to add that to your function
    i0u5pzj7r5sq.png
    Put your cursor in the parameter section and hit intellisense. You should be able to add 'SalesLine'. It's by reference so you can change any field value
Sign In or Register to comment.