Skip to main content
Participating Frequently
November 22, 2010
Answered

Using isDefined/StructKeyExists against a .Net com object

  • November 22, 2010
  • 1 reply
  • 667 views

I'm doing some .Net integration and the values of the .Net object returned need to be inspected and then displayed if they are defined

I've found that the conversion process brings everything back as rootObject.Get_ObjectName().Get_Value() which blows up if the object is empty throwing an undefined error - However if I try and use isDefined("rootObject.Get_ObjectName") or StructKeyExists(rootObject,"Get_ObjectName) - it just doesn't work - If I add in the () at the end - it blows up Coldfusion

I can't just display everything because there may be elements that are empty - Has anyone else had this problem & have a solution?

This topic has been closed for replies.
Correct answer Dave Watts

It's not bringing back a structure that you can examine with those functions. Instead, just wrap your call to rootObject.Get_ObjectName().Get_Value() in a try/catch block.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

1 reply

Dave WattsCommunity ExpertCorrect answer
Community Expert
November 22, 2010

It's not bringing back a structure that you can examine with those functions. Instead, just wrap your call to rootObject.Get_ObjectName().Get_Value() in a try/catch block.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Dave Watts, Eidolon LLC
Participating Frequently
November 22, 2010

Thank you - you are a lifesaver - that worked perfectly

Community Expert
November 22, 2010

You're welcome!

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Dave Watts, Eidolon LLC