Monday, March 26, 2012

package variable question

Hi Guys,

I'm trying to evaluate a user variable to ToLine expression property from SendMailTask.
My Question is, Is it possible to evaluate a user variable in expression(..)?

So, you have a variable in the user namespace that contains the string you want to use for hte ToLine? If so, given a variable named MyVar, the expression to use would be:

@.[User::MyVar]

Let me know if I misunderstood your question.
Mark|||

Larry Surat wrote:

Hi Guys,

I'm trying to evaluate a user variable to ToLine expression property from SendMailTask.
My Question is, Is it possible to evaluate a user variable in expression(..)?

Yes. Select your variable in the variables pane. Then, over in the properties pane, set EvaluateAsExpression=TRUE and Expression=<your expression>

-Jamie|||Hi Jamie,

I've tried setting the EvaluateAsExpression=TRUE of my variable but I still got error on my send mail task. The error is: "Error at Send Mail Task:No Recepient Specified".

Here's the situation. I'm retreiving an email address from a row and stores it to a variable varMailTo. From the Send mail task. I used expression for the ToLine Property. Initially, I supplied a value for the ToLine.
|||Hi Mark,

you've got my point...

My problem now is when i supply the said variable to the SendMailTask ToLine Property expression. I get the error. "Send Mail Task error: No recepient is specified" even if initially I supply the ToLine with an initial value. After executing the task, it removes the value I supplied.

I also tried setting the EvaluateAsExpression property of my variable to true..
|||That sounds like it should work Larry. Your process sounds correct so there's a small error in there somewhere, perhaps a syntax error or something.

Try to isolate the different parts of what you're trying to do. Good old message boxes can help here with debugging.

-Jamie|||Actually it sounds like you are not setting the variable in the correct location. Are you entering the variable name for the to line in the mail section of the editor or are you adding an expression for the to line from the expressions section of the editor? The former will not work because it takes the string as a literal. The latter is what you want because the variable's value will be used as the to line.

Setting the variable to evaluate as expression just means you have an expression in the variable that needs to be evaluated before it is applied to the property. So if your variable contained recip@.company.com you wouldn't need to evaluate as expression but if it contained "recip@." + "company.com" then you would since the variable needs to first be evaluated before being set into the property.

HTH,
Mattsql

No comments:

Post a Comment