Hi Everyone.
Hope you are doing great!
I have created a grid on the Service Order screen (GraphExt) with 2 field like the below
Problem 1: The EmployeeID field what is selector one is not showing the EmployeeID values after selecting the CustomerID field on the Service Order screen.
Note: For new record without selecting the CustomerID value then selector is working fine.
Problem 2: I’m trying to defaulting the Service Role and EmployeeID values from another screen.
Here the problem is, values are defaulting but the instead of showing the AcctCD values it is showing the bAccountID values.
FYI
Problem3: Selector heading is also showing wrong one.
DAC fields:
========
#region Role
PXDBString(30, IsKey = true, IsUnicode = true, InputMask = "")]
]PXUIField(DisplayName = "Service Role")]
lPXDefault()]
ePXSelector(typeof(Search < CSAttributeDetail.valueID,
Where < CSAttributeDetail.attributeID, Equal < Use < EPROLES > .AsString > > > ),
typeof(CSAttributeDetail.valueID),
typeof(CSAttributeDetail.description),
typeof(CSAttributeDetail.sortOrder),
typeof(CSAttributeDetail.disabled))]
public virtual string Role { get; set; }
public abstract class role : PX.Data.BQL.BqlString.Field < role > { }
#endregion
#region EmployeeID
rPXDBInt]
iPXUIField(DisplayName = "Employee ID")]
PXSelector(typeof(Search < BAccount.bAccountID,
Where < BAccount.type, Equal < Use < EP > .AsString > > > ),
typeof(BAccount.bAccountID),
typeof(BAccount.acctCD),
SubstituteKey = typeof(BAccount.acctCD), ValidateValue = false)]
public virtual int? EmployeeID { get; set; }
public abstract class employeeID : PX.Data.BQL.BqlInt.Field < employeeID > { }
#endregion
EventHandler:
============
protected void _(Events.FieldUpdated < FSServiceOrder, FSServiceOrder.branchLocationID > e)
{
var row = (FSServiceOrder)e.Row;
if (row == null) return;
if (serviceOrders != null)
{
var rolesAndEmps = SelectFrom < EPBranchRoles >
.Where < EPBranchRoles.branchLocationID.IsEqual < @ P.AsInt > >
.View.Select(Base, row.BranchLocationID);
if (rolesAndEmps != null && rolesAndEmps.Count > 0)
{
foreach (EPBranchRoles branchRole in rolesAndEmps)
{
EPServiceRoles serviceRoles = new EPServiceRoles();
serviceRoles.Role = branchRole.Role;
serviceRoles.EmployeeID = branchRole.EmployeeID;
RolesGridView.Cache.Update(serviceRoles);
}
}
}
}
Could you please assist me to resolve this issue.
Thanks,
Moulali Shaik