Skip to main content
Inspiring
January 26, 2011
Question

Cfexhange - uid not defined

  • January 26, 2011
  • 1 reply
  • 1244 views

I need to know why i am getting this error. Sample UID from exchange...

1<7a1c300c-1b95-48ae-9ff9-1dbfaa143972@casnysm95baap.nysemail.nyenet>
2<f143e6e8-82b7-4d39-a730-6ca5955c0f84@casnysm95bafp.nysemail.nyenet>

----------------

Error:

Element UID is undefined in DISTINCTVALUES.

The error occurred in C:\inetpub\wwwroot\test0\exchange.cfm: line 37
35 : 
36 :      <cfoutput query="distinctvalues">
37 :         <cfexchangeMail action="delete" connection="myExchangeConnection"  uid="#distinctvalues.uid#"> 
38 :      </cfoutput>

--------------------

<cfexchangemail action="get" name="spamMail" connection="myExchangeConnection" folder="Junk E-mail">

<cfexchangefilter name="fromID" value="search@cio.ny.gov">

</cfexchangemail>

<cfquery

dbtype="query" name="distinctvalues" >

SELECT lower(uid) as myid

FROM spamMail

</cfquery>

<cfdump

var="#distinctvalues#">

 

<cfoutput query="distinctvalues">

<cfexchangeMail action="delete" connection="myExchangeConnection" uid="#distinctvalues.uid#">

</cfoutput>

This topic has been closed for replies.

1 reply

Inspiring
January 26, 2011

Well, ask yourself this question:

Does the column UID exist in distinctValues?

No.

Why not?

Have a look at the QoQ you use to create distinctValues.  Do you see any mention of UID in there?  Yep.  But are you returning a column called UID in that query? No.  You are changing its name to myid.

--

Adam

emmim44Author
Inspiring
January 26, 2011

I changed that...but still same error

UID not found.

The error occurred in C:\inetpub\wwwroot\test0\exchange.cfm: line 37
35 : 
36 :      <cfoutput query="distinctvalues">
37 :         <cfexchangeMail action="delete" connection="myExchangeConnection"  uid="#distinctvalues.myid#"> 
38 :      </cfoutput>

Inspiring
January 26, 2011

Nooo, that's not the same error, is it?

First error:

Element UID is undefined in DISTINCTVALUES.

Second error:

UID not found.

Different.

So what is the error telling you?  You're passing a UID to Exchange and asking it to delete that record for you.  Exchange is telling you "UID not found".

I suspect it has something to do with you lower-casing you UIDs.  CF might be case-insensitive (except, like in situations where it is a minimal wrapper for Java functionality like QoQ, as you have discovered), but Exchange might not be.  So a UID of "abc" might not be the same as a UID of "ABC".

OR... it could be a symptom of CF's Exchange support being pretty... um... "lacking in polish", shall we say.  Be before condemning CF, what happens if you do NOT lower case your UIDs?

--

Adam