Solved

How to set Default values Dynamically in unbound Fields??

  • 20 May 2022
  • 4 replies
  • 485 views

Userlevel 3
Badge +1

Hi guys 

Here I need default values in unbound fields and 

I have tried  below scenarios both are not getting output could plz have look

 [PXUnboundDefault(typeof(Search<CSAttributeDetail.description,
        Where<CSAttributeDetail.valueID,
            Equal<Current<LocationExt.usrSuperMarket>>>>))]

AND

 

 protected void Location_UsrSuperMarketDescription_FieldDefaulting(PXCache cache, PXFieldDefaultingEventArgs e)
        {

            var row = (Location)e.Row;
            LocationExt line = new LocationExt();

           
            CSAttributeDetail Description2 = (CSAttributeDetail)e.Row;
            if (line.UsrSuperMarket != null)
            {
                line.UsrSuperMarketDescription = Description2.Description;

            }

        }

icon

Best answer by Naveen Boga 20 May 2022, 10:25

View original

4 replies

Userlevel 7
Badge +17

Hi @ShahidaValiSyed04  I think you will get Description2 value is NULL.

CSAttributeDetail Description2 = (CSAttributeDetail)e.Row;

 

You can do like below

  • Do a BQL based on the Super Market selected value i.e. SUPERMARK and then get the Description of it and then assign it to the Super Market Description field.

 

Userlevel 3
Badge +1

Hi @Naveen Boga actually I need based on “ValuID”  

 

Userlevel 3
Badge +2

It depends on your DAC structure and fields.

Looks like you are using Attirbutes (CSAnswers) for your values and descriptions.

Could you share the definition of your DAC fields and logic?

Userlevel 7
Badge

Hi @ShahidaValiSyed04 were you ever able to resolve your issue? Thank you!

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