apex-code

Salesforce.com Id attribute seems to have a 15 and 18 character value, whats the difference?

£可爱£侵袭症+ 提交于 2019-12-04 00:57:09
When using the SOAP API to work with salesforce.com (SFDC) it seems that the primary key in the underlying database is Id. Well there seems to be two representations of this value as either a 15 character version or an 18 character version. I have been using the 18 since it is clearly more specific, but what is contained in the last three digits, that they can be dropped, seemingly? Anyone understand what this is all about? From the Web Services API Developer's Guide : ID fields in the Salesforce.com user interface contain 15-character, base-62, case-sensitive strings. Each of the 15

Salesforce - How to Deploy between Environments (Sandboxes, Live etc)

核能气质少年 提交于 2019-12-02 20:23:28
We're looking into setting up a proper deployment process. From what I've read there seems to be 4 methods of doing this. Copy & Paste -- We don't want to do this Using the "Package" mechanism built into the Salesforce Web Interface Eclipse Force IDE "Deploy to Server" option Ant Script (haven't tried this one yet) Does anyone have advice on the limitation of the various methods . Can you include everything in a Web Interface package? We're looking to deploy the following items: Apex Classes Apex Triggers WorkFlows Email Templates MailMerge Templates -- Can't seem to find these in Eclipse

How to receive the SMS via twilio

[亡魂溺海] 提交于 2019-12-02 18:09:47
问题 I have installed the twilio package and following components. How do I configure the two components? When customer sends an sms it does not create a case in the sandbox. I am unable to receive sms details. What is the twilio message url where should I give in the salesforce? I am completely new to twilio configuration. Can someone please help. Whenever customer sends an sms, then it should create a case in the sandbox automatically by using twilio api . Component 1: Visual force Fage <apex

Creating a test class for a Select Statement

无人久伴 提交于 2019-12-02 10:35:39
I was wondering if you could help me. I am strugging to create a test class for the code below. Any help would be appreciated. Many thanks public class MatchReadyImage { public Match_Day_Check_List__c obj {get; set; } public MatchReadyImage(){ obj = [ Select Id, Match_Day_Ready_Status__c From Match_Day_Check_List__c Where Name = 'Everton V West Ham United Goodison Park EPL 2013-05-12' ]; } } You just need to create a test data which will be selected by your code, because the data from Org is not available in test context. After that you have to instantiate MatchReadyImage class and validate

How to receive the SMS via twilio

青春壹個敷衍的年華 提交于 2019-12-02 08:32:46
I have installed the twilio package and following components. How do I configure the two components? When customer sends an sms it does not create a case in the sandbox. I am unable to receive sms details. What is the twilio message url where should I give in the salesforce? I am completely new to twilio configuration. Can someone please help. Whenever customer sends an sms, then it should create a case in the sandbox automatically by using twilio api . Component 1: Visual force Fage <apex:page controller="TwilioRequestControllerContacts" action="{!init}" showHeader="false" sidebar="false">

How to unit test works in salesforce?

泄露秘密 提交于 2019-12-01 23:30:29
I've done writing code on salesforce and in order to release the unit tests have to cover at least 75% . What I am facing is that the classOne that calls methods from classTwo also have to cover classTwo 's unit test within classOne even though it is done in classTwo file already. File MyClassTwo public with sharing class ClassTwo { public String method1() { return 'one'; } public String method2() { return 'two'; } public static testMethod void testMethod1() { ClassTwo two = new ClassTwo(); String out = two.method1(); system.assertEquals(out, 'one'); //valid } public static testMethod void

How do i get all picklist values from a field in salesforce using REST Api?

我们两清 提交于 2019-12-01 20:35:39
问题 I am trying to get all picklist values from a field in salesforce using REST API. Is it possible to do that? If it is then how it can be done? Thanks, Raj. 回答1: It's very simple. You need to access resource similar to this: /services/data/v26.0/sobjects/Opportunity/describe (use whichever object you want) and the JSON response will contain fields node: 来源: https://stackoverflow.com/questions/14231878/how-do-i-get-all-picklist-values-from-a-field-in-salesforce-using-rest-api

placeholder is not working in IE9

一个人想着一个人 提交于 2019-12-01 11:11:21
I am salesforce (SFDC) developer. In my visualforce page for input box I am using placeholder code. <div class="control-group"> <label class="control-label visible-desktop" for="first_name">First Name</label> <div class="controls"> <input class="input-block-level" name="First Name" id="first_name" placeholder="First Name" value="" type="text" required="required" autofocus="autofocus" /> </div> </div> I checked in internet for some CSS hack but I didn't find any. I find some javascript hack. HTML5 Placeholder jQuery Plugin https://github.com/mathiasbynens/jquery-placeholder Demo & Examples http

placeholder is not working in IE9

不打扰是莪最后的温柔 提交于 2019-12-01 08:07:46
问题 I am salesforce (SFDC) developer. In my visualforce page for input box I am using placeholder code. <div class="control-group"> <label class="control-label visible-desktop" for="first_name">First Name</label> <div class="controls"> <input class="input-block-level" name="First Name" id="first_name" placeholder="First Name" value="" type="text" required="required" autofocus="autofocus" /> </div> </div> I checked in internet for some CSS hack but I didn't find any. I find some javascript hack.

Visualforce Custom Controller List

笑着哭i 提交于 2019-11-29 08:34:14
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.StandardSetController(Database.getQueryLocator( [SELECT c.CaseNumber, c.AccountId, c.Subject, c.Status FROM