Skip to main content
Solved

Custom screen always throwing unhandled exception error on save about a key field missing

  • October 25, 2024
  • 9 replies
  • 98 views

Forum|alt.badge.img

Hi,

 

I’ve created a custom screen (table, graph screen definition) and associated a sequence number to the reference number field (hence the <NEW> showing). The key is Reference Nbr + Revision. For whatever reason on save (or if I say change commithchanges to true for Vendor ID), it always throws this unhandled exception error about the Reference Nbr not existing. I assure you its both the database and DAC

 

 

DAC (I confirm it’s reading that sequence number, I tested changing it’s placeholder value to ensure its reading the correct one):

 

 

Screen:

 

Database:

 

 

Trace:

 

 

Has anyone encountered this or know how or why this would happen and how to fix it? It surely must be some mapping I missed in the screen definition or something. Using 2024R1 Build 24.109

 

Thanks.

 

Regards,

 

Andrew

Best answer by darylbowman

I’m not certain this will work like you’re intending. If you look at a DAC like SOOrder, there is a composite key of DocType and RefNbr, but DocType is always selected first, after which the RefNbr is generated.

View original
Did this topic help you find an answer to your question?

9 replies

Forum|alt.badge.img+6
  • Captain II
  • 554 replies
  • October 25, 2024

What does the declaration look like for RevisionID?


Forum|alt.badge.img
  • Author
  • Freshman II
  • 17 replies
  • October 25, 2024
Django wrote:

What does the declaration look like for RevisionID?

Pretty standard to be honest

 


Forum|alt.badge.img+6
  • Captain II
  • 554 replies
  • October 25, 2024

I just wanted to make sure you had IsKey there as well.

I think it might be your PXSelector. You’re asking it to find a record in your table without considering the Revision number.

You might look at adding ,ValidateValue = false in the attribute for the PXSelector attribute. That would mean that you have to do other validations.


Forum|alt.badge.img
  • Author
  • Freshman II
  • 17 replies
  • October 25, 2024
Django wrote:

I just wanted to make sure you had IsKey there as well.

I think it might be your PXSelector. You’re asking it to find a record in your table without considering the Revision number.

You might look at adding ,ValidateValue = false in the attribute for the PXSelector attribute. That would mean that you have to do other validations.

Interesting. Well trying it it doesn’t give that error anymore with that validatevalue part (it’s complaining about null values in other fields but I can fix that quickly enough). But this should allow me to get moving again next week. Thanks for the tip.


darylbowman
Captain II
Forum|alt.badge.img+13

Are you trying to allow multiple revisions for each Ref Nbr?


Forum|alt.badge.img
  • Author
  • Freshman II
  • 17 replies
  • October 28, 2024
darylbowman wrote:

Are you trying to allow multiple revisions for each Ref Nbr?

Hi. Yes, this is the goal.


darylbowman
Captain II
Forum|alt.badge.img+13
  • 1698 replies
  • Answer
  • October 28, 2024

I’m not certain this will work like you’re intending. If you look at a DAC like SOOrder, there is a composite key of DocType and RefNbr, but DocType is always selected first, after which the RefNbr is generated.


Forum|alt.badge.img
  • Author
  • Freshman II
  • 17 replies
  • October 28, 2024
darylbowman wrote:

I’m not certain this will work like you’re intending. If you look at a DAC like SOOrder, there is a composite key of DocType and RefNbr, but DocType is always selected first, after which the RefNbr is generated.

Yes, it seems like more trouble than its worth. I have taken revision id out of the key and it just manage its increment based on line changes and likely use audit to track revision changes for historical purposes.


Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • October 28, 2024

Hi @asnell64 

 

I have had this error before, it is to do with the PXSelector not finding a value for <NEW>, at least in my experience similar to what @Django said above.

 

As a test, you can comment out the PXSelector attribute and you shouldn’t receive the error.

 

Hope this helps,

Aleks

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings