Any suggestions on what type of script I can use t...
# suitescript
p
Any suggestions on what type of script I can use to clear the recipient and email address when an email message record loads? From what I can see I cannot deploy a client script to Message so I tried a beforeLoad script but that did not work.
s
you can maybe inject HTML code using beforeLoad trigger by adding Inline HTML field
p
I did find a hint for a solution in suiteanswers but I am not able to set the recipient and email to being blank. I am able to change the recipient to an alternate contact but making it blank is not working:
Copy code
function setRecEmailAddress(type,form){
    var entityType = nlapiGetFieldValue('entitytype');
    var entity = nlapiGetFieldValue('entity');
    nlapiLogExecution('DEBUG','First log','Record type is : ' + entityType);
    
    //Search the Primary Contact
    if (entityType == 'custjob') {
        nlapiLogExecution('DEBUG','Executing','Script is executing');
        rec = '';
        recEmail = '';
        nlapiLogExecution('DEBUG','Contact\'s internal id','Contact\'s internal id is: ' + rec);
        nlapiSetFieldValue('recipient',rec);
        nlapiSetFieldValue('recipientemail',recEmail);
    }
    }
j
you can deploy to Message in SS1….
just not in SS2 annoyingly