Skip to main content
Solved

How to set Default values Dynamically in unbound Fields??

  • May 20, 2022
  • 4 replies
  • 681 views
  • Translate All

Forum|alt.badge.img+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;

            }

        }

Best answer by Naveen Boga

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.

 

View original

4 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20

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.

 

Translate

Forum|alt.badge.img+1

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

 

Translate

Marco Villasenor
Jr Varsity II
Forum|alt.badge.img+3

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?

Translate

Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • June 9, 2022

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

Translate