+ Start a Discussion

Custom button to save and change owner of a custom object record?

Hi everyone,

I'm the salesforce administrator for my company, but I have only basic Javascript skills. I'll give you the details of what I want to accomplish and then how I've gone about it so far-- maybe someone here can either A) tell me an easier way to accomplish what I want, or B) help me finish these last steps. I have Professional edition, by the way, so workflows are not an option for me.


What I want to accomplish: When our tech support team creates a case, it is automatically assigned to the associated Account's owner. WIthin the case, however, I want to be able to assign a step of the process (like a task but more in-depth, regular tasks won't work because you can't assign to a queue) to a Quality Assurance queue. When one of these task records is created, the QA team would receive an email notification that a new record has been assigned to their team, and they can fight amongst themselves about who gets to work on the case, updating the record as they go. 


What I've done so far: I created a custom object called "QA's Tasks" and got the custom object to appear as a related list on the case page, so I can successfully create one of these records from a case page as tech support would. I also created the QA Queue, added members, checked the "Send email to members" box, and selected the custom object "QA's Tasks" in the "Supported Objects" box on the queue page. The queue is sending emails to the correct people when I manually assign a record to it, so it's working.


The problem: When a tech support worker creates one of these Tasks for the QA team, the Task is assigning them as the owner and not the QA Queue. The only way to get the Task assigned to the queue is by manually changing the owner on the record after it's saved. I was thinking of creating a custom button that will save and then change the record owner to the queue at the same time, but I've found you can't put a custom button on an edit page, so maybe I can have the regular Save button programed to also change the record owner. But I have no idea how to do that. I want to take the manual step of having to change the record owner out of our process because I'm positive our tech support workers will forget that vital step, and QA will never be notified. Anything I can do to automate it will be a step in the right direction.


Any ideas or advice for me? Should I just tell the QA manager I'm using regular tasks, assigning all the tasks to her, and she has to be the "queue" ?? I'm not looking forward to that conversation. Help!

Chris JohnChris John

How about using regular tasks and assigning them to a new 'queue user', whose email is an email alias for your qa team? This way the whole qa team receives the emails and you could then create reports based on tasks assigned to the queue user etc.


Alternatively, you could have a scheduled job running somewhere which connected through the API, polling any tasks not assigned correctly, and updating the owner to your queue.


Without access to Apex or Workflow rules, not sure what else to suggest, sorry.