Question

PXSelector attribute is not working properly


Userlevel 3
Badge

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

Userlevel 7
Badge +17

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?

Userlevel 7
Badge +10

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

Userlevel 3
Badge

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.

Userlevel 7
Badge +5

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.

Userlevel 7
Badge +17

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!

Userlevel 3
Badge

@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?

Userlevel 7
Badge +17

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

Just sharing a screenshot for your reference.

 

 

Userlevel 3
Badge

hi @sweta68 ,

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

Userlevel 5
Badge +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)

Userlevel 3
Badge

HI @andriikravetskyi35 ,

sorry for being late to reply.

APProformaDiscount is a custom table and the code is attached herewith. 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