You need to sign in to do that
Don't have an account?

Change Case owner via URL hack?
I'm trying to create a custom case button that will change the case owner. We have professional edition so code that utilizes API can't be used. I've found some solutions online but they all require API.
Anyone have any suggestions? Thanks a million!!
Assuming:
Queue Name: "Tier 2"
Queue ID: 00G600000010FUZ
The button might look like this:
/{!Case.Id}/a?retURL=%2F{!Case.Id}&save=1&newOwn=Tier+2&newOwn_lkid=00G600000010FUZ&saveURL=%2F{!Case.Id}
All Answers
Hi,
Why do not use Change Owner list button on the Case's home page.
Thanks,
Kodisana
Sorry, let me provide more details. We want a button that will reassign a case to a queue, and furthermore it would be nice to have several of the fields updated (I know how to do this part, so i omitted it). We could use the change case button, but then the user would have to type the queue name and save the change, rather than just having a single button that does the same thing.
Thanks
You do have workflow, right? You can use a standard URL hack to hack some random custom field, and then use a workflow that triggers on that custom field being a certain value to set the owner and those other fields, and to set that custom field back to its original value.
No workflows in professional edition. goddamn salesforce. thanks for the suggestion though.
My Suggestion is that Use the Change Owner button and write a validation rule on case object, So that users will not select any other queue.
Thanks,
Kodisana
Assuming:
Queue Name: "Tier 2"
Queue ID: 00G600000010FUZ
The button might look like this:
/{!Case.Id}/a?retURL=%2F{!Case.Id}&save=1&newOwn=Tier+2&newOwn_lkid=00G600000010FUZ&saveURL=%2F{!Case.Id}
It worked! Rpee, my friend - you are a genius! :smileyvery-happy:
Oddly the one thing I thought I knew how to do isn't working (changing case status). I'm adding &cas11=Feedback to the end but its not updating status. Maybe it can't be done at the same time as changing case owner, as that same line works in one of my other buttons...
Is it possible to change fields in the case at the same time with this button? I'm hoping to utilize some specific escalation rules that would be triggered by the field changes (in addition to the case owner change).
Thank you!!!!!
The problem that you are running into is that /a? is a different request than /e?
What would have to happen is the following:
/{!Case.Id}/e?save=1&cas11=Status&saveURL=%2F{!Case.Id}%2Fa%3Fsave=1%26newOwn=Queue%26newOwn_lkid=QueueID%26saveURL=%2F{!Case.Id}
I may have done the last part of that wrong, but the key is you have to make two requests in one click and the 2nd request has to be fully URL encoded (except "=" ) & - %26 ? - %3F
Good luck.
Thanks Rpee, I'll try to figure the rest out on my own :p Thanks for all the brain power, really appreciate the help.
That was it! No editing required outside of swapping in my specific IDs. You are a true gentleman and a scholar Rpee!! Huzzah!!
I'm going to name by children after you!
Nice. Glad it worked.
very cool.. I am trying to do something similar, but over-ride the save button on edit of my custom object.
I can override edit, and point to your kind of content as the saveURL..
it does in fact chaneg the variable, but then 'stops' on the edit page..
when I press Save again, it DOES save, but then puts up and error
here is my edit button override
window.parent.location.href = "{!URLFOR($Action.Problem__c.Edit , Problem__c.Id ,
[saveURL=URLFOR("/" &Problem__c.Id & "/e?00N30000006DgFN=0&retURL=" &"/" & Problem__c.Id & "/a?save=1&retURL=/" & Problem__c.Id), retURL=URLFOR("/" & Problem__c.Id) ] ,false) }"
}
when I press Save the first time, which changes the checkbox, the URL then becomes
https://na1.salesforce.com/a0O30000002K79X/e?00N30000006DgFN=0&retURL=%2Fa0O30000002K79X%2Fa%3Fsave%3D1&retURL=%2Fa0O30000002K79X&newid=a0O30000002K79X
and when I press save the url becomes
https://na1.salesforce.com/a0O30000002K79X/e?save=1
but that produces an error
Error: Invalid Data.
Review all error messages below to correct your data.
The page you submitted was invalid for your session. Please click Save again to confirm your change.
what am I missing to keep the pages processing without stopping?
sam
@sdetweil, I don't think this particular type of URL hack works anymore. A better solution would be to make a custom button in the vein of this blog post (but that changes OwnerId instead of the Status field).
this hack worked in november..
I don't want to change any existing standard field.. only a custom field on a custom object.
I need to change the field to cause a trigger to work.. so I need to intercept the 'save' operation.
see my trigger help question in this board a few messages up.
http://boards.developerforce.com/t5/General-Development/trigger-control-help-needed/td-p/247311
Sam
So there was an update half a year ago that made new SFDC orgs default a particular permission as ON instead of OFF. Existing orgs are uneffected, but any new trial or dev org after July 10 or so has this setting.
You need to submit a case with support to stop the "This page is invalid for your session" errors.
Disable Validate CSRF Token on GET
Please Disable the Org-Wide permission "Validate CSRF Token on GET" so that save=x will work in buttons and formulas.
Warning: This change was made to prevent cross-site scripting attacks and in order to generally tighten the security of the platform. Salesforce.com does not recommend making this change. But, for me, being able to do save=1 is worth the risk.
Also, Tier 1 support won't know what you're talking about. This needs to get escalated in order to work.
Ok, got it.. understand the issue..
I was just able to think thru a tiny change to the trigger which eliminates needing this subclass Save approach..
Sam
Indeed, and as per my post to your other thread sdetweil, in general you (or anyone) should try to avoid this type of URL hack, particularly since it increasingly does not work. Glad to hear you were able to get your trigger working.
I have a case create page with links to a page create with specific passed parameters, this is one example.
<a href="/500/e?retURL=/{!case.id}&RecordType=012E00000005wqE&cancelURL=/{!case.id}&ent=Case&cas5=Problem&cas28={!case.casenumber}&cas4_lkid={!case.account}&cas3_lkid={!case.contact}&CF00NE0000005DBMr_lkid={!case.atc_contact__c}&CF00NE0000005DBMr={!case.atc_contact__r.Name} &cas8=Low&cas21=1&cas11=Internal&cas14={!Case.Subject}&cas15={!Case.Description}&newOwn_lkid=00Gc0000000jOoE&newOwn=CA+Account+Verification" target="_self">CA Account Verification</a><br />
Any help appreciated....