[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

Error Evaluation Expression

Hello,
  I thought that I set up my variables properly to send a personalized automated message but I am receiving the following error and cannot identify the problem, maybe I have been at it too long.

An error occurred while evaluating the expression:


#password#



Error near line 84, column 240.
--------------------------------------------------------------------------------

Error resolving parameter PASSWORD


ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:

You have misspelled the parameter name, or
You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.


Here is the code:
<cfquery name="getLogin" datasource="HSO">
              Select      CardNumber,FName1,LName1,custEmail
            FROM      savings_card
            WHERE      Email='#form.custEmail#'
        </cfquery>
  <cfoutput query="getLogin">
        
    <cfset email_to=#getLogin.custEmail#>
    <cfset password=#getLogin.CardNumber#>
   
 </cfoutput>
 
             <cfmail from="HSO@realestateone.com"
        to="#email_to#"
        subject="Home Savings Registration Confirmation"
        type="html">
        Thank you for registering for your permanent Home Savings One card. You can go into the site to review the directory now (hyperlinked) or come back anytime and login using #getLogin.FName1# #getLogin.LName1# with the password HSO #password#. Please look for your card to come in the mail within 2 weeks.<br /><br />

Home Savings Support Staff


        </cfmail>
0
jdines
Asked:
jdines
  • 4
  • 4
1 Solution
 
_agx_Commented:
<cfoutput query="getLogin">
    <cfset email_to=#getLogin.custEmail#>
    <cfset password=#getLogin.CardNumber#>
 </cfoutput>


You shouldn't need the extra variables.  What happens if you skip that part and just use

<cfif getLogin.recordCount eq 1>      
         <cfmail from="HSO@realestateone.com"
        to="#getLogin.custEmail#"
        subject="Home Savings Registration Confirmation"
        type="html">
        Thank you for registering for your permanent Home Savings One card. You can go into the site to review the directory now (hyperlinked) or come back anytime and login using #getLogin.FName1# #getLogin.LName1# with the password HSO #getLogin.CardNumber#. Please look for your card to come in the mail within 2 weeks.<br /><br />

Home Savings Support Staff
        </cfmail>
<cfelse>
       either the email wasn't found at all OR multiple records have the same email
       do some error handling here ...
</cfif>
0
 
jdinesAuthor Commented:
The parameters did not passthrough I cannot figure out what I am doing wrong.  Here is what I have:
      <cfquery name="getLogin" datasource="HSO">
              Select      CardNumber,FName1,LName1,custEmail
            FROM      savings_card
            WHERE      Email='#form.custEmail#'
        </cfquery>
              <cfmail from="HSO@realestateone.com"
        to="#getLogin.custEmail#"
        subject="Home Savings Registration Confirmation"
        type="html">
        Thank you for registering for your permanent Home Savings One card. You can go into the site to review the directory now (hyperlinked) or come back anytime and login using #getLogin.FName1# #getLogin.LName1# with the password HSO #getLogin.CardNumber#. Please look for your card to come in the mail within 2 weeks.<br /><br />

Home Savings Support Staff

        </cfmail>
             
        <br /><br />
        <cfoutput><table width="600" align="center"><p>Thank you for registering for your permanent Home Savings One card. You can go into the site to review the directory now (hyperlinked) or come back anytime and login using #getLogin.FName1# #getLogin.LName1#  with the password HSO #getLogin.CardNumber#. This information will also be emailed to you. Please look for your card to come in the mail within 2 weeks.<br /><br />

Home Savings Support Staff</p></table>

            </cfoutput>
        </cfif>

This was the result:
Thank you for registering for your permanent Home Savings One card. You can go into the site to review the directory now (hyperlinked) or come back anytime and login using with the password HSO . This information will also be emailed to you. Please look for your card to come in the mail within 2 weeks.

Home Savings Support Staff

Thank you so much for your assistance
0
 
_agx_Commented:
Works correctly for me.  But I noticed you removed the code checking the record count. Are you sure the query is finding the email? If not, that would explain why your output is blank. ie There's no information to email.

<cfif getLogin.recordCount eq 1>      
     the email was found. go ahead and run the <cfmail> code here
<cfelse>
       either the email wasn't found at all OR multiple records have the same email
       do some error handling here ...
</cfif>
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
jdinesAuthor Commented:
It actually sent the email but did not include the cardnumber or fname1 lname1.  Those areas were still blank, checked the table and the data is there but for some odd reason it is only retrieving the email address.  I think I will reboot the server to see if that fixes the problem, this was actually working Friday but I made a couple of changes today and ...well you know the rest.
0
 
_agx_Commented:
Check the query too ie cfdump var="#getLogin#". Because if the values show up in the query, they should show up in the email. Unless maybe they contained some special html characters ... ?
0
 
jdinesAuthor Commented:
It just gives me the field names not the actual data
0
 
jdinesAuthor Commented:
I figured out the problem, it was within the query one of the field names had been changed but not updated in the query.  Thanks so much for walking through this problem with me..you're awesome!
0
 
_agx_Commented:
Glad you got everything working :)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now