Skip to main content

I’m creating a new form and it requires selecting a business account. so I have written the Code as follows in the DAC,

 #region BAccountID
        PXDBInt()]
        PXDefault()]
        rPXUIField(DisplayName = "Business Account")]
        )PXSelector(typeof(Search<BAccount.bAccountID>),
            typeof(BAccount.acctCD),
            typeof(BAccount.acctName)
        )]

    public virtual int? BAccountID { get; set; }
    public abstract class bAccountID : PX.Data.BQL.BqlInt.Field<bAccountID> { }
    #endregion

when I’m entering the new record, it raised an error as follows,

 “Error: Inserting  'Customer Call' record raised at least one error. Please review the errors.” 

 

But when I’m selecting another business account in the same form, I can save the data successfully. However, I can't save the data with the business account I initially chose and it raised an error like “Error: Updating  'Customer Call' record raised at least one error. Please review the errors.”

how can I resolve this error? Does anyone have an idea?

Thank you!

Hi @saumyasewwandi60 

Can you try the Selector like below,


        PXSelector(typeof(Search<BAccount.bAccountID,Where<BAccount.type, Equal<BAccountType.customerType>>>)
            ,SubstituteKey = typeof(BAccount.acctCD),
            DescriptionField = typeof(BAccount.acctName), Filterable = true,
            DirtyRead = true
        )]
 

And also cross-check whether the 5441 customer record is already available in the system.


Yes.  it's working. Thank you jinin 


Great!  Thank you.


Hi,

I have changed the selector as follows,

  #region BAccountID
        PXDBInt()]
        PXDefault()]
        >PXUIField(DisplayName = "Business Account")]
         rPXSelector(typeof(Search<BAccount.bAccountID, Where<BAccount.type, Equal<BAccountType.customerType>>>),
        SubstituteKey = typeof(BAccount.acctCD),
        DescriptionField = typeof(BAccount.acctName),
        Filterable = true,
        DirtyRead = true
         )]
        

        public virtual int? BAccountID { get; set; }
        public abstract class bAccountID : PX.Data.BQL.BqlInt.Field<bAccountID> { }

    #endregion

Now the data is saved successfully, but when I select the entered record from a generic inquiry and update the contact field, it shows a warning message in the business account field.

 how to avoid this warning?


Reply