Skip to Content
0

BO 4.1 java sdk not able to pick "SI_ALIASES"

Jul 11, 2017 at 07:05 AM

42

avatar image

Hi,

I am trying to get the list of BO users and their alias status in our 4.1 system. The below line is what i am using to get the 'alias name' and 'alias status'.

1)aliasName=iInfoObject.properties().getProperties("SI_ALIASES").getProperties(1).getProperty("SI_NAME").toString();

2)aliasStatus=usercount2.properties().getProperties("SI_ALIASES").getProperties(1).getProperty("SI_DISABLED").toString().toUpperCase();

I am able to fetch the aliasName but the getting an empty string for the aliasStatus.

Note: The same code is fetching the aliasStatus correctly when run with BO 3.1 libraries. Only BO 4.1 libraries does not seems to fetch the aliasStatus with the above line.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Joe Peters Jul 11, 2017 at 03:17 PM
2

getProperty() returns an IProperty object, and the SI_DISABLED property is a boolean. I'm not sure why, but IProperty.toString() (and IProperty.getValue().toString()) does not property render boolean values (it shows an empty string for false and a "1" for true). You can instead use:

.properties().getProperties("SI_ALIASES").getProperties(1).getBoolean("SI_DISABLED")

Or better, cast to IUser and use the native methods:

Iterator<IUserAlias> iAlias = iUser.getAliases().iterator();
while(iAlias.hasNext())
{
   IUserAlias alias = iAlias.next();
   System.out.println(alias.getName());
   System.out.println(alias.isDisabled());
}
Share
10 |10000 characters needed characters left characters exceeded
Ram kumar Vijayakumar Jul 13, 2017 at 10:22 AM
0

Hi Joe,

Many thanks for the help,

Boolean AliasStatus=usercount2.properties().getProperties("SI_ALIASES").getProperties(1).getBoolean("SI_DISABLED");

aliasStatus = AliasStatus.toString().toUpperCase();

The above way has worked for fetching the 'alias status'. But is there any direct API to fetch the Alias status for the User as a whole instead of the individual aliases assigned for the User ?

In the attachment the highlighted field is what i am trying to fetch instead of the individual status of the alias assigned for the User.

Thanks,

Ramcapture.jpg


capture.jpg (96.9 kB)
Share
10 |10000 characters needed characters left characters exceeded