Question

PXSelector is not showing BAccountID values on Service Order screen after selecting CustomerID value.

  • 5 April 2023
  • 0 replies
  • 282 views

Userlevel 4
Badge +1

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")]
        [PXDefault()]
        [PXSelector(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
        [PXDBInt]
        [PXUIField(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

 

 

 


0 replies

Be the first to reply!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved