I am attempting to display the contact number (GetExtension) of the current user logged in and generating a report.
The following code successfully displays the name of the logged-in user when placed within Birt's Expression Builder (Dynamic text field):
`var result = "USERID";
try {
result = Packages.uk.co.blah.session.Session.getUserID();
} catch (error) {
Packages.java.lang.System.err.println(error);
}
result;`
However, I have not been able to get the Extension method to display using the same code adjusted for 'getExtension':
`var result = "EXTENSION";
try {
result = Packages.uk.co.blah.session.Session.getExtension();
} catch (error) {
Packages.java.lang.System.err.println(error); result;`
After trying a different approach by directly accessing the package path instead of session.Session:
`var result = "EXTENSION";
try {
result = Packages.uk.co.blah.systemmanagement.personnel.getExtension();
} catch (error) {
Packages.java.lang.System.err.println(error);
}
result;`
Unfortunately, this only returns the word ‘EXTENSION’.
Is there a way to utilize getExtension based on the logged-in person obtained through getUserID?