The Eclipse IDE for Salesforce Admins - Idealist · PDF fileThe Eclipse IDE for Salesforce...

Click here to load reader

  • date post

    15-Mar-2018
  • Category

    Documents

  • view

    221
  • download

    0

Embed Size (px)

Transcript of The Eclipse IDE for Salesforce Admins - Idealist · PDF fileThe Eclipse IDE for Salesforce...

  • 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