Skip to main content
Answer

Apps 9 - Is there a way i could restrict a date field to only allow a user to a date of today or greater?

  • January 23, 2021
  • 4 replies
  • 116 views

Forum|alt.badge.img+11

We have an issue where some users enter a wanted date in the customer order in the past ( 2020Instead of 2021!)

perhaps I could create an event which fires a message to user? Would like to stop them altogether really so perhaps an event that doesn’t allow a past date?

Any ideas?
 

Best answer by anmise

Great thanks, any ideas how I would write the code that would prevent entry of less than TODAY?? I have some ideas but not entirely sure how to write it 

Should be as simple as setting up the event on the LU where the date will be set and then checking the entered date against variable #TODAY# or sysdate e.g.

BEGIN
IF '&NEW:DATE' < '#TODAY#'
THEN
Error_SYS.Appl_General('LogicalUnit', 'ERROR: The date must be greater than today');
END IF;
END;

 

 

This topic has been closed for replies.

4 replies

william.klotz
Superhero (Customer)
Forum|alt.badge.img+21
  • Superhero (Customer)
  • January 24, 2021

Hi @BLLBrucemo ,

 

I do not know of a way to configure a field to perform a validation test but your thought on using an event to evaluate the wanted date is spot on.  You'll have to evaluate on insert and updating.  You may also want to validate the order line wanted date as well.

 

Regards,

William Klotz


Forum|alt.badge.img+11
  • Author
  • Sidekick (Customer)
  • January 24, 2021

Great thanks, any ideas how I would write the code that would prevent entry of less than TODAY?? I have some ideas but not entirely sure how to write it 


  • Superhero (Employee)
  • Answer
  • January 25, 2021

Great thanks, any ideas how I would write the code that would prevent entry of less than TODAY?? I have some ideas but not entirely sure how to write it 

Should be as simple as setting up the event on the LU where the date will be set and then checking the entered date against variable #TODAY# or sysdate e.g.

BEGIN
IF '&NEW:DATE' < '#TODAY#'
THEN
Error_SYS.Appl_General('LogicalUnit', 'ERROR: The date must be greater than today');
END IF;
END;

 

 


Forum|alt.badge.img+11
  • Author
  • Sidekick (Customer)
  • January 27, 2021

Thanks! Works a treat