Thanks Steeve and Andre,
the role that is failing to get the data is for auditor users who are submitting expenses. The role for approvers/admins are bringing back that CurrencyId correctly.
 So far, i can only see that statement as a point where the process goes two different ways. I was suspecting it is about some sort of security, since it is behaving differently for an auditor role - with permission to submit expenses, and for admin or approver role.
This is a part of a workflow. When an user with auditor role submits expense, that expense can be approved, but then it gets stuck in the workflow - with an error indicating that there is no 'from' currency to convert from. debugging shows where is the error, and what field is missing the currency code to lead to that error.
So those 2 lines in the original post is where currency is found for admin/ approver role, and not for user/auditor role.
If it helps, the table in question is ProjectAccountingDistribution, and the field is Currency. Values are assigned in InitFromSourceDocumentLineItem method.
the list of privileges for user is basically all Expense line and header service operation permissions, as well as all expense report service permissions.
Approver has privileges to approve TrvExpenses and TrvRequisitions.
------------------------------
Pedja Nikodijevic
Express Scripts Canada
Mississauga
------------------------------
Original Message:
Sent: 01-30-2019 04:26 PM
From: Predrag Nikodijevic
Subject: security around FIND method
Hi developers. Any idea, why would 'find' method of the class work for one role, and not for the other? i cant see any permissions on the table, nor the code permissions for the method.Â
it looks like this:
  projInvoiceTable = ProjInvoiceTable::find(projTableLocal.ProjInvoiceProjId);
  projSalesCurrencyCodeLocal = projInvoiceTable.CurrencyId;
so for one user/role, it finds the projInvoiceTable, and gets the right CurrencyId, and for others it doesnt, and the ProjInvoiceProjId is there all the times.
where should i look for security which would prevent it, or how do i override the security?
Thanks,
Pedja
------------------------------
Pedja Nikodijevic
Express Scripts Canada
Mississauga
------------------------------