the eclipse ide for salesforce admins - idealist · pdf filethe eclipse ide for salesforce...

of 28 /28
The Eclipse IDE for Salesforce Admins 1. Introduction a. How It Works 2. Installation a. Java Installation b. Eclipse Installation c. Windows installation d. Mac installation e. Starting Eclipse for the First Time f. Force.com Plug-In Installation 3. Creating a Salesforce Project In Eclipse 4. Searching the Project a. Use Case: Where is a custom field used? 5. Move Reports to Another Folder 6. Copying Fields to Another Salesforce Instance 7. Refreshing the Project 8. What Eclipse Cannot Do a. Cannot Delete Items b. Cannot Change API Names 9. Appendix A: Identifying Salesforce API Names a. Custom Object b. Custom Field c. Report d. Custom Report Type e. Workflow f. Email Template g. Page Layout 10. Appendix B: Editing the Eclipse.ini File 1. Introduction The Eclipse Integrated Development Environment (IDE) is an application used by developers to write Apex / Visualforce / Lightning code in Salesforce. However, it can be also used by Salesforce administrators for various tasks such as: Find out all the places where a custom field / object is used: Apex code, reports, custom report types, list views, page layouts, workflow rules and actions, and email templates Search for all reports that use a specific custom report type Mass-move reports from one folder to another

Author: trankhue

Post on 15-Mar-2018

225 views

Category:

Documents


0 download

Embed Size (px)

TRANSCRIPT

  • TheEclipseIDEforSalesforceAdmins

    1. Introductiona. HowItWorks

    2. Installationa. JavaInstallationb. EclipseInstallationc. Windowsinstallationd. Macinstallatione. StartingEclipsefortheFirstTimef. Force.comPlug-InInstallation

    3. CreatingaSalesforceProjectInEclipse4. SearchingtheProject

    a. UseCase:Whereisacustomfieldused?5. MoveReportstoAnotherFolder6. CopyingFieldstoAnotherSalesforceInstance7. RefreshingtheProject8. WhatEclipseCannotDo

    a. CannotDeleteItemsb. CannotChangeAPINames

    9. AppendixA:IdentifyingSalesforceAPINamesa. CustomObjectb. CustomFieldc. Reportd. CustomReportTypee. Workflowf. EmailTemplateg. PageLayout

    10. AppendixB:EditingtheEclipse.iniFile

    1.IntroductionTheEclipseIntegratedDevelopmentEnvironment(IDE)isanapplicationusedbydeveloperstowriteApex/Visualforce/LightningcodeinSalesforce.However,itcanbealsousedbySalesforceadministratorsforvarioustaskssuchas: Findoutalltheplaceswhereacustomfield/objectisused:Apexcode,reports,

    customreporttypes,listviews,pagelayouts,workflowrulesandactions,andemailtemplates

    Searchforallreportsthatuseaspecificcustomreporttype Mass-movereportsfromonefoldertoanother

  • Copyanobject'scustomfieldsfromoneorganizationtoanotherEclipserunsonWindows,MacandLinuxmachines.ThisdocumentwillexplainhowtoinstallandconfigureEclipseonWindowsandMaccomputersandisintendedforexperiencedWindows/MacuserswhoarecomfortableWindowsExplorerorOSXFinder,installingapplications,andworkingwithZiporDMGfiles.Also,youshouldbeunderstandhowtouseSalesforcesandboxesandhowtoobtainSalesforcesecuritytokens.Noprogrammingexperienceisrequired.

    a.HowItWorksTheIDEisbasicallyatexteditorthatallowsyoutoviewandeditSalesforcemetadata.MetadataisatextrepresentationoftheSalesforceitem,whetheritisafield,object,report,etc.ItisformattedinExtensibleMarkupLanguage(XML)format.

    XMLlookssimilartoHTMLinitsuseoftags,whicharekeywordsenclosedinangledbrackets.Forexample,hereiscustomfieldinXMLformat.Notethevarioustagslike,,etc.Custom_Field_01__cfalseCustomfield01CustomField0118false0falsefalseNumberfalse2.InstallationGototheSalesforceDeveloperwebsitetoreviewthelatestinformationabouttheinstallationprocess.https://developer.salesforce.com/page/Force.com_IDE_Installation

    https://developer.salesforce.com/page/Force.com_IDE_Installation

  • a.JavaInstallationBeforeinstallingEclipse,youmustinstallJavaStandardEditionDevelopmentKit(JavaSEJDK)fromOracleCorporation.AsofSeptember2015,theSalesforcewebpageadvisesusingJavaSEJDK7.x.However,Oraclenolongersupportsthisversion,soyoumustusethecurrentJava8.xversion.Gotothispagetodownloadandinstallthispackage.http://www.oracle.com/technetwork/java/javase/downloads/index.htmlIfyou'rerunning64-bitWindows,selecttheWindowsX64downloadfile.Ifyou'renotsure,selecttheWindowsx86downloadfile.

    DownloadandinstalltheJavaSEJDKonyourcomputer.

    http://www.oracle.com/technetwork/java/javase/downloads/index.html

  • b.EclipseInstallationTheSalesforcedeveloperpagewillstatethelatestversionofEclipsetodownloadandinstall.AsofSeptember2015,usetheKepler4.3version.OntheEclipsewebsite,selectEclipseIDEforJavaDevelopers.Your32/64bitchoiceofEclipsemustmatchthe32/64bitversionofJavathatyoujustinstalled.Ifyouhave64-bitWindowsandyouinstalled64-bitJavaSEJDK,youmustselectthe64-bitversionofEclipse.Ifyou'renotsureandyouinstalled32-bitJava,select32bitEclipse.IfyouhaveMacOSX,selectMacCocoa64-bit:

    c.WindowsinstallationEclipsedoesnothaveasetupprogramorprocess.Instead,youcanopenthezipfileanddragthe"eclipse"foldertothedesiredlocationonyourcomputer.ItdoesnothavetobeplacedintheProgramFilesfolder,anditwillnotappearintheControlPanel>ProgramsandFeatureslist.Youcanalsoextractthe"eclipse"folderfromtheZipfilebyright-clickingontheZipfileandchoosingExtractAll.However,youmayrunintoanerror"thefilename(s)wouldbetoolongforthedestinationfolder"duetothelengthofthebasefolderExample:abasefolderofthislengthwillresultinanerrorduringextraction.

    Selectashorterbasefolder.Onceyouextractedthe"eclipse"folder,youcandouble-clickontheEclipse.exetoruntheapplication.

  • d.MacinstallationTheEclipsefileforOSXisin"tar"formatandendsin"tar.gz".Double-clickthefiletoextractthe"eclipse"folderfromit.Youcanthendragthe"eclipse"folderintoyourApplicationsfolder.TorunEclipse,double-clicktheeclipseapplication(withtheglobeicon).

    e.StartingEclipsefortheFirstTimeWhenyoustartEclipseforthefirsttime,you'llbepromptedforyourworkspace.ThisisafolderonyourcomputerwhereEclipsewillstoreyourprojectfiles.Usethedefaultfolderorselectanotherfolder.Besuretotickthe"usethisasthedefaultanddonotaskagain"checkbox.ClicktheOKbuttonwhendone.

    f.Force.comPlug-InInstallationOnceyou'vestartedEclipsethefirsttime,followtheinstructionsontheSalesforcedeveloperpage(theresanInstallationStepssection)toinstalltheForce.complug-in.https://developer.salesforce.com/page/Force.com_IDE_Installation

    https://developer.salesforce.com/page/Force.com_IDE_Installation

  • 3.CreatingaSalesforceProjectInEclipseOncetheForce.complug-inisinstalled,youcancreateyourEclipseprojectforyourSalesforceinstance.Onthemainmenu,chooseFile>New>Force.comProject.

    You'llbepromptedforyourSalesforcecredentials.GenerallyyoushouldconnecttoyourSalesforcesandbox,nottoyourSalesforceproductioninstance.(Forthisdocument,weareusingaDeveloperEditioninstance,sotheEnvironmentissettoProduction/DeveloperEdition.)ClicktheNextbuttontocontinue.OntheChooseInitialProjectContactsscreen,choose"Selectedmetadatacomponents"andclicktheChoosebutton.

  • YoumayseeaPackageManifestContentWarningaboutcomponenttypesthatarenotsupported.Inmostcasesyoucanignorethismessage.ClicktheOKbutton.

    OntheChooseMetadataComponentsscreen,selectthefollowing: components classes email flows layouts objects-standard objects-custom pages reports reporttypes triggers workflows

  • ClicktheFinishbuttontocontinue.Thenyou'llseetheSalesforceitemsintheEclipsePackageExplorer.YourprojectmaydefaulttoWorkOfflinestatus.ToswitchtoWorkOnlinestatus,right-clickontheprojectnameandchooseForce.com>WorkOnline.

    Youcanexpandthefolderstoseethecontents.Forexample:herearethecustomreportsthatresideinthereportfolders.Alsodisplayedarethecustomreporttypesthathavebeencreatedinthisinstance.

  • HerearethereportsandreporttypeastheyappearinSalesforce:

  • 4.SearchingtheProjectEclipseismostusefulforsearchingforthenameofacustomobject,field,report,orreporttypetoseewhereitisreferenced.ItisbesttousetheAPInameoftheobject/field/reportetcwhensearching.SeeAppendixAonwheretofindAPInames.First,selectthesrcfolderinthePackageExplorer,thenchooseSearch>Search...fromthemainmenu.(Hint:youcanalsopressCtrl-H).

    Inthesearchwindow,makesuretheFileSearchtabisselected.EntertheitemnameintheContainingtextfield.MakesuretheScopeis"selectedresources"(i.e.,thesrcfolderyoujustselected),thenclicktheSearchbutton.

  • TheSearchtabwilldisplaytheresults.Hereyoucanseethatthefieldisusedinseverallayouts,reportsandreporttypes.

    Ifyoudouble-clickoneoftheitems,you'llseetheXMLmetadata.Hereisareportmetadatafilethatcontainsthefield.Thefieldisdisplayedasacolumnonthereport.

  • a.UseCase:Whereisacustomfieldused?Ifyouhaveacustomfieldandyou'renotsurewhereit'sused,youcansearchinEclipsetoseeifitappearsinanyreports,workflows,layouts,Apexcode,etc.HerearesomeexamplesofhowacustomfieldDemo_Opp_Field__cappearsinvariousareas.Withintheobject:Inaformulafieldnamed"DemoFormulaField":Onapagelayout:

  • Inalistview(the"AllOpportunities"listviewforOpportunity):Acolumninareport:Afilterconditioninareport.Theconditionis"DemoOppFieldequalsRenewal:"

  • Thereporttype(standardorcustom)usedbyareport.Inthisscreenshot,thereporttypeisacustomreporttype:Acriterioninanworkflowrule.Thecriterionis"DemoOppFieldequalsRenewal:"

  • Inaworkflowfieldupdateaction.InthisactiontheDemoOppFieldisbeingsetto"Continuing:"Inanemailtemplate:InanApexclass:

  • 5.MoveReportstoAnotherFolderYoucanuseEclipsetomovemultiplereportsfromonefoldertoanother.Thisisatwo-stepprocessthatinvolveseditingthepackage.xmlfileandalsomovingthereportXMLfilesonyourcomputer'slocaldrive.Forthisexample,we'llmoveallreportsfromtheDemoReportsFoldertotheNewReportsfolder.

    First,refreshtheproject'smetadatacomponentssoyougetthecompletelistofreportsandreportfolders.SeetheRefreshingtheProjectsectionfordetailsonhowtodothis.Next,openthepackage.xmlfile.ThisfileisanindexofalltheSalesforceobjectmetadataintheproject.

  • PressCtrl-ForchooseFindtoopentheFindwindow.Enter"Report"tofindthereportfoldersection.

    MovethereportstobelowNew_Reports_Folder,thenchangetheprefixfromDemo_ReportstoNew_Reports_Folderforeachreport.

    Thefilewindowtitlewillindicatethatachangehasbeenmade,sopressCtrl-S(orchooseFile>Save)tosave.NowyoumustmovethereportXMLfilesonyourcomputer'slocaldrive.InthePackageExplorer,right-clicktheDemoReportsfolder.

  • InthePropertieswindow,makeanoteoftheLocation.

    InWindowsExplorer(orMacFinder),navigatetothatfolder,thenmovethereportfilestothenewfolder.Inthisexample,thatisNew_Report_Folder.

    Next,youmustrefreshthereportsfolderinPackageBuilder.RightclickonreportsandselectRefresh.[Note:donotchooseForce.com>RefreshfromServer.]

  • You'llseethereportfolders'contentsupdatedinthePackageExplorer.Finally,right-clickonthereportsfolderandchooseForce.com>SavetoServer.

    ClickYestoconfirm.

    InSalesforce,thereportsarenowintheNewReportsFolder.

  • 6.CopyingFieldstoAnotherSalesforceInstanceIfyouhavealargenumberoffieldsthatyouwanttocopytoanotherorganization,youcan'tuseChangeSetsbecausetheycanonlybeusedamongproductionandsandboxinstanceswithinthesameorganization.However,youcancopythefields'XMLmetadatafromyourinstanceandpastethemintotheotherorganization'ssandboxinstance.Forthisexample,saywewanttocopythesetwoopportunitycustomfieldstoadifferentorganization.

    First,createasandboxandEclipsepro