我在代码编辑器上添加它后编码:SOOrderEntry(销售订单)付款参考(付款设置标签)被阻止。
protected void SOOrder_OrderType_FieldDefaulting(PXCache cache, PXFieldDefaultingEventArgs e)
{
PXResult<PX.SM.UsersInRoles> user = PXSelect<PX.SM.UsersInRoles,
Where<PX.SM.UsersInRoles.username, Equal<Current<AccessInfo.userName>>>>.Select(Base);
SOOrder row = (SOOrder)e.Row;
if(row != null)
{
if(user != null)
{
PX.SM.UsersInRoles role = user;
if(role.Rolename == "Administrator")
{
e.NewValue = "CS";
e.Cancel = true;
}
else
if(role.Rolename == "Sales 01Ao")
{
e.NewValue = "C1";
e.Cancel = true;
}
if(role.Rolename == "Sales 01Do")
{
e.NewValue = "C2";
e.Cancel = true;
}
}
}
}