Skip to main content
Question

PXSelector attribute is not working properly

  • June 13, 2023
  • 10 replies
  • 351 views

Forum|alt.badge.img

Hi,

I have a new tab Called ‘Discount’ in my custom screen. In the grid level of this tab, I need to set values taken from ‘Discounts’ screen under the Profiles of Receivables workspace. First I set pxselector to DiscountCode field to set the value  DiscountSequence.DiscountID. Then I need to set Sequence ID related to the discountID which already set. 

To set SequenceId from DiscountSequence.SequenceID, I defined pxselector for sequence id like below.

[PXSelector(typeof(Search<DiscountSequence.discountSequenceID, Where<DiscountSequence.discountID, 
Equal<Current<APProformaDiscount.discountCode>>>>))]

ref: APProformaDiscount is the DAC for the Discount Tab.

but when click on selector, it shows nothing even there is a sequence Id for each discount code.

can someone help me to resolve this issue please?

thank You.

 

10 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 13, 2023

Hi @oshadarodrigo64  It seems you are getting NULL value from the WHERE condition (Highlighted below)

 

[PXSelector(typeof(Search<DiscountSequence.discountSequenceID, Where<DiscountSequence.discountID, Equal<Current<APProformaDiscount.discountCode>>>>))]

 

Have you checked by removing the WHERE condition and able to load the values?


Forum|alt.badge.img+9
  • Semi-Pro III
  • June 13, 2023

Hi @oshadarodrigo64 ,

Could you please try below code in DAC for PXSelector?

[PXSelector(typeof(Search<DiscountSequence.discountSequenceID, Where<DiscountSequence.isActive, Equal<True>, And<DiscountSequence.discountID, Equal<Current<APProformaDiscount.discountID>>>>>))]

 [PXForeignReference(typeof(FK.DiscountSequence))]

Hope, it helps!

Regards,

Sweta


Forum|alt.badge.img

Hi @Naveen Boga ,

Thank you for the response, Yes I have tested without where condition and then it loads values without any issue, but with the where condition it shows nothing.

Hi @sweta68 ,

Thank you for the response, I will test your solution and let you know.


Forum|alt.badge.img+7
  • Captain II
  • June 13, 2023

Just for confirmation: If you press the Refresh button on the selector, does it load with records even when it was initially blank?  If so, you might need to set AutoRefresh=True in the screen editor for the column/field.

And make sure the property SyncPosition=True on your grid.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 13, 2023

Hi  @oshadarodrigo64  Yes that is the problem. WHERE condition is not refreshing/not fetching the value.

As indicate by Django, we need to the Auto Refresh =”True” as we are using the WHERE condition like below.

 

 

Hope this helps!


Forum|alt.badge.img

@Django , @Naveen

Thank you for your suggestion, but I cannot find AutoRefresh property for sequenceID field. is this because of it’s a custom field?


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 13, 2023

@oshadarodrigo64  No. It should be available for Custom field as well.

Just sharing a screenshot for your reference.

 

 


Forum|alt.badge.img

hi @sweta68 ,

I tested your solution but issue remained the same. Didn’t work as expected. Any idea you have ?


andriikravetskyi35
Jr Varsity I
Forum|alt.badge.img+1

Hi all,

@oshadarodrigo64 , could you share the code of APProformaDiscount DAC, it seams like custom table, I can not find it in Acumatica.

Also check data in DB, two columns (APProformaDiscount.discountID and DiscountSequence.discountID) in tables must have the same values, at list one value must be the same, if you want to see value in selector.

It looks that DiscountSequence table doesn’t have row where DiscountID =”TEST” (according you screenshot)


Forum|alt.badge.img

HI @andriikravetskyi35 ,

sorry for being late to reply.

APProformaDiscount is a custom table and the code is attached herewith. thank you.