Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Java Development
- :
- Re: Need code/objects for custom button allowing: ...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Need code/objec ts for custom button allowing: change status, change case owner, add comment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-07-2012 03:45 PM
Need code/objects for custom "Escalate" button on the case detail page that opens a window to allow support users to complete the following fields on the case object:
- Change the status (escalation should be the only choice in the drop-down),
- Change the case owner, and
- Add a comment
We will try to find information ourselves but any guidance appreciated.
Re: Need code/objec ts for custom button allowing: change status, change case owner, add comment
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-10-2012 03:48 PM - edited 12-10-2012 04:17 PM
I've got this so far, which seems to work, for Custom Button, behavior: execute javascript to just change status (See bottom below), but I need to open a new window, I guess, and allow user to select a different case owner and add a comment: (not sure how to do this yet)
URLs for Change owner and new comment for a certain case: (How to make these dynamic for this escalate button?)
https://na9.salesforce.com/500E0000003mvi6/a?retUR
https://na9.salesforce.com/00a/e?parent_id=500E000
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
caseObj.Status = 'Escalated';
var result = sforce.connection.update([caseObj]);
if (result[0].success=='false') {
alert(result[0].errors.message);
} else {
location.reload(true);
}
Re: Need code/objec ts for custom button allowing: change status, change case owner, add comment
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-18-2012 01:52 PM - edited 12-18-2012 01:53 PM
The following is working but users would like: the add comments window not open in a new tab, but wouldlike to stay in current tab like the behavior of the Close Case button. Need help with the syntax for changing this minor window opening preference.
I've tried scrUp and srcSelf but think these require apex objects. Probably something simple but cant seem to get it working.
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
parent.ID='{!Case.ParentId}'
caseObj.OwnerId = '00Gc0000000FXfv';
caseObj.Status = 'Escalated';
window.open('/00a/e?parent_id={!Case.Id}&retURL=/{
var result = sforce.connection.update([caseObj]);
if (result[0].success=='false') {
alert(result[0].errors.message);
} else {
location.reload(true);
}

