I'm seeing an issue with trying to assign a user to a group. If I run the process and new manager has been added to a project it creates the group but does not assign the user. If I then run the process again (The group already exists) it still doesn't assign the user. Any idea what a) I'm doing wrong or b) what's the issue with my code. I took commitment issues out of it with the failure in the second run,
IF(vManager1Index<>0);
# Obtain the user name of the person being assigned
vManager1Name=Lower(DimNm(vManager1Dim,vManager1Index));
vManager1User=IF(DimIx(vUserDim,'Active Directory/'|vManager1Name)<>0
,'Active Directory/'|vManager1Name
,'Active Directory\'|vManager1Name
);
# Set what the name of the group will be for this user
vManager1Group=vManager1Name|'-GRP';
# Check to see if the name matches a valid user ID
IF(DimIx(vUserDim,vManager1User)<>0);
# Check to see if the group already exists and adds it if it doesn't
IF(DimIx(cSecGroupDim,vManager1Group)=0);
AddGroup(vManager1Group);
IF(iCounter=0);
vTextArray='<br>'|vManager1Group|'</br>';
Else;
vTextArray=vTextArray|'<br>'|vManager1Group|'</br>';
EndIF;
iCounter=iCounter+1;
EndIF;
# after checking the group assign the user
AssignClientToGroup(vManager1User,vManager1Group);
EndIF;
EndIF;
Struggling through the quagmire of life to reach the other side of who knows where. Go Build a PC Jimbo PC Builds on YouTube OS: Mac OS 11 PA Version: 2.0.7
We're set to security mode 5 and these are local groups. The users are coming in through CAM. For some reason we have active directory users with either a \ or a /, hence the check in my code,
Jim.
Struggling through the quagmire of life to reach the other side of who knows where. Go Build a PC Jimbo PC Builds on YouTube OS: Mac OS 11 PA Version: 2.0.7
HI Jim,
Had an issue recently with a process trying to do a similar thing i.e. add a group if did not exist and add the user to it in one process.
I ended up placing the
in the epilog and triggering based on a flag.
Don't think you are doing anything wrong may just be a glitch that has crept in - my system where this happened is 10.2.2 FP4
gtonkin wrote:HI Jim,
Had an issue recently with a process trying to do a similar thing i.e. add a group if did not exist and add the user to it in one process.
I ended up placing the
in the epilog and triggering based on a flag.
Don't think you are doing anything wrong may just be a glitch that has crept in - my system where this happened is 10.2.2 FP4
Excellent shout my friend. I'll give it a try. We're on 10.1.1 so it may be something that crept in with version 10. I'll let you know how it goes,
Jim.
Struggling through the quagmire of life to reach the other side of who knows where. Go Build a PC Jimbo PC Builds on YouTube OS: Mac OS 11 PA Version: 2.0.7
ardi wrote:AssignClientToGroup works only on Data Tab or Epilog Tab
I do indeed have it within the metadata tab which explains why it's not working. I had to to originally do it this way as I have element assignments happening in the data tab. I have as suggested moved the user assignment to the epilog so we should be good. Thanks for your input guys.
Struggling through the quagmire of life to reach the other side of who knows where. Go Build a PC Jimbo PC Builds on YouTube OS: Mac OS 11 PA Version: 2.0.7