![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: getting the fullName attribute from a user Topic Summary: How do I check if the attribute exists? Created On: 20-Sep-2007 15:48 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: short addon: I ran the attached script on our database without any error messages?! So it should be working?! | |
![]() |
|
right now I'm running the code:
User u = find("user")
string uName = u.fullName
When I run this and there isn't a name it immediately throws a dxl error of "No such attribute exists"
To get around this error I was trying:
if(!isAttribute(u, "fullName")
to check if it exists, but this always comes out false even when there is a full name to be found. My question is how do I find out without throwing a dxl error if the user has a full name listed?
|
|
![]() |
|
![]() |
|
Hi Brian,
could it be that the DXL error message isn't from fullName but from non existing user? You can check if user exists by using: bool existsUser(string) function. Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
ah sorry I didn't mention that, I verify that the user indeed exists (I do that check, also to reinforce it I use my own user name). Also when I run uName = u.fullName and it's a user that has a name (like my own) it runs fine, but with that same user name I run the: if(!isAttribute(u, "fullName")) and it does not recognize the attribute and returns false. Again is there anyway to check if the user has a full name listed without throwing a dxl error?
|
|
![]() |
|
![]() |
|
The 'isAttribute' command only works for user-created 'properties'. fullName is a 'standard' property and so will always return false, unless of course you create a user-created property called 'fullName'.
Its odd you get errors. Try this: string uName = "" noError() uName = u.fullName if (!null lastError()) uName = "" // ignore errors - Louie |
|
![]() |
|
![]() |
|
Hi Brian,
Louie is right by differentiate between user defined and system defined user properties. I think the fullName system property should not fail at all so it should not create an DXL error. The fullName property was introduced with Doors 8, so it should be runable for any valid User handle. If the user's fullname is not set it will return null string. If you indeed get an DXL error message, please let us know about your configuration: server version client version operating systems on server and clients was the user's database migrated somhow from an older version? Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
short addon:
I ran the attached script on our database without any error messages?! So it should be working?! ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
Thanks for the help, it seems that if the database isn't setup to have that attribute it will through an error (such as with West Lafayette's server), but on server's with it nothing should happen.
|
|
![]() |
Telelogic DOORS
» DXL Exchange
»
getting the fullName attribute from a user
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.