• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using isDefined/StructKeyExists against a .Net com object

New Here ,
Nov 22, 2010 Nov 22, 2010

Copy link to clipboard

Copied

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?

TOPICS
Advanced techniques

Views

511

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 22, 2010 Nov 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

Votes

Translate

Translate
Community Expert ,
Nov 22, 2010 Nov 22, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 22, 2010 Nov 22, 2010

Copy link to clipboard

Copied

Thank you - you are a lifesaver - that worked perfectly

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2010 Nov 22, 2010

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation