Recipient is not defined

salvdangelo

26-04-2018

Hi,

I am using a javascript that should work both for RECIPIENT and LISTS in this way:

<%

...

function isEmpty(val){

    return (val === undefined || val == undefined || val == null || String(val).length <= 0) ? true : false;

}

var user;

if(!isEmpty(recipient.crmId)){

     user = String(recipient.crmId);

}else{

     user = String(targetData.crmId);

}

...%>

I am testing this script with 2 cases:

1) Query on recipient + delivery #1 -> it works

2) Query on list + delivery #2 -> it does not work

I get this error when I am using a list (target mapping of the delivery is "external file" and there is no "recipient" inside the delivery template):
JST-#ID# Error while compiling script 'content htmlContent' line 6186: recipient is not defined. SCR-#ID# JavaScript: error while evaluating script 'content htmlContent'

so I'm guessing that the issue is inside the IF above (not working as I were expecting).

Anyone could tell me how to solve it?

Thank you,
Salvatore

Jean-Serge Biron

inactiveforumnotifier

Amy_Wong

Woojin

Debbie

Adobe Campaign

Accepted Solutions (0)

Answers (0)