Date Modified by Assignee

Hi Team,

I would like to implement a Date_Modified_by_Assignee field in the Opportunity module that is automatically set to the current datetime when the record is updated but only if it is being updated by the user whom the record is assigned to.  Is there a simple way to do this?

Dave

Parents
  • You can create a simple date field with some sugar logic. This will compare the first and lastname with the current user's first and last name and if so it will return the current date. Otherwise it will return "". But ofcourse you can return whatever is in that field at that moment. I haven't tested it myself so you need to check if it actually works. 

    ifElse(
    	equal(
    		concat(currentUserField("first_name"),currentUserField("last_name")),
    		concat(related($assigned_user_link,"first_name"),related($assigned_user_link,"last_name"))),
    		now(),
    		"")
    		
    

    Another approach would be to create a logic hook that checks if the current user is the same as the $bean->assigned_user_id and if this is the case set the field value using php code.

  • Hi Jeroen.  Thanks so much.  That does appear to be the foundation of a viable solution.  I replaced the "" with a reference to the field itself which seems to work.

    There is one weird thing though.  I'm finding that the now() function is returning the time rounded up to the next 5 minutes.  Any idea why this would occur?

Reply Children