Hi
As you know in SysAdmin form, I can assign organization for a user role. This will cause the user to only see data for the organization he/she has access to.
Is there a way I can bypass this restriction?
Here's my scenario:
I created a form with three grids:
left grid, should show all companies (even if it was specified in /Assign organization/ that the user can't see specific companies), how can I do that? because currently it's showing only the companies that the user has access to and not all of them.
middle grid, should show the sites for the company I selected in the first grid
third grid, should show the addresses for the site selected in the second grid.
Here is the form datasources:
LogisticsLocation:/Link Type/= Delayed, / Cross Company Auto Query/ = No
LogisticsPostalAddress : OuterJoin with LogisticsLocation, / Cross Company Auto Query/ = No
CompanyInfo: /Link Type/= Delayed, / Cross Company Auto Query/ = Yes
InventSite: /Link Type/= Delayed, / Cross Company Auto Query/ = Yes
Here is the code for the datasources:
[DataSource]
class CompanyInfo
{
public void init()
{
super();
this.query().dataSourceTable(this.table()).clearDynalinks();
}
public int active()
{
int ret;
Query query = InventSite_ds.query();
query.clearCompanyRange();
query.addCompanyRange(CompanyInfo.DataArea);
InventSite_ds.executeQuery();
element.executeQueryLogisticsLocation(tableNum(InventSite));
ret = super();
return ret;
}
/// <summary>
/// Execute query of CompanyInfo DataSource
/// </summary>
public void executeQuery()
{
Query query = new Query();
QueryBuildDataSource qbdCompany;
query.allowCrossCompany(true);
qbdCompany = query.addDataSource(tableNum(CompanyInfo));
element.addRangeToCompanies(qbdCompany);
this.query(query);
super();
if(buyingLegalEntity)
{
CompanyInfo_ds.positionToRecord(CompanyInfo::findRecId(buyingLegalEntity));
}
}
}
[DataSource]
class InventSite
{
public void init()
{
super();
this.query().dataSourceTable(this.table()).clearDynalinks();
}
public int active()
{
int ret;
element.executeQueryLogisticsLocation(tableNum(InventSite));
ret = super();
return ret;
}
}