You have to create an AL extension that subscribes to the event in codeunit 70319679.

12 Responses

  1. Hi Erik,
    Thanks for the reply.
    I’ve now done it with the code unit, but I don’t think I’ve done it quite right. I’m sending a screenshot of the code. So it works—the filter is used from the filter page and the filtering also works. The selection is filtered on the standard “Contact List” page, but on a page created by another app, the fields are no longer visible (see screenshot). I couldn’t find the page under Problem Fields. The page also no longer displays any fields when I remove the filters for my user. Do you have any idea what I’m doing wrong?

  2. Just checked, make sure you’re on the latest version of Advanced Cloud Security… There’s a new event replacing the original one.

  3. Hi Erik,
    I think I was too hasty with the screenshots, because I can’t find a way to attach files to this question. Am I blind, or do I have to create a new question for that? There you have the option to upload files.
    I am currently updating to version 6.0.0.158.

  4. So, with the new event, the filtering no longer works. I programmed the following in the event subscriber:
    [EventSubscriber(ObjectType::Codeunit, Codeunit::”ACS Published Events EFQ”, GetFilterCode2, ”, false, false)]
    local procedure GetFilterCode2(FilterCode: Record “ACS Filter Code EFQ”; User: Guid; var FilterValue: Text)
    var
    ACSUserSec: Record “ACS User Filter EFQ”;
    begin
    // Message(‘%1’, FilterCode.Code);
    if (FilterCode.Code = ‘KWG01’) then
    if ACSUserSec.Get(User) then
    FilterValue := ACSUserSec.”KWG_Kitchenfilter”;
    // FilterCode.();
    // FilterCode.Modify();
    end;
    I can’t even get into the event with the debugger, which means that the event is probably not being triggered yet. Or I’m doing something completely wrong.

  5. Hi Erik,
    yes the User Filter is added to the List and has the Type = “Event Supplied”. Code Description Type Builtin Reference No.
    KWG01 Kitchencode Event Supplied 0
    I also added the security feature to my user. And in the security feature, I entered the following under Data Access Filter:
    Table Name Field Name Related Record Filter Value Allow User Filters
    Contact AMA Kitchen Code $KWG01$ Yes

  6. I also entered the system with the debugger, set a breakpoint in the new event, and the debugger did not stop when the contact list was called up. Could it be that the new event is not addressed when the list is called up?

  7. The event is only called when evaluating a filter on a user session, it’s not used in the filter list.

  8. So when I open the “Effective Security” page and search for my user, the correct filter with the desired filter value is applied. But when I open the “Contact List” page, the filter is not set. This worked before the app was updated.

  9. If the filter is used on the Contact list, then the event should fire for sure. (Effective uses the same underlying engine to get the filters)

  10. Good evening, Erik,
    I tried again, but unfortunately without success. The user filter is not being applied to the contact list page. I joined my session again with the debugger and set a breakpoint in the event. When I called up the “effective authorizations,” the debugger stopped. When I went to the Contact List, the debugger did not respond. Unfortunately, I don’t know what else I could have done wrong. If you like, I can show you the setup and behavior in a Teams meeting.

  11. I’ll check that next week, I’m currently working on the next-gen version of ACS anyway.

Leave a Reply