Epesi ENS | Epesi Academy | epesi.cloud PaaS | GitHub

Help Me! | Download from SourceForge Download Epesi BIM Free & Open Source CRM


Hi,
for some time I'm strugling with criteria engine in epesi. I found out that it's not compatible with multi-record references.
I'll try to describe what is on my mind.
Let's consider situation of "related companies" reference in "contacts" recordset. Now let's build permission in contacts, in such way:

"view" is permitted for "all users" if "Related Companies" is set to record with "Related Contacts" equal to "User Contact".

In short if user is in related contacts of a company that he is related to, then he has access granted. I know that this particular example has no sense, but in my case I got "Departments" recordset, this has related contacts and companies has "departments". Now I can build criteria that says, if Department Name is set to record with Related Contacts equal to User Contact then allow to "view", "edit" or whatever.

And most interesting thing is what the problem exactly is and when does it appear. When I add only one contact into related contacts of some company, then everything is ok, but when I add more than one contact in there, problem shows up. Then when I go to CRM->contacts I receive blank datatable:

Anyone can help with modification of RecordBrowserCommon check_record_against_crits($tab, $id, $crits) function ??

Michal

Hi Michal,

It would be nice if you could provide clear instructions to reproduce this error on fresh installation.

Regards,
Adam

Ok. Firs I add "Related contacts" to Companies recordset:

I create some contacts to have some data to test with.
Next I add some companies too. Finally I add contact to related contacts of some chosen company.

Simultanously I add this chosen company to this particular user's related companies:

Then I modify criteria in permission editor:

I agree that maybe it's not a good example becouse it is useless, but it show the nature of problem. But ok, let's go to CRM->Contacts now. Note That I'm logged in as user that was added to related contacts in above example:

I got blank record in datatable 😉 This is record that should be visible in fact. When I click on "view" icon I'm able to see that it is correctly retrieved record.

That's it, from fresh install to this weird result

I am not sure what you are trying to accomplish, I wrote my response to your post here: viewtopic.php?f=8&t=1562#p5446
It deals with setting up a hierarchy of companies (parent/child companies). This solution works and was tested.

Now you are trying some different approach and I have no idea where it is going. Unfortunately we have no time to investigate this setup. It is quite possible that you will construct permissions (which is a query) that one rule will deny the other and the result will be an empty recordset.

I am sorry but you are on your own here.

Ok, that's what I thought, I wasn't expecting that you'll give me any ready-made solution. It also is not important what I'm trying to accomplish, more important that in criteria mechanism such an use case haven't been taken under consideration, such a use case wasn't planned but is possible to accomplish in CRM. Thanks anyway for help

Write a Reply...