Setting default value from parent

scwillson
Mega Guru

I am attempting to do what I initally thought would be simple, but I just can't get it working.

I am trying to set the default value of a date field on the change_task form to match that of a date field on the parent change specified in the 'change_request' field.

first I tried javascript: current.expected_start = current.change_request.start_date;

Even after multiple attempts at slightly modifying the code to approach it differently, still nothing would populate. So I decided to go the route of script include.

Even then, it still wouldn't pull the value of the date field.

Is the script in the default value definition run on the Client or Server?

1 ACCEPTED SOLUTION

scwillson
Mega Guru

I just pit the bullet and put in script in 2 different areas (I was hoping for a single solution).



I added script in the task generation Workflow action to populate the dates from the parent Change into the Change Task.


I also implemented an onLoad client script that populates the same date fields from the parent if the date field is empty.


View solution in original post

8 REPLIES 8

That is what I tried, but it didn't work.


No, just never tried that. But i usually avoid using default values on dictionaries.



In this case i think if we do this , wont it go updating all the existing records(at least the ones that are blank).


-Anurag



Hadn't considered that consequence of default value.


scwillson
Mega Guru

I just pit the bullet and put in script in 2 different areas (I was hoping for a single solution).



I added script in the task generation Workflow action to populate the dates from the parent Change into the Change Task.


I also implemented an onLoad client script that populates the same date fields from the parent if the date field is empty.