You need to sign in to do that
Don't have an account?
Erich.Weihrauch
Message Edited by Erich.Weihrauch on 04-16-2008 12:43 PM
Javascript looping through text in a case field
Good morning everyone.
I'm trying to create a javascript for a button I have for a case, that can take in the contents of a field, and open them up via a new hyperlink window for each entry in that field.
Essentially the field would be comprised of text signifying external JIRA cases, e.g. SW-12, SW-32, etc.
In the field you could enter in multiple cases, and seperate them with a comma. I want the javascript to loop through the field, pull out each case, and open a seperate window or tab in the browser for those cases.
The code I have thus far is:
Code:
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")} var c = new sforce.SObject("Case"); c.JIRA = "Case.JIRA_Case__c"; var mySplit = c.JIRA.split(","); for(i = 0; i < mySplit.length; i++) { window.open('http://server:8080/browse/'.c.JIRA); }
I'm not the best when it comes to javascripting these days (I'm a bit rusty :) ), though I figured that should work as a simple array to figure out the field and open the hyperlinks.
What am I doing wrong? Any help would be greatly appreciated :)
Message Edited by Erich.Weihrauch on 04-16-2008 12:43 PM
Nevermind I guess, fixed it :)
You may also be interested in knowing about this connector written by CustomWare that links JIRA to SFDC:
http://www.customware.net/repository/display/AtlassianPlugins/Salesforce.com+JIRA+Plugin
http://confluence.atlassian.com/display/JIRAEXT/Salesforce.com+JIRA+Integration