apex-code

How to Deploy an existing project in Force.com

大城市里の小女人 提交于 2019-12-24 12:44:13
问题 i am using eclipse IDE i am provided with an src folder which contains code i have to save this code into my development org. How i am trying to approach this 1.first i created a Force.com project 2.then i copy given src(Ctrl+c) folder and paste(Ctrl+v) in to my project in eclipse 3. i added metadata components by right clicking on project Force.com >Add/remove metadata components 4.then i right click on my project Force.com >Deploy to server i am getting failure error Deploy Results: File

How To Capture ISP Name?

独自空忆成欢 提交于 2019-12-24 03:27:07
问题 How do I capture the user's ISP name in Salesforce.com? The solution can be in JavaScript of in Salesforce.com such as Apex/VisualForce Pages. Example of a website which captures the user's ISP name is: http://whatismyipaddress.com/ Thanks! 回答1: You'll need to query a GeoLocation provider database that has the ISP provider information. Here is a list of providers listed on the page you've linked in your question: http://whatismyipaddress.com/geolocation-providers They usually require you to

How to I access reports programmatically in SalesForce using Apex

☆樱花仙子☆ 提交于 2019-12-23 13:05:04
问题 I'm trying to write an app on the SalesForce platform that can pull a list of contacts from a report and send them to a web service (say to send them an email or SMS) The only way I can seem to find to do this is to add the report results to a newly created campaign, and then access that campaign. This seems like the long way around. Every post I read online says you can't access the reports through Apex, however most or all of these posts were written before Version 20 of the API was

SOAP security in Salesforce

ぐ巨炮叔叔 提交于 2019-12-23 03:52:18
问题 I am trying to change the wsdl2apex code for a web service call header that currently looks like this: <env:Header> <Security xmlns="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"> <UsernameToken Id="UsernameToken-4"> <Username>test</Username> <Password>test</Password> </UsernameToken> </Security> </env:Header> to look like this: <soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse

Salesforce consuming XML and display data in Visualforce report

女生的网名这么多〃 提交于 2019-12-23 03:05:03
问题 Firstly, this question requires a bit of introduction so please bear with me. The high level is that I am connecting to a outside web service which will return some XML to my apex controller. The idea is that I want to display the XML returned into a nice tabular format in a VisualForce page. The format of the XML coming back will look something like this: <Wrapper><reportTable name='table_id' title='Report Title'> <row> <Element1><![CDATA[campaign_id]]></Element1> <Element2><![CDATA[577373]]

Debugging Schedulable Job in apex salesforce

雨燕双飞 提交于 2019-12-22 11:28:33
问题 i am trying to run a schedulable job i never used schedulable jobs in salesforce here is my code global class scheduledMerge implements Schedulable{ global void execute(SchedulableContext SC) { System.debug('Hello World'); } } created a cusom controller public class schedulableMerge{ public schedulableMerge(){ } public PageReference Hello(){ scheduledMerge m = new scheduledMerge(); String sch = '0 10 * * 1-12 ? *'; system.schedule('Merge Job', sch, m); return null; } } and visualforce page is

Using Apex Data Loader to load records into object with master details relationship

本秂侑毒 提交于 2019-12-22 10:46:15
问题 I need to load data into two objects. I am able to load data into one object using the data loader. The second object has a master-details relationship with the first object so I need to have the unique record id of the records of first object in the CSV file. How can I add those record id's to my CSV file? 回答1: You could download the "master" records after initial upload and perform some mapping similar to (Name -> Id). In Excel this could be achieved with VLOOKUP. Once you have generated

How to implement “Cancel” functionality in a VisualForce Page

坚强是说给别人听的谎言 提交于 2019-12-21 12:03:50
问题 I know that this is how to save a record <apex:commandButton action="{!save}" value="Save"/> I want a button to NOT save the current record (ie. Cancel) and navigate to the list of saved record (ie. list of objects for that object type). Something like this... <apex:commandButton action="{!cancel}" value="Cancel"/> 回答1: The list view for an object is your base URL / the 3 letter prefix for your object / o, for example: https://na1.salesforce.com/a0C/o So you could just create an action method

Visualforce Custom Controller List

孤者浪人 提交于 2019-12-18 05:21:15
问题 What I'm looking to do is create a custom controller list that displays a mash up of Opportunities, cases and potentially one other object. I started using the class from the visualforce guide to get me going: public with sharing class CasePagination { private final Case c; public CasePagination(ApexPages.StandardSetController controller) { this.c = (Case)controller.getRecord(); } public ApexPages.StandardSetController CaseRecords{ get { if(CaseRecords == null) { return new ApexPages

Get UserId from the Session Id and Server URL

a 夏天 提交于 2019-12-14 03:27:05
问题 I have a requirement, where I will be getting the Session Id and Server URL(parameters of a webservice method). Say like this: Session ID : 00D900000xxxxxx!ARUAQOb4VVoQR1UXlY_Hvuy1DdKdN6nSfnNJKYwPTF9R3tYuA2jzBsWXHIGDQUFL13iebnYSDKKC45H98TzVxxxxxxxxxx Server URL : https://ap1.salesforce.com/services/Soap/u/12.0/00D900000xxxxxx Now i need to get the User Id(or any other user details) from these two. Thanks in Advance!! Nitin 回答1: You could use the SOAP API, which has a GetUserInfo method.