Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript help in ITIM

Status
Not open for further replies.

frito1981

MIS
May 11, 2005
4
US
hey everyone i am having a hard time figuring this out, just seeing if anyone has any ideas..
the process.auditEvent are just like Print outs..so i can see where data is getting lost..i am losing the data on the second container search right after the SearchByFilter..i know this cause the length of array RoleResult is 0..I even tried replacing rolefilt with what should exactly be there and still cant get the requester..What i am trying to do with this code is take a person based on where sits in tree is going to be who approves him for certain role..so role is not dynamic just where they could be in tree. and i have all that working just some how that second search doenst seem to be working...thanks for your help ahead of time

process.auditEvent(person.get()):

//gets ther user's organization from self enroling
var thisPerson = person.get();
var locationName = thisPerson.getProperty("l");
if (locationName.length < 1)
{
process.setResults("SF" , "Location attribute was not passed correctly.");
}

//find user's organization
var filt = "(erglobalid =" + locationName[0] + ")";
process.auditEvent(filt);

var locationSearch = new ContainerSearch();
//find user's organization in the tree
var orgResult = locationSearch.searchByFilter("OrganizationalUnit", filt, 2);
var org = orgResult[0];

process.auditEvent(org);
process.auditEvent(orgResult.length);

//find the role appropriate and fwd the request
var rolefilt = "(erparent=erglobalid=" + org.getProperty("erglobalid")[0] + "*);
process.auditEvent(rolefilt);

var roleSearch = new ContainerSearch();
var roleResult = rolesearch.searchByFilter("Role", rolefilt, 2);

process.auditEvent(roleResult.length);

return new Participant(ParticipanyType.ROLE, roleResult[0]);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top