Connecting Tech Pros Worldwide Forums | Help | Site Map

how to reassign records

Newbie
 
Join Date: Feb 2009
Posts: 27
#1: Apr 20 '09
hi all

can anybody tell me the logic or the code how to reassign some records from one user to another user

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Apr 21 '09

re: how to reassign records


You need to give more details than that.
Newbie
 
Join Date: Feb 2009
Posts: 27
#3: Apr 21 '09

re: how to reassign records


hi r035198x,


Say for example u have an user admin and another user ahila.u have some modules like accounts,contacts,leads etc where u have some records.
i want to reassign a particular module(with all the records included) from one user to another user and get updated.

thanks in advance
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#4: Apr 21 '09

re: how to reassign records


Then it would depend on the table structures you have but ultimately all you would do is run an update statement that changes the user_id to the new value.

Having said that, it all sounds very inappropriate. Why would you want reassign those records to another user? Why not rename the user who owns the records to the new user. You do less work that way.
Newbie
 
Join Date: Feb 2009
Posts: 27
#5: Apr 21 '09

re: how to reassign records


hi r035198x,

actually i m trying out a module myaccount in sugarcrm where u have an option for reassigning records.There u can reassign the records of one particular module to another user.

This is done in the case where an employee quits the job, or not in the position to complete the job.Then the work(records) is assigned to some other user(employee) or a team member.

Able to get it.
And for u r kind info i m not that much sound in php and mysql (at the beginner level).
This is a task i m trying out for myproject work .

kindly get me an idea on how to go about it

thanks in advance
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#6: Apr 21 '09

re: how to reassign records


Doesn't sound like a good design. This is what roles should be used for. The work records should be modifiable by someone in a particular role not just by a specific individual.
When an employee quits, just create a new employee, give him the same role as the old guy and the work proceeds as normal.
That way the system is more informative and more flexible. You can determine who did which part of the work.
Newbie
 
Join Date: Feb 2009
Posts: 27
#7: Apr 21 '09

re: how to reassign records


oh ok

i will try out that in that manner

thanks r035198x
Reply