• SamuelDeRycke
  • SMARTIE
  • 1014 Points
  • Member since 2012
  • Technical Architect
  • PwC


  • Chatter
    Feed
  • 37
    Best Answers
  • 1
    Likes Received
  • 5
    Likes Given
  • 9
    Questions
  • 323
    Replies
Hello folks,

First of all, I'm a newbie on SalesForce, so accept my apologies if my question sounds dumb.

I have to create a trigger that creates a task after an e-mail is sent from Activity History in a custom object. I am trying to use MyCustomObject__History but I'm getting the following error: SObject type does not allow triggers: MyCustomObject__History.

Does anyone can confirm if it is possible to create a trigger for "__History" objects?

Many thanks in advance.
Hi everyone,

I am helping build a product and would like users to be able to change an error message (without using the translate feature).  

Is there any way in APEX that I can check for the existence of a Custom Label?  Something like this:

<pre>
// THIS CODE WILL NOT SAVE IF THE "Label.Overwrite_Error" DOESN'T EXIST
String sError = Label.Standard_Error;
If(Label.Overwrite_Error != NULL) sError = Label.Overwrite_Error;
</pre>

Any help would be greatly appreciated!  I don't want to use Custom Settings if at all possible.

Thank you!
Hi,

As per the summer'14 release notes, salesforce has added the read-only fields InstanceName and IsSandbox to the Organization object. I'm trying to add the following query to my apex classes:

Organization currOrg = [Select IsSandbox from Organization limit 1];

But when I try to save the code, I'm getting the following error:

No such column 'IsSandbox' on entity 'Organization'.

It works fine if I run the above query using developer console, returning 1 row with OrgId and true (testing in sandbox). I don't understand why I can't save my apex classes with this query. Any help is appreciated. 

Thanks!


Hi there,

We're have written an apex controller for vfp and the test coverage is 100%. However the average across all class/trigger is only at 55% because of some Triggers pulling it down. Is there a way we could exclude these triggers from being fired in our test class?

 

  • August 30, 2012
  • Like
  • 0

I am working on a project that I need to compare one item to another based on a createdby.id.  Here is the code I have written, but for some reason it does not find the createdby.id of the initial object.  Here is the code I have.

 

    Set<ID> cbid = new Set<ID>();
    for (ChargentSFA__Transaction__c cb : trigger.new) {
        cbid.add(cb.createdby.id);
                }

 

timeclock__c tm = [select id, name from Timeclock__c where in_out_day_today__c=1 and in_out_month_this_month__c=1 and in_out_year_this_year__c=1 and Out_Date_Time__c=false and createdby.id in :cbid limit 1];

hello Everyone,

   I'm writing  a test class for a simple controller and it gave me 85% of code covered........ I want 100% of it how can I get it

 

@istest
private class sharewidgettest{
public static testmethod void testsharewidget(){

ApexPages.StandardController Controller;
sharewidget wid = new sharewidget(controller);
wid.save();

}
}

 

and this is my class

 

public class ShareWidget {

public string widgetid{get;set;}

public Share_Widget__c element{get;set;}
public ShareWidget(ApexPages.StandardController controller)
{

widgetid = apexpages.currentpage().getparameters().get('id');
system.debug('iiiiid'+widgetid);

if(widgetid == null)
{
element = new Share_Widget__c();
}
else
{
element = [select Name,Widget_Code__c from Share_Widget__c where id = :widgetid];
}
}

public pagereference Save() {

if(widgetid == null)
{

insert element;
}
else {

update element;

}
system.debug('ele'+element);
pagereference widpage = new apexpages.standardcontroller(element).view();
widpage.setredirect(true);
return widpage;
}

}

  

I have a trigger that invokes a callout on insert of a custom object.

 

In the test below, I only get 33 % code coverage, since the inner classes Response and Data isn't covered by the test. How can I test them?

 

My class:

 

public with sharing class OuterClass {
    @future (callout=true)
    public static void doCallout() {
        //Callout occurs here normally, but to simplify:
        String body = '{"status":1,"data":[{"id":"33e26b70-ec3e-11e1-bbc0-bfcb6088709b","name":"Testname","created":"2012-08-16T14:24:32"}]}';
        getData(body);
    }
    
    public static void getData(String body) {
        Response r = (Response) JSON.deserialize(body, Response.class);
        System.debug(r.status);
        for (Data d : r.data) {
            System.debug('d.id: ' + d.id);
        }
    }
    
    class Response {
        public Integer status;
        public Data[] data;
         
        public Response(Integer status) {
            this.status = status;
            this.data = new List<Data>();
        }        
    }
    
    class Data {
        public String id;
        public String name;
        public String created;
         
        public Data(String id, String name, String created) {
            this.id = id;
            this.name = name;
            this.created = created;
        }        
    }
}

 

My testclass:

 

@isTest 
private class TestOuterClass {
    static testMethod void testOuterClass() {
        //Creating test data...
        
        Test.startTest();
        insert testdata;
        Test.stopTest();
    }
}

 

I am getting an invalid Type Error on the following code.

 

Code is from the force.com workbook example. Any suggestions as to how to resolve this error. Thanks!

 

public with sharing class ApexTest {	

	public enum Season {Summer,Fall}
	public string modelNumber;
	public Integer numberInStock;
	public static final Integer stockThreshold = 5;

	public ApexTest() {
	modelNumber = 'XX-XX';
	numberInStock = 0;
	system.debug('------------------------------------///////no values, but model number is : ' + modelNumber);
	}
	
	public ApexTest (String theModelNumber, Integer theNumberInStock) {
	modelNumber = theModelNumber;
	numberInStock = theNumberInStock;
	system.debug('------------------------------------///////2  values, but model number is : ' + modelNumber);
	} 

	public interface KitchenUtility {
	   String getModelNumber();
	}
	
	public class Toaster implements KitchenUtility {
	 private String modelNumber;
	  public String getModelNumber() {
		return 'T' + modelNumber;
	  }		
	}
	
	public void setModelNumber(String theModelNumber) {
	   modelNumber = theModelNumber;
	}

	public String getModelNumber() {
           return modelNumber;
	}
}

Calling code :

ApexTest f = new ApexTest('MX', 200);
Toaster t = New Toaster(); 	// This line has the error: Invalid Type Toaster

KitchenUtility [] utilities = new KitchenUtility[] { f, t };
String model = utilities[0].getModelNumber();
System.debug(model);

 

I've been trying to figure this out for about a week now and I know it has to be something simple that I'm missing.  What I'm trying to accomplish is create a trigger to fire after a case  that will see if case submitter has an associated partner that it should be assigned to.  I am doing this with two

queries and then the update.  Here is the trigger

 

trigger Reassign on Case (after insert) {
case c = trigger.new[0]; 

AccountPartner[] acctPrt = [Select AccountToId FROM AccountPartner WHERE AccountFromId IN (Select accountid FROM contact where Email = :c.SuppliedEmail)];   
  
Account acct = [Select isPartner FROM Account where ID=  :acctPrt[0].AccountToId]; 

if (acct.IsPartner == true) {    
c.OwnerID = '<some owner id>';
c.Status='Waiting Activation';
c.StatusReason__c='Assigned';
update c;
}
}

 

 Here is the test class and I plug in contact and account info from the sandbox

@isTest
public class TestReassign {
  static testMethod void myUnitTest(){
  	List<Case> cases = new List <case>{};
    Case s = new Case();
    s.SUPPORT_LEVEL__C = 'Gold';
     s.Status = 'Waiting Assignment';
     s.STATUSREASON__C = 'New';
    s.ENVIRONMENT__C = 'Development/Test';    
    s.VERSION__C = Decimal.valueOf(8);
    s.Origin = 'Phone';   
    s.Product__c = 'AB';
    s.AccountId = '<id>';
    s.SuppliedEmail = 'user@2.com';
    s.Subject = 'This is partner user ';
    cases.add(s);
    
        Case t = new Case();

     t.AccountId = ',id.';
    t.SUPPORT_LEVEL__C = 'Gold';
    t.Status = 'Waiting Assignment';
    t.STATUSREASON__C = 'Activated';
    t.ENVIRONMENT__C = 'Development/Test';    
    t.SuppliedEmail = 'user@1.com';
    t.VERSION__C = Decimal.valueOf(8);
    t.Origin = 'Web Portal';    
    t.Product__c = 'AB';
    s.ContactID = '<id>';   
    t.Subject = 'This is the ned user';
    
    cases.add(t);     
    
    
    test.startTest();
    try
    {
    	insert cases;
  
     
    }
    catch(System.DMLException e)
    {
     // System.assert(e.getMessage().contains('Record not added'));
    }
    
    test.stopTest();
}
}

 

What I receive is lines 19-23 not covered (beginning with "if (acct.IsPartner == true)"

 

I'm writing a trigger to update a multi-select picklist. However, I'm having trouble adding more than one value to the field.

 

Here's the scenario - we have a number of fields on the record that may or may not be null. They are also all associated with different reasons, which make up the values of the ChangeTag__c multi-select picklist field. If the fields are NOT null, then the corresponding reason needs to be selected in ChangeTag__c.

 

One record can have any given number of reasons. Below is a portion of the code that I wrote:

 

//(4) update Change Tag field based on new field values
for(integer i=0; i<ChangeRequestUpdateList.size();i++){
if(dd.RFP_Template__c!=null){dd.ChangeTag__c='Terms & Conditions';}
if(dd.Legal_Terms__c!=null){dd.ChangeTag__c='Terms & Conditions';}
if(dd.Ad_Server__c!=null){dd.ChangeTag__c='Ad Server Change';}
if(dd.ReTargeting__c!=null){dd.ChangeTag__c='ReTargeting Change';}
}
update ChangeRequestUpdateList;
}
}

 

The issue is that if there are multiple fields that aren't null, only one reason shows up in ChangeTag__c. For example, if RFP_Templace__c!=null and Ad_Server__c!=null, the only value that gets updated to ChangeTag__c is 'Ad Server Change.' Any ideas on how to write the code so that both 'Terms & 'Conditions' and 'Ad Server Change' are selected? There are way more fields and reasons than what is included above, so it would be nearly impossible to write out every combination.

 

Thank you so much!

 

Hi All,

 

Just a quick question. If I set a history tracker for one of the field now, will the history of that field prior the date I enabled showup in the history?

 

Thanks

Abhishek

Hi,

 

I am new in salesforce and I'm working on my first test code.

Can I have a test method example for some code below:

public class Myclass
{

public List< Something__c> Something { get; set; } 
   
    public Myclass() {   
 

    Something=[SELECT Name, Something__r.Name FROM Somethings__c WHERE Somethings__r.ID = :ApexPages.currentPage().getParameters().get('id')  ]; 

                      }
}

 

 

Any help would be greatly appreciated.

A Question to the boarders:
If I am using apex:include to include 4 VF pages in another VF page, Will it take governor limits for each separately Or is it combined? And suppose that those 4 VF pages have their own controllers. I think the limits are separate for each page. Like to know what others think about this. Probably someone has a solid answer....

 

Thanks.... 

public class MyAccountTeamContacts {
 
    public MyAccountTeamContacts(ApexPages.StandardController controller) {
        
    }
    
    User U = CurrentUser();
    
    list <AccountTeamMember> ATMS (){
      return [select  AccountId from AccountTeamMember where Userid = 'u.id'];
        }
    
   public List<Contact> getGSC () {
   return [select name, title, email, Client_Function__c, phone from contact where accountid IN: ATMS ];
    }
  
} // end class MyAccountTeamContacts

 trying to gather a list of Contacts at accounts the running user is on the Account Team for.

Am getting 

Save error: Variable does not exist: ATMS

though i thought i just built ATMS. Can someone assist? thanks.

  • August 15, 2012
  • Like
  • 0

Hi,

 

I have two objects which are related contacts and relationships and in relationship i have a formula field which fills in  values A OR B OR C OR D from user record and i am trying to get this information to the contact from relationship .

 

So i created a long text field on Contcts and wrote a trigger on relationships , everything works great. But the only pb is if i have records with values A or b or c or d  more than once then on my long text field it displays more times  but i want it to dispaly only once( i.e for 1 contact there can be 100 relationshps out of which it can have any values a,b,c, or d but i want only once to display)  how can i acheive this.

 

 

 

 

trigger ContactRelationshipTrigger on Relationship__c (after delete, after insert, after update) {

// fires after both insert and update


if((Trigger.isInsert || Trigger.isUpdate) && Trigger.isAfter){

// find the ids of all Contacts that were affected


Set<Id> ContactIds = new Set<Id>();
for (Relationship__c ar : [select Id, Contact__c from Relationship__c
where Id IN :Trigger.newMap.keySet()])
ContactIds.add(ar.Contact__c);

// process the Contacts


ContactRelationshipTriggerHandler.ProcessRelationshipsAsync(ContactIds);

// fires when records are deleted. may want to do undelete also?
} else if(Trigger.isDelete && Trigger.isAfter){

// find the ids of all Contacts that were affected
Set<Id> ContactIds = new Set<Id>();
for (ID id : Trigger.oldMap.keySet())
ContactIds.add(Trigger.oldMap.get(id).Contact__c);

// process the Contacts


ContactRelationshipTriggerHandler.ProcessRelationshipsAsync(ContactIds);

}

}

-------------------------------------------------------------------------------------------------------------------------------- 

public with sharing class ContactRelationshipTriggerHandler {

@future
public static void ProcessRelationshipsAsync(Set<ID> ContactIds){

// holds a map of the Contact id and comma separated Relationships to build
Map<Id, String> ContactRelationshipMap = new Map<Id, String>();

// get ALL of the Relationships for all affected Contacts so we can build
List<Relationship__c> ContactRelationships = [select id, Contact__c,
Brand__c from Relationship__c
where Contact__c IN :ContactIds order by Brand__c ];

for (Relationship__c ar : ContactRelationships) {
if (!ContactRelationshipMap.containsKey(ar.Contact__c)) {
// if the key (Contact) doesn't exist, add it with Relationship name
ContactRelationshipMap.put(ar.Contact__c,ar.Brand__c);
} else {
// if the key (Contact) already exist, add ", Relationship-name"
ContactRelationshipMap.put(ar.Contact__c,ContactRelationshipMap.get(ar.Contact__c) +
', ' + ar.Brand__c);
}
}

// get the Contact that were affected
List<Contact> Contacts = [select id from Contact where Id IN :ContactIds];

// add the comma separated list of Relationships
for (Contact a : Contacts)
a.Brands__c = ContactRelationshipMap.get(a.id);

// update the Contacts
update Contacts;

}

}

 

Thanks ,

Akhil.

  • August 09, 2012
  • Like
  • 0

How to get rich inputtext in VF Page

I have a VF page that is using a datatable.  When I get to 50 rows, I am getting the error message.  How do I code for additional rows, or can I set the number of rows to be displayed on the page ? 

 

 

  • August 08, 2012
  • Like
  • 0

What is MVC??

 

I know it as MODEL(objects) VIEW(visualforce) CONTROLLER(apex).

 

 

Why we will call as MVC, and if some one asks what is MVC what definition i can tell.

 

What is the use of MVC architecture??

  • August 07, 2012
  • Like
  • 1

 

How to increase the width of <apex:outputField> tag?

 

I have done the following:

 

<apex:pageBlockSection>

    <apex:outputField style="width:400px;" value="{!abc.bcd__c}"/>

<apex:pageBlockSection>

 

Its not working.

 

I have included a css file also as below:

 

<apex:page  ---------------     >

<apex:form>

<style type="text/css">

.myclass { width:550px; }

</style>

-----------------

----------

--------

<apex:pageBlockSection>

    <apex:outputField styleclass="myclass" value="{!abc.bcd__c}"/>

<apex:pageBlockSection>

 

 

Its not working.

 

Can anyone help?

 

 

 

 

Hi all.

 

We're setting up a large custom authenticated website in visual force for our customers. Exploring the visitation statistics of our current website we've noticed there are some people datamining our pages. 

 

We'd like to implement something into our Visual force pages that can detect and block datamining/page scraping. Has anyone faced this already, or know of a good solution ?  AppExchange nor google didn't give any results.

 

Thanks

 

 

There is a governor limit, that limits you to 20 concurrent API calls to the same URL endpoint. Any other concurrent calls will receive an exception. This is a hard limit and salesforce won't increase it for us (possible for other limits).

 

"A callout request to a given URL is limited to a maximum of 20 simultaneous requests."

 

I'll start with explaining why this is an issue to us, we're developing a site on force.com,  in where our customers will be able to manage their account,  manage their  sub-users and search our catalog, place&manage orders, etc. Some of that is located in salesforce, but some data, like or catalog is too big. I is stored in a seperate database, fully focussed on performing fast search on huge data quantities, at which salesforce still performs under our requirements.

 

Now, our idea was to just get the data from the other database over REST, and i've already implemented a test scenario using Remote Javascript functions, and it works great. Search functionality is a core concept of our website, and we're making  calls to the catalogue to perform autosuggest, per keystroke. This combined with calls that will be made on actual search, and other features of our website we expect to hit this governor limit very fast, as soon as having only 100 users online at the same time. We have a large international customerbase, and are thus worried and looking for a way around this governor limit.

 

Expecting the exception and making  new call in the catch (in recursive fashion) isn't something we believe is the way to go on this (are we wrong ?).  Has any of you already faced (and overcome ) this problem ? Or insights on how you would tackle this, are both grealy appreciated !

This has been driving me insane for the last few hours, and I can't find a solution. I hope someone with more VF experience can help me out.

 

I have a VF page which uses a template, but in addition to the stylesheets linked in the template,  I link an additional one in the pages with specific css. In the output it's added to the page head correctly, and all page content on the page is styled as should be. Including the content in the repeater. But when rerendering, it's content isn't styled.

 

The linked css is actually a VF mage with content type txt/css, I tried using a static resource css file, but that made no difference.

 

<apex:page cache="true" showHeader="false" contentType="text/css">
.. css content
</apex:page>

 

My page displays a list  (using apex:repeater) of sf idea's (but that ofc should not be relevant), and has a prev&next page commandlink on the bottom of the page which uses the nex soql offset to imlement pagination. You get the point, the repeater showing the content is reloaded , works perfectly, all data is there but BAM , none of the additional css styles applied to it whatsoever. However, some of the css linked in the css template are applied. But even when adding the additional styles to the page template, they are not applied either.  Where am I going wrong here ?

 

the page:

 

<apex:page id="test_ideahome" showHeader="false" title="{!$Label.site.site_login}" standardStylesheets="false" controller="SW_IdeaHomeController">
     <apex:stylesheet value="{!$Page.SW_IdeaCSS}" />
  <apex:composition template="{!$Site.Template}"> 
    <apex:define name="body" > 
   
       <div class="button-center-wrap">
         <apex:Outputlink styleclass="button addIdea" value="{!$Page.SW_IdeaNew}">Post your own idea</apex:Outputlink>
       </div>
       <hr/>
       <apex:form >
            <apex:pageblock id="idea_list">
                <apex:outputtext style="padding:20px;" value="The Idea community could not be found !" rendered="{!noCommunity}" />
                  <apex:outputtext style="padding:20px;" value="There are no idea's yet, click the link above to post one yourself!" rendered="{!noideas}" />
                    <section id="ideas">
                       <apex:repeat value="{!Ideas}" var="idea" id="ideaRepeater" rendered="{! noideas==false}">
                           <article>
                                <div class="content-wrap">
                                    <span class="score">
                                        <apex:outputText value="Score: "/>
                                        <apex:outputText styleclass="score-number" value="{! text(idea.VoteTotal) }"/>
                                    </span>
                                    <div class="text">
                                        <h1>
                                            <apex:commandLink action="{!gotopage}" value="{!idea.title}" ><apex:param name="id" value="{!idea.Id}"/></apex:commandLink>
                                        </h1>
                                                                        
                                        <p>
                                            <apex:outputText value="{! idea.body }" escape="false"/>
                                        </p>
                                    </div>
                                </div>
                                    
                                <aside>
                                    <strong class="comments"><apex:outputText value="{! text(idea.numcomments)}"/></strong>
                                    <apex:outputText value="comments"/><span>|</span>                  
                                    <apex:outputText value="posted on:"/>
                                    <strong>
                                        <apex:outputtext value=" {0,date,yyyy.MM.dd}" >
                                            <apex:param value="{! idea.createddate}" />
                                        </apex:outputtext>
                                    </strong><span>|</span>
                                    <apex:outputText value="posted by:"/>
                                    <strong><apex:outputtext value="{! idea.createdby.communitynickname}" /></strong><span>|</span>
                                    <apex:outputText value="lastcomment on:"/>
                                    <strong><apex:outputtext value="{! text(idea.lastcommentdate)}" /></strong><span>|</span>
                                    <apex:outputText value="status:"/>
                                    <strong><apex:outputtext value="{!idea.status}" /></strong>
                                </aside>
                            </article>
                         </apex:repeat>
                    </section>
            <div class="pager">
                <apex:commandlink styleclass="button prevButton" value="Previous page" action="{! prevPage}" rerender="idea_list" rendered="{! page_offset!=0}"/> <apex:commandlink styleclass="button" value="Next page" action="{! nextPage}" rerender="idea_list" rendered="{! noideas==false}"/>
            </div>
            <hr />
            <div class="button-center-wrap">
                <apex:Outputlink styleclass="button addIdea" value="{!$Page.SW_IdeaNew}">Post your own idea</apex:Outputlink>
            </div>
            </apex:pageblock>
            
        </apex:form>
     </apex:define>
    </apex:composition>  
</apex:page>

 All of this is on Authentication site pages, but I doubt that is relevant, the profile of the user with which i'm testing has access to all pages, including the css page, etc. All is styled fine on pageload, including the content in the repeater. But when rerendering, it's content isn't styled.

 

It happens in chrome,FF and IE so its not browser related.

 

 

I've only started with salesforce 3 months ago, but I'd like to try getting certified before the summer '12 exame is out. Upto what time can I still get certified as administrator doing the spring exame ?

 

Thanks

Scenario:

 

I have a REST service which returns the account of a portal user, and the subaccounts to that account. It works fine, but I need test code coverag, a problem likely not unfamiliar to many around these parts.

 

I know how to test REST services, well easy ones at least, but have a problem with generating required data, and relations between it in apex. My rest service uses the accoutnId field on a user, and then querries the account and its subaccounts, I would prefer to not rewrite my perfect working service because I don't know how to get test coverage, so I ask your help.

 

The accountId field on a user is not writeable, yet always filled in when creating a customer portal user based on a contact, i think this uses the Site.CreatePortal user, possible i'm wrong in this ? I tried doing it like that in code, and ran into the following error:

 

System.UnexpectedException: Method not yet implemented: createPortalUser(User, String)

 

Any advise or insights are highly appreciated !

 

@IsTest()
  	global static void testGET(){
  		
  		//add data
  		
  			//account 
	  			Account pa = new Account(name='test parent acc');
	  			insert pa;
  			
  			//subaccount
  				Account sa = new Account(name='test sub acc',ParentId =pa.id);
	  			insert sa;
  	
  			//user
  			
  				Profile p = [SELECT Id FROM Profile limit 1];
  				User u = new User(lastname='De Rycke',
  						  Alias='Samuel',
  						  email = 'zert@zer.com',
  						  username= 'zert@zer.com', 
  						  profileId= p.id,
  						  emailencodingkey='UTF-8',
  						  languagelocalekey='en_US',
  						  localesidkey='en_US',
  						  timezonesidkey='America/Los_Angeles');
  				
  				ID userid = Site.CreatePortalUser( u, pa.id );
  				
  		Test.startTest();
  		//rest service
  			RestRequest req = new RestRequest(); 
	  		req.addParameter('userid',userid);
			RestResponse res = new RestResponse();
	 
			req.requestURI = '/Account/MyAccounts/';  
			req.httpMethod = 'GET';
			RestContext.request = req;
			RestContext.response = res;
			List<Account> result = MyAccountsRestService.getMyAccounts();
	  		
  		//assert
  	
  			System.assertEquals(2, result.size());
  			System.assertEquals('test parent acc', result.get(0).name);
  			System.assertEquals('test sub acc', result.get(1).name);
  		Test.stopTest();
  	}

 

 

I'm wondering, what the best practise is on dealing with exceptions when making a REST service in apex.

 

@HttpGet    	
    global static List<Account> getMyAccounts(){
    	//Purpose: get a list of all accounts(with details) a user is "related to" || customer portal user context    
    	//--> account the user's contact is under, and any possible sub accounts
    	try{
		   string userId =integer.valueof( RestContext.request.params.get('userid'));
		   
		   User user = [select id, name, accountId from user where id =:userId];
		   
		   List<Account> result = new List<Account>();
		   
		   //portal users always have accountId=accountid from contact which they were made out of
		   Account masteraccount = [select id from account where id in (select accountid from user where id=:user.accountID)]; //user.accountID only set on customer portal users
		   
		   //query for accounts having the above account as parentaccount

                  //something goes wrong !
		   
    	}catch(Exception x){
    		
                // Need to return a list of accounts, how show an errormessage or deal with this in a robust manner ?
    		return null;
    	}
    }

 As you can see in the comments in the posted code, I'm wondering what is best practise, on what should be returned. Just returning an empty resultset or null would not reveal any error and misguide the consuming code. What is a good way to expose and error easily picked up by the consuming code, without revealing too much internal detail of the exception ?

 

Are there other aspects (security/access wise) I should really pay attention too and implement in every REST service ? And/or is there a way to deal with such things in a generic way across services i'll be making ?  I find a lot of basic examples out there, but I've not found anything advanced covering a full real implementation, or am I just worrying too much .. 

I know we can format with the apex:outputText component, and the documentation refers to some java documentation:

 

"Use with nested param tags to format the text values, where {n} corresponds to the n-th nested param tag. The value attribute supports the same syntax as the MessageFormat class in Java. See the MessageFormat class JavaDocs for more information." (http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=pages_compref.htm|StartTopic=Content%2Fpages_compref.htm|SkinName=webhelp

 

Disregarding the move of that javadocs page, you can easily find the current documentations. But I can't seem to find any references on how to build patterns, or which patterns are possible to use. 

 

I've got a currency field in a  non SObject, so I can't use an outputfield to display it. I've been using a outputText with reasonable luck, see below.

 

<apex:outputText value="€ {0, number, ###,###.##}">
        <apex:param value="{!someCurrencyField}"/>
</apex:outputText> 

 

The only remaining issue, is to go from American decimal notation, to European,  atm it will display 10,000.55 , while my requirements are that to be 10.000,55.  I know a lot can be done with string functions, subtitute if contains etc. I know how to use those, I want to learn how to use format patterns appropriately and can not locatie information. Is there any ? 

 

Thanks to anyone who can provide some references, url's or a solution pattern for the above case.

 

 

Hi, i have a soql statement as following: 

 

SELECT id, lookup_Id, lastmodifieddate FROM SomeTable WHERE project__c in ( conditional subquery )
AND lastmodifieddate = THIS_YEAR)
ORDER BY lookup_Id, lastmodifieddate DESC

 

This will give me an overview of all SomeTable records, ordered by lookup_ID and lastmodified date. However, I only need the most recent modified entries for each lookup_id from SomeTable, and am a bit lost on how to achieve this.

 

I tried the following, expecting it wouldn't work (and it didn't ), 

 

SELECT id, lookup_id, max(lastmodifieddate) FROM SomeTable WHERE project__c in (conditional subquery)
AND lastmodifieddate = THIS_YEAR)
GROUP BY lookup_id
ORDER BY lookup_id, lastmodifieddate DESC

 

I'm looking to extract follwing data "example":

 

11111, AAAA,  date   : where 11111 is the most recent modified record  from Sometable for lookup_id AAAA

22222,BBBB, date    : where 2222 is the most recent modified record for SomeTable for lookup_id BBBB

..

..

..

 

I'm probably overlooking something quite basic here, all help appriciated!

I'm having trouble saving from eclipse, and receive following error:

 

Save error: Unable to perform save on all files: Destination URL not reset. The URL returned from login must be set in the SforceSerice

 

The thing is, I do not continuesly get it, it get it some hours, in a row, and then I don't anymore. Without changing any sf login settings. Sometimes it passes by by restarting eclips, sometimes it doesn't.

 

I've got running projects on different sf organizations, and sometimes i can't save to one because of this error, but have no trouble saving to another. Trying to look up the error, i mostly came across problems with API webservice connection problems, and no mentions of IDE problems.

 

Does anyone know what the issue might be, and how to fix/avoid it ?

There is a governor limit, that limits you to 20 concurrent API calls to the same URL endpoint. Any other concurrent calls will receive an exception. This is a hard limit and salesforce won't increase it for us (possible for other limits).

 

"A callout request to a given URL is limited to a maximum of 20 simultaneous requests."

 

I'll start with explaining why this is an issue to us, we're developing a site on force.com,  in where our customers will be able to manage their account,  manage their  sub-users and search our catalog, place&manage orders, etc. Some of that is located in salesforce, but some data, like or catalog is too big. I is stored in a seperate database, fully focussed on performing fast search on huge data quantities, at which salesforce still performs under our requirements.

 

Now, our idea was to just get the data from the other database over REST, and i've already implemented a test scenario using Remote Javascript functions, and it works great. Search functionality is a core concept of our website, and we're making  calls to the catalogue to perform autosuggest, per keystroke. This combined with calls that will be made on actual search, and other features of our website we expect to hit this governor limit very fast, as soon as having only 100 users online at the same time. We have a large international customerbase, and are thus worried and looking for a way around this governor limit.

 

Expecting the exception and making  new call in the catch (in recursive fashion) isn't something we believe is the way to go on this (are we wrong ?).  Has any of you already faced (and overcome ) this problem ? Or insights on how you would tackle this, are both grealy appreciated !

Has anyone tried to use the state and country picklists on a custom address field?  
an apex test keeps failing and is keeping us from being aable to create a package.  I believe it is due to a recursive loop.  The error i a get is the following:Error:

System.LimitException: RECON:Too many SOQL queries: 101

stack trace:

Trigger.RECON.Location: line 241, column 1


The code for the class trigger that creates the error is below:


trigger Location on Location__c (before insert,after insert, before update, after update, before delete, after delete) {

    

    // Hierarchy update trigger




    if(trigger.isBefore){

        

        list<Location__c> locationsToCheck = new list<Location__c>();

        

        list<Location__c> primaryJobSites = new list<Location__c>();

        

        

        if(trigger.isUpdate || trigger.isInsert){

            

            for(Location__c l:trigger.new){

                

                if(l.Job__c !=null && l.Primary_Job_Site__c){




                    primaryJobSites.add(l);

                }else if (l.Job__c ==null && l.Primary_Job_Site__c){




                    l.Primary_Job_Site__c=false;

                }




                if(l.id!=null){

                    Location__c lOld = trigger.oldmap.get(l.id);

                

                    if((lOld.Parent_Location__c != l.Parent_Location__c) || l.Hierarchy_Level__c==null){

                        locationsToCheck.add(l);

                    }

                }else{

                    locationsToCheck.add(l);

                }

            }

            if(DeepClone.getExecuteLocationHierarchyLogic()){

                if(!locationsToCheck.isEmpty()) HierarchyHelper.checkHierarchyOnUpdate(locationsToCheck);

            }

            if(!primaryJobSites.isempty()) PrimaryJobSite.checkPrimaryJobSites (primaryJobSites); 

        }   

            

        if(trigger.isDelete){

            Set<String> locId = new Set<String>();

            for(Location__c l : trigger.old){

                locationsToCheck.add(l);

                locId.add(l.id);

            }   

            if(!locationsToCheck.isEmpty()) HierarchyHelper.getChildrenWhenDeleted(locationsToCheck);

            if(!Test.isRunningtest())

                DeepDeletion.beforeDeletionLocation(locId);

        }

    }

    

    if(trigger.isafter){

        // Hierarchy Id  and Level Assignment

        set<id> locationsToUpdate = new set<id>();

        

        if(trigger.isUpdate ){

            List<RECON__Location_Change_Log__c> lsLocChangeLog = new List<RECON__Location_Change_Log__c>();

            locationsToUpdate = new set<id>();

            for(Location__c l : trigger.new){

                Location__c lOld = trigger.oldmap.get(l.id);

                if(lOld.RECON__Complete__c  != l.RECON__Complete__c ) {

                    RECON__Location_Change_Log__c locChLog = new RECON__Location_Change_Log__c();

                    locChLog.RECON__Complete__c = l.RECON__Complete__c;

                    locChLog.RECON__complete_Old__c = lOld.RECON__Complete__c;

                    locChLog.RECON__Location__c = l.id;

                    lsLocChangeLog.add(locChLog);

                }

                if((lOld.Parent_Location__c != l.Parent_Location__c) || l.Hierarchy_Id__c == null){

                    system.debug('***adding location Id to update set: ' + l.Id);

                    locationsToUpdate.add(l.id);

                }

            }

            if(lsLocChangeLog.size() > 0) {

                insert lsLocChangeLog;

            }

            System.debug('***locationsToUpdate set: ');

            system.debug(locationsToUpdate);

            

            if(HierarchyHelper.getExecuteLocationHierarchyIdLogic()){

                HierarchyHelper.updateHierarchyIds(locationsToUpdate);

            }

            if(DeepClone.getExecuteLocationHierarchyLogic()){

                HierarchyHelper.updateHierarchyItems(HierarchyHelper.getObjNameToHierarchyCalcIds());

            }

        }

        if(trigger.isInsert){




            locationsToUpdate = new set<id>();

            for(Location__c l : trigger.new){

                locationsToUpdate.add(l.id);

            }

            if(HierarchyHelper.getExecuteLocationHierarchyIdLogic()){

                if(!Test.isRunningtest())

                    HierarchyHelper.updateHierarchyIds(locationsToUpdate);

            }

            if(DeepClone.getExecuteLocationHierarchyLogic()){

                HierarchyHelper.updateHierarchyItems(HierarchyHelper.getObjNameToHierarchyCalcIds());

            }

        }

            

        if(trigger.isDelete){

            if(HierarchyHelper.getObjNameToHierarchyCalcIds()!=null){

                HierarchyHelper.updateChildrenAfterDeletion(HierarchyHelper.getObjNameToHierarchyCalcIds());

            }

            if(!Test.isRunningtest())

                DeepDeletion.afterDeletionLocation();

        }

    }

    

    // Completion % trigger

    

    if(trigger.isBefore && CompletionHelper.getExecuteLocationCompletionLogic()){

    

        if(trigger.isUpdate){

        

            for(Location__c l : trigger.new){

                

                Location__c lOld = trigger.oldMap.get(l.id);

                

                if(l.Complete__c != lOld.Complete__c){

                    

                CompletionHelper.addLocationId(l.Parent_Location__c);

            

                }

            }       

        }

    }

        

    if(trigger.isAfter){

        if(CompletionHelper.getExecuteLocationCompletionLogic()){

            if(trigger.isUpdate || trigger.isInsert){

                if(CompletionHelper.getLocationsToUpdate() != null){

                        CompletionHelper.updateLocationTree();

                }

            }

        }

    }







    // Geocode trigger




    if(trigger.isBefore || trigger.isAfter){




        set<id> locationIds = new set<id>();




        if(trigger.isUpdate){




            for(Location__c l:trigger.new){

                

                Location__c lOld = trigger.oldmap.get(l.id);




                if (l.Street__c != lOld.Street__c || l.City__c != lOld.City__c || l.State__c != lOld.State__c || l.Zip_Code__c != lOld.Zip_Code__c){

                    locationIds.add(l.id);

                }

            }

        }

        if(trigger.isInsert && trigger.isAFter){

            for(Location__c l : trigger.new){

                locationIds.add(l.id);

            }

        }




        if(locationIds.size()>0){

            LocationGeocode.getGeocodes(locationIds);

        }

        

    } 

    

    if(trigger.isBefore) {

        List<RECON__Location__c> ls;

        if(trigger.isDelete) {

            ls = trigger.old;

        }else {

            ls =trigger.new;

        }

        List<String> jId = new List<String>();

        for(RECON__Location__c jp : ls) {

            jId.add(jp.RECON__Job__c);

        }

        if(!Test.isRunningtest())

            DeepDeletion.putJobId(jId);

    }

    if(trigger.isAfter){

        if(!Test.isRunningtest()){

            Map<String,List<RECON__Location__c>> map_Loc_JP = new Map<String,List<RECON__Location__c>>();

            Map<String, Decimal> calculateHour = new Map<String, Decimal>();

            List<RECON__Location__c> ls = [Select Id,RECON__Estimated_Man_Hour__c,RECON__Job__c From RECON__Location__c where RECON__Job__c In :DeepDeletion.getJobId()];

            for(RECON__Location__c jp : ls) {

                if(jp.RECON__Job__c != null) {

                    if(!map_Loc_JP.containsKey(jp.RECON__Job__c)){

                        map_Loc_JP.put(jp.RECON__Job__c,new List<RECON__Location__c>());

                        map_Loc_JP.get(jp.RECON__Job__c).add(jp);

                        if(jp.RECON__Estimated_Man_Hour__c == null){

                            jp.RECON__Estimated_Man_Hour__c =0;

                        }

                        calculateHour.put(jp.RECON__Job__c, jp.RECON__Estimated_Man_Hour__c);

                    } else {

                        Decimal val= jp.RECON__Estimated_Man_Hour__c;

                        if(val != null){

                        system.debug('Manish : Debug '+val+' j p :' +calculateHour+'Loc Id :'+jp.RECON__Job__c);

                            val = val+calculateHour.get(jp.RECON__Job__c);}

                        else

                            val = calculateHour.get(jp.RECON__Job__c);

                        calculateHour.put(jp.RECON__Job__c, val);

                        map_Loc_JP.get(jp.RECON__Job__c).add(jp);

                    }

                }

            }

            Map<String, RECON__Job__c> map_Loc =new Map<String, RECON__Job__c>([Select Id, RECON__Estimated_Man_Hour__c from RECON__Job__c where id In :DeepDeletion.getJobId()]);

            for(String loc : map_Loc.keySet()) {

                if(calculateHour.get(loc) != null) {

                    map_Loc.get(loc).RECON__Estimated_Man_Hour__c = calculateHour.get(loc);

                } else {

                    map_Loc.get(loc).RECON__Estimated_Man_Hour__c =0.00;

                }    

                

            }

            system.debug('@manish trigger : '+map_Loc);

            system.debug('@manish calculateHour : '+calculateHour);

            system.debug('@manish map_Loc_JP : '+map_Loc_JP);

            if(map_Loc.size() > 0)

                update map_Loc.values();

        }

    }  

    //added by sanjeev

    //set<Id> locationId = new set<Id>();   

    if(Trigger.isAfter){

        set<Id> locationId = new set<Id>();

        if(Trigger.isInsert || Trigger.isUpdate){

            for(RECON__Location__c pLoc : Trigger.new){

                locationId.add(pLoc.RECON__Parent_Location__c);

                //locationId.add(pLoc.id);

            }

        }else

        if(Trigger.isDelete){

            for(RECON__Location__c pLoc : Trigger.old){

                //locationId.add(pLoc.id);

                locationId.add(pLoc.RECON__Parent_Location__c);

            }

        }

        List<RECON__Location__c> locationList = [select RECON__Estimated_Man_Hour__c, (select RECON__Estimated_Man_Hour__c from Locations__r) from RECON__Location__c where id IN : locationId];

        if(locationList.size() > 0){

            for(RECON__Location__c loc : locationList){

                //loc.RECON__Estimated_Man_Hour__c = 0;

                List<RECON__Location__c> locChilds = loc.Locations__r;

                if(locChilds.size() > 0){

                    for(RECON__Location__c locChild : locChilds){

                        loc.RECON__Estimated_Man_Hour__c += locChild.RECON__Estimated_Man_Hour__c;

                    }

                }

            }

            update locationList;

        }

    } 

    //till here

}




Is there something simple I am missing?  Thanks for your help.
Hi,

I need help on the following requirement,


1) I am having a custom field called as "Dealer Principal__c" in my custom object called as "Account Exceptions__c"

2) There is a lookup on my custom object called as Account__c which is a lookup to the account object



1) if the account is a nornmal account (PDN Record type) , the contact(name) associated with that account with title "Dealer Principal" is populated to that field


2) If the account is a group account


the group account might have many child accounts , where it will check the contacts of all th e child accounts with the title "Dealer principal" and update the name correspondingly



so my case should work for both the scenarios

First scenario my trigger is working fine , just need help on second one


MY TRIGGER :

trigger updateaccountexceptions on AccountExceptions__c(after insert) {
    map < id, string > dealercontacts = new map < id, string > ();
    set < id > accids = new set < id > ();

    for (AccountExceptions__c acex: trigger.new) {
        accids.add(acex.account__c);
    }

    List < contact > cons = new List < contact > ([select Id, accountid, firstname, lastname from contact where title = 'Dealer Principal'
        and accountid = : accids
    ]);

    for (Contact con: cons) {
        string conname = con.firstname + ' ' + con.lastname;
        dealercontacts.put(con.accountid, conname);
    }

    list < AccountExceptions__c > acexlisttoupdate = new list < AccountExceptions__c > ();

    for (AccountExceptions__c acex: trigger.new) {
        AccountExceptions__c accex1 = new AccountExceptions__c();
        if (dealercontacts.containskey(acex.account__c)) {
            accex1.id = acex.id;
            accex1.Dealer_Principal_s__c = dealercontacts.get(acex.account__c);
            acexlisttoupdate.add(accex1);
        }
    }

    update acexlisttoupdate;

}


Thanks in Advance
Hello folks,

First of all, I'm a newbie on SalesForce, so accept my apologies if my question sounds dumb.

I have to create a trigger that creates a task after an e-mail is sent from Activity History in a custom object. I am trying to use MyCustomObject__History but I'm getting the following error: SObject type does not allow triggers: MyCustomObject__History.

Does anyone can confirm if it is possible to create a trigger for "__History" objects?

Many thanks in advance.
I have a method in command link, i am passing parameters through <apex:params> with name attribute and retriving from page parameters, which is working in my dev environment, when i try to move QA, its not calling the respective method, Very Strange...!!!!

VF Code:
<apex:commandLink action="{!showMultiSelectionPopUp}" value="{!b.name}" style="color:#2B8BD5;" rendered="{!b.recordtype='Multi Value Option Capture'}">
          <apex:param value="{!s.SchemeId}" name="selectedSchemeinMultiListControl"/>
          <apex:param value="{!b.RecordId}" name="selectedControlId"/>
          <apex:param value="{!s.SourceId}" name="selectedSourceId"/>
</apex:commandLink>

Apex Code: 
public string selectedSchemeinMultiListControl{get; set;}
public string selectedControlId{get; set;}
public string selectedSourceId {get; set;}

public pageReference showMultiSelectionPopUp(){
            selectedSchemeinMultiListControl=null;
            selectedControlId=null;
            selectedSourceId=null;
           
            selectedSchemeinMultiListControl= ApexPages.Currentpage().getParameters().get('selectedSchemeinMultiListControl');       
            selectedControlId= ApexPages.Currentpage().getParameters().get('selectedControlId');
            selectedSourceId= ApexPages.Currentpage().getParameters().get('selectedSourceId');
            return null;
}

Please help me..

Hi

The Newly created community user are not getting the WELCOME EMAIL.

i set the Deliverability='All Emails'
I checked the 'Welcome Email' checkbox also .

It is Urgent .
How i can create personal account in php ? can you please give me exact code for this. i can not findout it in PHP Toolkit 20.0
Hi All,

Can we use split  Java script functionality in salesforce.
My requirnment is if are entering Account name as Abc Itd.
then using split functionality it should take Abc limited as account name.
I have enabled the state and country picklist feature within my org. I have to refere these fields in an VF page, will the naming convention be the same as 'BillingState' & 'BillingCountry'?  What about other objects like Contacts where the field name is MailingCountry and Mailing State?

Please advise.
Hi,

We are a Research Center implementing SFDC to track our contacts, requests, events management, and newsletter needs. We have created some customized fields, but looking for a developer who can further our customization. 

Please contact Patty at pshih@uchicago.edu if interested. 

This would be paid on an hourly basis. 


Thank you,
Patty
Hi everyone,

I am helping build a product and would like users to be able to change an error message (without using the translate feature).  

Is there any way in APEX that I can check for the existence of a Custom Label?  Something like this:

<pre>
// THIS CODE WILL NOT SAVE IF THE "Label.Overwrite_Error" DOESN'T EXIST
String sError = Label.Standard_Error;
If(Label.Overwrite_Error != NULL) sError = Label.Overwrite_Error;
</pre>

Any help would be greatly appreciated!  I don't want to use Custom Settings if at all possible.

Thank you!
Hi,

I need to make a webservice calout from salesforce.the wsdl of service is importing another schema,I came to know that salesforce doesnt parse the wsdl which imports other schema's.If I remove the import section from wsdl and insert the schema directly within the wsdl,will it work?

Has anyone done this and succeeded?,Please let me know.The service WSDL is a SOA suite 11g webservice.If it works please let me know how to embed the schema withing the wsdl by removing the import statement,any example whould help.
Hi,
I have a requirement where we need to build a custom logic to sync salesforce contact,event with Microsoft Outlook.
We are NOT looking for any third party built in plugin as we have some specific requirement.
Thus, we need to connect using ms exchange web services from salesforce system.
If anyone have implemented something like this  , please provide some guidelines/steps .

Thanks in advance.
Hi folks
         Can anyone tell me  What is the purpose of view state  in salesforce?
Thanks in advance
Kartick
I have created a custom button the Case object to create a record on a custom object. The button works correctly in my full sandbox but does not work in production. And yes, I have made sure I updated the ID's I have in my code. Any help? The button does not generate an error, just does not do anything.

{!REQUIRESCRIPT('/soap/ajax/27.0/connection.js')}

getDate = function(dateObj){
var day = dateObj.getDay() < 9 ? '0'+dateObj.getDay() : dateObj.getDay();
var month = dateObj.getMonth() < 9 ? '0'+dateObj.getMonth() : dateObj.getMonth();

return dateObj.getFullYear()+'-'+month+'-'+day;
}

var Request = new sforce.SObject('Request__c');

Request.Release_Management__c = 'a2W70000001RSwq';
Request.Related_Case__c = '{!Case.Id}';
Request.RecordTypeId ='012700000005v8J';
Request.Name = '{!Case.Subject}';
Request.Description__c = '{!Case.Description}';
Request.Case_Owner__c = '{!Case.OwnerId}';


result = sforce.connection.create([Request]);

if(result[0].success == 'true'){
    window.open("/" + result[0].id);
}
Hi Everyone,
      Can anyone tell me what is trigger.new, trigger.old and trigger.newmap ,trigger.oldmap
Trigger.oldmap.keyset with sample example


Thanks in advance
Karthick

Hello Team:
I'm debugging a portal issue trying to create a portal user from a Sites page. 
Here is the code I'm trying to execute:
try{
userId = Site.createPortalUser(u, accountId, password, true);
} catch (Exception e){
system.debug(' error in creating User Account ' + e.getMessage());
}

Here is my debug log:
14:43:20.744 (744838000)|METHOD_ENTRY|[118]|01pE0000001gvec|SiteRegisterController.__sfdc_password()
14:43:20.744 (744925000)|METHOD_EXIT|[118]|01pE0000001gvec|SiteRegisterController.__sfdc_password()
14:43:20.745 (745121000)|SYSTEM_METHOD_ENTRY|[118]|system.Site.createPortalUser(SObject, String, String, Boolean)
14:43:20.754 (754125000)|SYSTEM_METHOD_EXIT|[118]|system.Site.createPortalUser(SObject, String, String, Boolean)
14:43:20.754 ()|SYSTEM_METHOD_ENTRY|[138]|System.debug(ANY)
14:43:20.754 (754237000)|USER_DEBUG|[138]|DEBUG| userId == nul 

My try is not blowing up but the user is not getting created either. Any ideas?

 

Thank you,

There is a governor limit, that limits you to 20 concurrent API calls to the same URL endpoint. Any other concurrent calls will receive an exception. This is a hard limit and salesforce won't increase it for us (possible for other limits).

 

"A callout request to a given URL is limited to a maximum of 20 simultaneous requests."

 

I'll start with explaining why this is an issue to us, we're developing a site on force.com,  in where our customers will be able to manage their account,  manage their  sub-users and search our catalog, place&manage orders, etc. Some of that is located in salesforce, but some data, like or catalog is too big. I is stored in a seperate database, fully focussed on performing fast search on huge data quantities, at which salesforce still performs under our requirements.

 

Now, our idea was to just get the data from the other database over REST, and i've already implemented a test scenario using Remote Javascript functions, and it works great. Search functionality is a core concept of our website, and we're making  calls to the catalogue to perform autosuggest, per keystroke. This combined with calls that will be made on actual search, and other features of our website we expect to hit this governor limit very fast, as soon as having only 100 users online at the same time. We have a large international customerbase, and are thus worried and looking for a way around this governor limit.

 

Expecting the exception and making  new call in the catch (in recursive fashion) isn't something we believe is the way to go on this (are we wrong ?).  Has any of you already faced (and overcome ) this problem ? Or insights on how you would tackle this, are both grealy appreciated !

Hi fellow SF devs and admins-

 

I have worked with some other folks to get a Salesforce chat room going on IRC.  Think of it as a realtime user group.  You can access it on Freenode by joining the #salesforce channel.

 

If you're new to IRC, I personally recommend mIRC (www.mirc.com).  Various programs can be used to access IRC for any OS you may be using.  Hope to have you as a part of our community!

The flow I created retrieves the value from a multi-select picklist, stores it in a variable. When the variables are displayed on the screen the output is enclosed in square brackets.

Example: Output: [All Direct Mail] whereas the output should be All Direct Mail.

Is multi-select picklist the reason, because I tried using picklist field which did not give square brackets.

Any help would truly be appreciated.

GodSpeed!! #ka'ching
#raggyrao
We are given the impression from email we received that API access will, like other forms of access, be limited to TLS rather than SSLv3.
All fine and reasonable. Unfortunately, however, we find that forcing TLS (only) access is not well-supported before PHP 5.5 or 5.6 (depending on
who you believe, here: http://php.net/manual/en/soapclient.soapclient.php (http://php.net/manual/en/soapclient.soapclient.php" target="_blank) (with the ssl_method "options" parameter to the SOAPClient()) or
(perhaps) by limiting the "ciphers" in the "context options" "stream_context" to those which will support TLS1.x . This is described in the following
post: http: (http://stackoverflow.com/questions/16547163/how-to-force-a-certain-tls-version-in-a-php-stream-context-for-the-ssl-transp" target="_blank)//stackoverflow.com/questions/16547163/how-to-force-a-certain-tls-version-in-a-php-stream-context-for-the-ssl-transp . While we understand fully that this PHP API library has limited support, we do wonder whether anybody else has experience with TLS from PHP 5.4?
Most shops seem to still run PHP 5.4 in the real world.
And I actually cannot tell, short of extensive packet tracing, whether this following codelet actually uses TLS
(or the parameters are being ignored? ). Is there a TLS-only Salesforce endpoint for testing before November 7?
Advice appreciated.

<?php

    $tls_ciphers = explode(':', shell_exec('openssl ciphers -v | grep TLSv1.2 | cut -d " " -f 1 | tr "\n" ":" | sed "s/:\$//"'));
    $sslv3_ciphers = explode(':', shell_exec('openssl ciphers -v | grep SSLv3 | cut -d " " -f 1 | tr "\n" ":" | sed "s/:\$//"'));

    foreach ($tls_ciphers as $tls)
        foreach ($sslv3_ciphers as $ssl)
            if ($tls == $ssl)
            {
                print("OVERLAP on $tls == $ssl\r\n");
                exit();
            }

    $context = stream_context_create( array( 'ssl' => array (
                                             'protocol_version' => 'tls1',
                                             'ciphers' => $tls_ciphers
    )));
    $soapClientArray = array (
          'user_agent' => 'salesforce-toolkit-php/20.0',
          'encoding' => 'utf-8',
          'trace' => 1,
          'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
          'stream_context' => $context
    );
    $client = new SoapClient('partner.wsdl.xml', $soapClientArray);

    echo "Add 'ciphers' => '$tls_ciphers'\r\n";

?>
Every unit test example for APEX code retrieves the Profile using the following SOQL:
SELECT Id FROM Profile WHERE Name = 'System Administrator'
When I am deploying my unit tests to another Org, which has set another language (e.g. German), this SOQL won't work. The Profile.Name is always returned localized, in German it says "Systemadministrator".

How can I retrieve a profile from the database without being dependant of the user's language? Is there a default System.Label for standard profile names?

Hi,
I am using the below code to display a gif stored as a static resource to display the status of an AJAX update request. I want that the image be displayed in the middle of the page and the main page be unusable for that time.

<apex:page controller="exampleCon">
    <apex:form >
        <apex:outputText value="Watch this counter: {!count}" id="counter"/>
        <apex:actionStatus id="counterStatus" style="align:center;" >
            <apex:facet name="start" >
            <apex:image url="{!$Resource.loading}" height="50" width="50" />                       
        </apex:facet>
        </apex:actionStatus>
        <apex:commandButton action="{!incrementCounter}" title="Click Me" rerender="counter"
            status="counterStatus"/> 
    </apex:form>
</apex:page>

 Class:

public Global class exampleCon {

Integer count = 0;
public PageReference incrementCounter() {
count++;
return null;
}
public Integer getCount() {
return count;
}
}

 Thanks in advance!!

Hello,

 

I've noted in Salesforce.com url's that querystring parameters often contain the characters %2F  before an object. What is the purpose of these characters & what do they mean?

 

An example is the following "retURL=%2F01QQ1000007E4cm"

Where "01QQ1000007E4cm" is the object id.

 

Thanking you for your help.

Okay folks, I know this is a n00b question but I can't remember if or how to initialize a string with a set of arguments.

 

What I want to do is something like this

 

 

List<String> alphabet = { 'a' , 'b' , 'c' ...  };

 

How can I do this?