[ExtensionOf(formdatasourceStr(SalesTable, SalesTable)) ]
final class DTSalestableForm_AssignTransactionAccess_Extension
{
public int active()
{
UserId userid ;
UserInfo userInfo;
DTSalesTransactionAccess salesAccess;
SalesTable salesTableLoc = this.cursor();
SalesLine salesLine;
int ret = next active();
userid = curUserId();
select id from userInfo
where userInfo.id == userid;
while select * from salesAccess
where salesAccess.UserId == userInfo.id
{
if(salesAccess.RecId != 0 && salesAccess.inventLocationId == salesTableLoc.InventLocationId)
{
if(salesAccess.Addlines == NoYes::Yes)
{
this.formrun().design().controlName(formControlStr(SalesTable, LineStripNew)).enabled(true);
}
else
{
this.formrun().design().controlName(formControlStr(SalesTable, LineStripNew)).enabled(false);
}
if(salesAccess.Confermation == NoYes::Yes)
{
this.formrun().design().controlName(formControlStr(SalesTable, buttonUpdateConfirm)).enabled(true);
}
else
{
this.formrun().design().controlName(formControlStr(SalesTable, buttonUpdateConfirm)).enabled(false);
}
}
else
{
this.formrun().design().controlName(formControlStr(SalesTable, LineStripNew)).enabled(true);
this.formrun().design().controlName(formControlStr(SalesTable, buttonUpdateConfirm)).enabled(true);
}
}
return ret;
}
}
André Arnaud de Cal... 291,820 Super User 2024 Season 2
Martin Dráb 230,514 Most Valuable Professional
nmaenpaa 101,156