how to change/override a date that is "calculated-read only" by using a button | Adobe Higher Education
Skip to main content
Level 5
January 20, 2023
Resuelto

how to change/override a date that is "calculated-read only" by using a button

  • January 20, 2023
  • 1 respuesta
  • 1437 visualizaciones

Good day,

I have a date field on my form that is calculated-read only.  The current date is entered each time the form is opened.  I would like to have a button that will allow a specific user to be able to change the date when needed.  Is there a way to do this?

 

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Vijay_Katoch

Remove the calculated property from the field. Make it readOnly to set the value and on the button click make the access to open.

1 respuesta

Vijay_Katoch
Community Advisor
Community Advisor
January 20, 2023

You need to change the "yourFieldName.access" property to desired value in button click event.

 

yourFieldName.access="open";

Level 5
January 25, 2023

Good day,

I did not reply that the answer was correct.  Actually, it's not working.  After entering the information in the click event, I get the following pop-up - "The value you entered for todaydate cannot override its calculated value".  When I hit "ok", the date reverts back to the today's date.

Level 5
February 10, 2023

Yes, on initialize event you need to set the date 

 

if(dateField.rawValue == null || dateField.rawValue == ""){

//set dateField value

}


ok. i got it to work by changing the value to  

"Read only" in the field and adding

$.rawValue = Num2Date(Date(), "YYYY-MM-DD") in the initializing event

and in the click event of the button I entered

oTargetField = this.resolveNode("header.datesub.todaydate");
oTargetField.access = "open";

 

How do I require a password on the click button so that only a user can do this?