xpath showing the whole table when it shouldnt - Export to excel error?!

0
hi, One of our projects has an audit trail which for one client showed not just his site and company details, but all clients details (actually the whole audit transaction table) Audit 1:m AuditTransaction. The form shows the sites belonging to a company, and has two grids. Sites (grid1), and a site dataview that listens to the grid1, and a grid2 with an export to excel btn for objects AuditTransaction with 5 tabs for different categories. Each tab has the following xpath: AuditTrail.AuditTransaction\_AuditEntry/AuditTrail.AuditEntry/AuditTrail.AuditEntry\_Site='[%CurrentObject%]'] [AuditTrail.AuditTransaction\_AuditEntry/AuditTrail.AuditEntry/CategoryLabel='Sales' There are several customers, each with their own site, and audit objects are built and associated to each own customer company and site, so how could a client see the full audittransaction table? Is there a glitch here with the xpath or with the excel export button. When I don't select any site, I see an empty grid... absolutely correct, but if I press the excel export button, I get a list full of items in the spreadsheet?! Context?! Apply context is false on all grids. Is there a known problem with this version and the export button? LR.
asked
1 answers
0

Just gonna have a go here as well ;] Luis what Bas means is that you should set the xpath on your domain/security level instead of on your forms. e.g. if Customer employees are only allowed to see their own orders you should set a xpath on the entity access rules for orders for your CustomerEmployee module role. Something like

[General.OrderCustomer/General.Customer/General.CustomerEmployeeOrder = '[%CurrentUser%]']

On another notice i think your original xpath should also be a little different.

As a rule of thumb we use that whenever you duplicate part of your xpath you need to combine these lines (keep in mind that this is not always true ;])

[AuditTrail.AuditTransaction\_AuditEntry/AuditTrail.AuditEntry/AuditTrail.AuditEntry\_Site='[%CurrentObject%]'
[AuditTrail.AuditTransaction\_AuditEntry/AuditTrail.AuditEntry/CategoryLabel='Sales']

should be

[AuditTrail.AuditTransaction\_AuditEntry/AuditTrail.AuditEntry[CategoryLabel='Sales']/AuditTrail.AuditEntry\_Site='[%CurrentObject%]']
answered