Boolean communication between sheets and google scripts

I am trying to add a timestamp when a particular cell returns TRUE. With help from this community, I was able to modify the code below. It works perfectly if I type in TRUE. However, when a formula’s result returns TRUE, it does not work. I must be doing something wrong. Thanks in advance! here is the code:

 function onEdit() {
 var s = SpreadsheetApp.getActiveSheet();
 if( s.getName() == "Campaign" ) { //checks that we're on the correct sheet
 var r = s.getActiveCell();

 if( r.getColumn() == 17 ) { //checks the column 
        var nextCell = r.offset(0, 10);
  if( r.getValue() === true)
    nextCell.setValue(new Date()).setNumberFormat('MM/dd/yyyy');