Auto update one date field to another date field.

Hi ,
While choosing Date of Exit , Due date wants to auto update from Date of Exit plus 30 Days.
Please suggest me how to update due date.

you wan to do it on the fly? or is possible so that field gets updated after your save it?

best regards

I want to do it on fly itself. I want to show plus 30 days in due date field.

https://www.suitecrm.com/forum/suitecrm-7-0-discussion/11050-display-subpanel-based-on-field#37723

take a look at that post, it shows you how to attach a custom javascript file, with this you can manipulate things on the fly. Take a look how is done in the meetings module as a reference https://github.com/salesagility/SuiteCRM/tree/master/modules/Meetings

best regards

1 Like

Thanks mikebeck.

I found another solution to update.

http://share.ez.no/forums/developer/date-picker-pop-up

$('#date_exit_trigger').click(function(){
			Calendar.setup ({					
				inputField : "date_exit",
				form : "EditView",					
				ifFormat : "%m/%d/%Y %H:%M",
				daFormat : "%m/%d/%Y %H:%M",					
				button : "date_exit_trigger",
				singleClick : true,
				//dateStr : "11/07/2016",
				startWeekday: 0,
				step : 1,
				weekNumbers:false,
				onUpdate: dateChanged	
				}); 
				
		}); 

	function dateChanged(){
		var exitdate=$('#date_exit').val();			
		var newdate = new Date(exitdate);
		var actualdate = newdate.setDate(newdate.getDate()+30);
		actualdate = new Date(actualdate);
		var duedate = (actualdate.getMonth()+1)+"/"+actualdate.getDate()+"/"+(actualdate.getFullYear());
		$('#due_date').val(duedate);			
	}