Create External Link

Hi all,

I get an error while trying to create an external link with the following code:
 

ExternalLink el
 
Object o = current
 
print create(o, "Description", "Name", outward, openAsURL, "www.ibm.com", el) "\n"
 
follow(el)

 


I get:
no access to source object
-R-E- DXL: <Line:7> unassigned variable (el)
-I- DXL: execution halted

Can anyone help?

Regards,
Manuel

 


ManuelFelger - Thu Apr 29 10:13:35 EDT 2010

Re: Create External Link
llandale - Thu Apr 29 12:06:13 EDT 2010

"no access to source object" is obviously from your print statement. If the create failed, then the returned ExternalLink variable 'el' will not be assigned, triggering the DXL error. This is cleaner:

ExternalLink el = null
Object o = current
string ErrMess = create(o, "Description", "Name", outward, openAsURL, "www.ibm.com", el)
if (null el or !null ErrMess)
  print "Error creating ExternalLink: [" ErrMes "]\n"
else follow(el)

 


Anyway, it appears you don't have the module open Edit, or Shared with the object locked; or perhaps you do but lack modify rights to it.

Perhaps add "if (!canModify(o)) then don't even try"

 

 

 

  • Louie

 

 

Re: Create External Link
ManuelFelger - Fri Apr 30 03:13:07 EDT 2010

llandale - Thu Apr 29 12:06:13 EDT 2010

"no access to source object" is obviously from your print statement. If the create failed, then the returned ExternalLink variable 'el' will not be assigned, triggering the DXL error. This is cleaner:

ExternalLink el = null
Object o = current
string ErrMess = create(o, "Description", "Name", outward, openAsURL, "www.ibm.com", el)
if (null el or !null ErrMess)
  print "Error creating ExternalLink: [" ErrMes "]\n"
else follow(el)

 


Anyway, it appears you don't have the module open Edit, or Shared with the object locked; or perhaps you do but lack modify rights to it.

Perhaps add "if (!canModify(o)) then don't even try"

 

 

 

  • Louie

 

 

Doh! Forgot to open the module exclusive..

Thank you Louie