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

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.

So if I understood it correct you would like to update date reviewed field even when the task is created?



The current business rule will not work as the task is a different table. You need to write a business rule on task table with insert checked


patricklatella
Mega Sage

Hi Sachin,


so are you saying enable "insert" and as well to disable the "update" box?   or leave them both checked?


patricklatella
Mega Sage

when I check the "insert" box it populates the "date reviewed" field before I do anything to the form...I need it to stay blank until I do some kind of update, or if I create a task in the related list...whichever I do first


If you want to populate "date reviewed" on creating related list record, then you can create business rule on related list table to populate date reviewed on your parent table.



Regards,


Sachin


patricklatella
Mega Sage

hi thanks guys!



OK that sounds good...so do I need an advanced script on that BR?