getting a date field to auto populate when a new record in a related list created

patricklatella
Mega Sage

Hi helpful friends!

I previous opened a thread with a question to get a date field to auto populate when any change to a form is made, and it worked.   However it does not autopopulate if the first thing that is done on the form is to create a new record from a related list on the record.   Is this possible?

1 ACCEPTED SOLUTION

Ahh !!


I totally forgot that you are using scoped application


replace the below line


gr.date_reviewed = gs.nowDateTime();



with



gr.date_reviewed = new GlideDateTime();


View solution in original post

20 REPLIES 20

sachin_namjoshi
Kilo Patron
Kilo Patron

Hi Patrick,



Have to writte onload client script to populate date field on form?


This should work.



Regards,


Sachin


dvp
Mega Sage
Mega Sage

when any change to a form is made, and it worked.



Are you populating the date using a business rule?



If yes is the insert field checked?


patricklatella
Mega Sage

I am using a business rule.   I did not have "insert checked because I don't want the "date reviewed" field to populate UNTIL something is done to the record for the first time.   The issue I'm having is that if the first thing I do is to create a task under my related list, this does not trigger the "date reviewed" field to populate.   It does work properly when I make any other change to the form.


Hi Patrick,



When you insert record, then you need to enable "insert" checkbox in your business rule so that date review field is populated during insert also.



Regards,


Sachin