RemoveUserFromProject

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Commands Reference > DBWArm >

RemoveUserFromProject

Description

With the DBWARM enabled, removes an user from the working list of the assigned project.

Syntax

call DBWShell("RemoveUserFromProject UserID ProjectID")

Parameters

UserID

name of the user to remove

project_id

project id to remove the user to

Remarks

warningThe DBWARM must be enabled.

Example

sub main

 DBWInit(TRUE)
 projectId = "Toy Tractor"
 userId = "Ciro"
 DBWShell("UserWorksInProject " & replace(userId," ","|") & " " & replace(projectId," ","|") )
 okWorks = DBWResult("@OKWORKS")
 if okWorks = 0 then
  DBWMsgBox userId & " does not work in project " & projectId & "." & vbcrlf & "I will add him now ..."
  DBWShell("AddUserToProject " & replace(userId," ","|") & " " & replace(projectId," ","|") )
 else
  DBWMsgBox userId & " works in project " & projectId & "." & vbcrlf & "I will remove him now ..."
  DBWShell("RemoveUserFromProject " & replace(userId," ","|") & " " & replace(projectId," ","|") )
 end if
 DBWShell("CloseSheet")
 DBWShell("OpenForBrowsing")
end sub