• Bhawani Sharma
  • PRO
  • 3833 Points
  • Member since 2011
  • CRM Consultant
  • Simplyforce Technology Private Limited


  • Chatter
    Feed
  • 134
    Best Answers
  • 12
    Likes Received
  • 0
    Likes Given
  • 47
    Questions
  • 1180
    Replies
Hi all,

I am trying to siiable chatter answers from my production org. I have never used the eclipse force.com plug in but i know this is how i have to delete them.

Would anyone be able to provide a step by step process to deleting a class on this?

I am not sure if i need to log into the sandbox or production

Thanks
When sending an email using the Salesforce API via AIR I can successfully send a HTML email like this:

var message:SingleEmailMessage = new SingleEmailMessage();
message.senderDisplayName = "SenderName";
message.replyTo = "sender@name.com";
message.saveAsActivity = true;
message.targetObjectId = recipientID;
message.subject = _emailSubject;
message.htmlBody = _htmlBody;
var messages:Array = [message];
airConnection.sendEmail(messages, new AsyncResponder(

But if I try to set a template ID the sending fails with no obvious error

var message:SingleEmailMessage = new SingleEmailMessage();
message.senderDisplayName = "SenderName";
message.replyTo = "sender@name.com";
message.targetObjectId = recipientID;
message.templateId = "Sample_HTML_Mail";
var messages:Array = [message];
airConnection.sendEmail(messages, new AsyncResponder(

The template does exist and the ID I'm specifying is the Template Unique Name specified in Salesforce.

Would anyone have any ideas why this is happening and how I might fix it?

Thanks,

Mark
Hi All,
Sometime before i was able to connect to SFDC through my java code..
https://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_code_walkthrough.htm

But now I am getting below error
2015-01-13 15:21:32,642 [main           ] INFO  SpringCamelContext             - Apache Camel 2.12.1 (CamelContext: camel) is shutting down
Exception in thread "main" org.apache.camel.RuntimeCamelException: [LoginFault [ApiFault  exceptionCode='INVALID_LOGIN'
 exceptionMessage='Invalid username, password, security token; or user locked out.'
]
]

    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1344)
    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
    at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:301)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:186)
    at org.apache.camel.spring.Main.doStart(Main.java:140)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:148)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:343)
    at org.genpact.onedb.eapp.MyRouteBuilder.main(MyRouteBuilder.java:35)
Caused by: [LoginFault [ApiFault  exceptionCode='INVALID_LOGIN'
 exceptionMessage='Invalid username, password, security token; or user locked out.'
]

Pls help.
Hi,

I've written some code which will add a lead automatically to a campaign should it meet certain criteria.
Can anyone shed any light on why i'm only acheiving 50% code coverage with the test class? 
The assert passes so the Campaign Members are being created.
I've tried to insert campaign members also but this didn't help either.

Any ideas would be greatly appreciated!

n.b. I know it's bad practice to hard code the Campaign Id and i'll look to write this out at a later date.
 
trigger NewWebRegistrant on Lead (before insert) {

   List <Lead> LeadList = [Select Id,LeadSource FROM Lead WHERE LeadSource = 'New Web Registrant' AND Id IN :Trigger.new];
   List<CampaignMember> NewMembers = new List<CampaignMember>();
    
    	if (LeadList.size() > 0){
                
            for (Lead l: LeadList){
                
		newMembers.add(new CampaignMember(
                LeadId = l.Id,
                CampaignId = '701g000000073cH',
                Status = 'Not Yet Contacted'));   
  
              insert NewMembers;
            	system.debug('Members is list are' + NewMembers);
          }
    }
}
@isTest
public class TestTrigger {
    
    static testMethod void TestTrigger (){
        
        Set<Id> LeadsInserted = new Set <Id> ();
		
 		List<Lead> newLeads = new List <Lead>();
        
            for(Integer x = 0; x < 200; x++){
                Lead l = new Lead();
   		 l.FirstName = 'test';
         l.LastName = 'test' + x;
         l.Email = 'test@test.com';
         l.LeadSource = 'Test';
         l.Lead_Source_Detail_NEW__c ='Test';
               newLeads.add(l);
            }
        
        insert newLeads;
        

         //Test that for all leads are added to the campaign.      
        
         List<CampaignMember> Members= [Select Id,LeadId,CampaignId FROM CampaignMember WHERE CampaignId = '701g000000073cH'];
                for (CampaignMember cm : Members){
                    Boolean contains = (LeadsInserted).contains(cm.LeadId);
						System.assertEquals(contains, True);
                	}
               }
	}


 
I have a visualforce page which contains 4 tabs.In one of the tab i need to include another visualforce page.

When I tried to do this with <apex:include> i got the following error
" Error: 'apex:form' component cannot be nested within form tags "
If I remove form tag in anyof the page,it contains lots of components that can not survive without form.

For instance if I delete the form tag then it is showing the error like
" Error: <apex:selectRadio> (under <apex:page>) must occur between <apex:form></apex:form> tags. "

In this situation how can I include one visual force page inside of another..?

Any idea would be appreciated..

Thanks in advance
Chitra
Thought this should be relative straight forward, but standard functionality does not provide this.

So I thought to execute onclick Javascript instead.

window.open("https://www.google.com/");

Something like this. Any adjustments to get this working?

Thanks in advance.
Hi folks ,
      Can anyone tell me how to edit the output field values without Inline Edit  in viusalforce page?

Below is my viusalforce page
                  <apex:pageBlockSection ">
                  <apex:repeat value="{!productRecords}" var="p"  >
                              <apex:outputField value="{!p.Name}" / ><br/>
                             
                              <apex:outputField value="{!p.Product__c }"/>
                             
                             </apex:repeat>
            </apex:pageBlockSection>
         I wanna edit those two output fields
Thanks in advance
Karthick
I have looked everywhere but I haven't found an answer, so here goes....

I have replaced a custom object's Detail page with a VF page that displays the usual object details, and then displays the related lists in a tab panel, where each related list is in a separate tab. I've found numerous examples of that, and it all works great.

However, the default font size of the items in the related lists is quite small (smaller than what's used in standard SF). How can I control the styling of
apex:relatedList? There is no class attribute on apex:relatedList, only id. But I've tried specifying an id and adding some css to style it, but nothing changes.


Here's an excerpt from my code:

<apex:page standardController="Quote__c" showHeader="true"  sidebar="true" tabStyle="Quote__c" >
     
    <style>
        .activeTab {font-size:12px; background-color: #236FBD; background-image:none; color:white;  border: 2px solid; border-radius: 10px;  box-shadow: 3px 3px 5px #BEBEBE;}
        .inactiveTab {font-size:12px; background-color: #BEBEBE; background-image:none; border-radius: 10px;}
    </style>

   ....display the Quote__c detail panel here....

  .... here are the tabbed related lists....

<apex:tabPanel switchType="client" selectedTab="tabQuoteContact"
                  id="QuoteTabPanel" tabClass="activeTab"
                  inactiveTabClass="inactiveTab" >
                 
    <apex:tab label="Quote Contacts" name="QuoteContacts"
                id="tabQuoteContact" >
        <apex:relatedList list="Quote_Contacts__r"  />                   
    </apex:tab>
     
    <apex:tab label="Order Information" name="OrderInfo" id="tabOrderInfo">
        <apex:relatedList list="Orders__r" />          
    </apex:tab>

...more of the same for other related lists of Quote__c....

Hi,

Is it possible to show a field on a visualforce page based on previous selection?

For example: if the value in field 1 was true then show field 2 in the vf page else it doesn't appear.

Hello, 

I am trying to minimize the amount of sites that I use for a project. The project involves a site with a list of various white papers. The goal is that a link will send an individual to a site form. After submission the form sends one to a "Thank You Page" using  the Web2Lead Extension (and enters the data into Salesforce.  On the "Thank You Page" , there is a direct reference to the whitepaper.  I had to create a page for each. The way I have done this there is 1 site used for each series, but I would like to utilze a more dynamic apex class as the form is the same as is Thank You Page.  Does anyone have any idea how to do this? Below is my code. I have tried using get;set, but they system doesn't let me save. 

Web2Lead Form

<apex:page standardController="Lead" extensions="myWeb2LeadExtension" title="Contact Us" showHeader="false" standardStylesheets="false">

   <apex:define name="body">

   <apex:form >

    <apex:messages id="error" styleClass="errorMsg" layout="table" style="margin-top:1em;"/>

      <apex:pageBlock title="" mode="edit">

        <apex:pageBlockButtons >

           <apex:commandButton value="Save" action="{!saveLead}"/>

        </apex:pageBlockButtons>

        <apex:pageBlockSection title="Contact Us" collapsible="false" columns="1">

         <apex:inputField value="{!Lead.Salutation}"/>

         <apex:inputField value="{!Lead.Title}"/>

         <apex:inputField value="{!Lead.FirstName}"/>

         <apex:inputField value="{!Lead.LastName}"/>

         <apex:inputField value="{!Lead.Email}"/>

         <apex:inputField value="{!Lead.Phone}"/>

         <apex:inputField value="{!Lead.Company}"/>

         <apex:inputField value="{!Lead.Street}"/>

         <apex:inputField value="{!Lead.City}"/>

         <apex:inputField value="{!Lead.State}"/>

         <apex:inputField value="{!Lead.PostalCode}"/>

         <apex:inputField value="{!Lead.Country}"/>

        </apex:pageBlockSection>

     </apex:pageBlock>

   </apex:form>

  </apex:define>


</apex:page>



myWeb2LeadExtension

public class myWeb2LeadExtension {



    private final Lead weblead;



    public myWeb2LeadExtension(ApexPages.StandardController stdController) {

       weblead = (Lead)stdController.getRecord();

    }

    

     public PageReference saveLead() {

       try {

       insert(weblead);

       }

       catch(System.DMLException e) {

           ApexPages.addMessages(e);

           return null;

       }

     PageReference p = Page.ThankYouPageWhitePaper;

       p.setRedirect(true);

       return p;
      
    }
   
}


ThankYouPageWhitePaper



<apex:page showheader="false">
<head>
<link href="//fonts.googleapis.com/css?family=Varela+Round:400" rel="stylesheet" type="text/css"></link>
<title>2 Column CSS Layout - parellel design</title>
<style type='text/css'>
.container{
position: relative;
   left: 0.00%;
   width: 100.00%;
   background-color: #FFFFFFF
}
.header{
   position: relative;
   float: left;
   left: 0.00%;
   width: 100.00%;
   background-color: #FFFFFFF
}
.wrapper{
   left: 0.00%;
   width: 75.00%;
   height: 75.00%;
   background-color: #FFFFFFF
}
.left{
   position: relative;
   float: left;
   left: 0%;
   width: 25.00%;
   background-color: #F0F0F0
}
.right{
   position: relative;
   float: right;
   right: 0.00%;
   width: 75.00%;
   background-color: #FFFFFFF
}
.footer{
   position: relative;
   float: left;
   left: 0.00%;
   width: 100.00%;
   background-color: #FFFFFFF
}
body {
 
   margin:70px 40px 10px 50px;
   font-size: 90%;
   background-color: #FFFFFFF
   float: left;
}

</style>
</head>
<body>
<div class="container">
   <div class="header">
<center>
  <h1> Registration complete</h1>
<p>An email has been sent to you with a link to the document.</p>
<p>You should be redirected within 5 seconds. If you are not, then click the following link:
<a href= "http://sandbox-companywebsite.cs10.force.com/AD/whitepaper"> Click Here</a>
</p>
</center>
</div>
</div>
</body>
</apex:page>

White Paper


<apex:page showheader="false" showChat="false" sidebar="false">
<style>
object {display:block;position:absolute;height:100%;}
</style>
<object data="{!URLFOR($Resource.AACredit)}" type="application/pdf" width="100%" height="auto">

 
</object>
</apex:page>
  • August 19, 2014
  • Like
  • 0
Here is a simplified version of my page:

<apex:page standardcontroller="Case" extensions="TestPassJSVariable">

    <script type="text/javascript">

        function createCase(cancel) {

            var supplier = document.getElementById('{!$Component.form.block.section1.supplierInput}').value;
            
            if(cancel == 1) {
            
                cancelFunction();
            }

            else {
            
               createFunction(supplier);
            }


    </script>
    <apex:form id="form">
    <apex:actionFunction name="createFunction" action="{!createCase}" rerender="view">    
        <apex:param id="supplier" assignTo="{!supplier}" name="supplier" value="" />  
    </apex:actionFunction>
    <apex:actionFunction name="cancelFunction" action="{!cancelCreate}"/>
    <apex:inputField id="supplierInput" value="{!Case.Supplier__c}" required="true"/>
        <apex:commandButton value="Create" onclick="createCase();" rerender="view"/><apex:commandButton value="Cancel" onclick="createCase(1);" immediate="true"/></center>
    </apex:form>
</apex:page>
I am trying to make the "supplierInput" field required, but also allow a cancel button on the page to go back to the previous URL without having to enter that information in.  I thought the immediate="true" attribute was supposed to allow this to happen, but it isn't working.

What am I missing here?

Hi,

I am trying to write a formula evaluates to true for a workflow based on "OR" Condition , its not doing the field update, is any thing wrog in my formula


 AND(


OR(
(How_many_years_have_you_been_in_business__c  > 3),
(Is_your_dealership_dedicated_to_RETAIL_a__c  = "Yes"),
(Is_the_dealership_lot_paved__c = "Yes"),
(Does_the_dealership_operate_from_a_perma__c = "Yes"),
(What_are_your_average_monthly_used_vehic__c  >= 50),
(How_many_front_line_ready_units_do_you_c__c >=50),
(What_percent_of_your_inventory_has_less__c >=90),
(What_percent_of_your_inventory_is_newer__c >=90),
(What_percent_of_inventory_has_a_selling__c >=90),
(Does_your_dealership_use_DealerTrack_and__c ="Yes"),
(Can_you_print_contracts_electronically__c ="Yes"),
(Does_your_dealership_have_a_dedicated_F__c ="Yes")
)
)


do let me know whats wrong in my formula validation

Thanks

Hi All,

Me new to salesforce. I need a help here. I want to develop a visualforce page where there is a text box. When we type something in the text box, I want to search the item entered in the account object and show in a table. Also If possible while typing we need to show sugesstions like Auto fill.

When the rowns are displayed there must be a button when click, it must execute some Controller function.

How do I start with this? Please help!

Thanks,
Nidhi M

Hi All,

 

I'm trying to add Account team member dynamically but my code fires error msg.Please go through the steps below.

 

Parent Account(Lookup Field)----------------on Account Object

VPA(Checkbox)------------------------------------on Account Object.

If VPA==true

then the owner of parent account to which it is lookup should be added as account teammember on account page.

trigger AccountTeam on Account (after update) {
Integer newcnt=0;
Integer newcnt0=0;
AccountTeamMember[] newmembers = new AccountTeamMember[]{};
//list of new team members to add
AccountShare[] newShare = new AccountShare[]{};
//list of new shares to add
Account a1 = [select id, parent.Id,Owner from account Where Id=:trigger.new[0].ParentID];
ID uid = a1.Owner;


//get the user id of the user running the trigger, anyone that changes the Account will added to the account team
for(Account a:trigger.new)
{
AccountTeamMember Teammemberad=new AccountTeamMember();
Teammemberad.AccountId=a.id;
Teammemberad.UserId=uid;
Teammemberad.TeamMemberRole = 'Account Modifier';
newmembers.add(Teammemberad);
}
Database.SaveResult[] lsr = Database.insert(newmembers,false);
//insert any valid members then add their share entry if they were successfully added Integer newcnt=0;
for(Database.SaveResult sr:lsr)
{
if(!sr.isSuccess())
{
Database.Error emsg =sr.getErrors()[0];

system.debug('\n\nERROR ADDING TEAM MEMBER:'+emsg);
}
else
{
newShare.add(new AccountShare(UserOrGroupId=newmembers[newcnt].UserId, AccountId=newmembers[newcnt].Accountid, AccountAccessLevel='Read',OpportunityAccessLevel='Read'));
}
newcnt++;
}
Database.SaveResult[] lsr0 =Database.insert(newShare,false);
//insert the new shares Integer newcnt0=0;
for(Database.SaveResult sr0:lsr0)
{
if(!sr0.isSuccess())
{
Database.Error emsg0=sr0.getErrors()[0];
system.debug('\n\nERROR ADDING SHARING:'+newShare[newcnt0]+'::'+emsg0); } newcnt0++; }
}

 

 

Thank you inadvance

I have something strange happening in my test code and I can't figure out what's happening.

 

I have to following code:

//other code to create O1 exists above. 

ApexPages.StandardController sc = new ApexPages.standardController(O1);

    cntrCreateCompanyProduct CCP = new cntrCreateCompanyProduct(sc);

    CCP.newCP(); //creates a new ComProd varible and loads it.

    if(CCP.ComProd != null) system.debug('testing comp is not null');

    System.AssertEquals(CCP.ComProd,null);

 

So I see the debug message in my debug log, which means that CCP.ComProd is not null however the Assert is firing causing my test code to fail at this point?

 

I'm not sure what I'm missing.

Hi,

 

i have an apex batch for deleting different types of data.

So i have 3 objects (no releations to each other).

In the start method i build 3 search strings and would like to let run the execute method 3 times.

How to do that?

 

The following structure does not work:

global database.querylocator start(Database.BatchableContext bc){
        for(String query : batchHelper.buildSearchStrings())    
            return Database.getQueryLocator(query);
    }

 

Thank you for the help!

I need to display  whatever access queues names  for current login user,

 

Please anybody help me for this

 

 

  • November 21, 2013
  • Like
  • 0

Hello, I try to parse a web service's XML response in reading the documentation (http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_xml_dom.htm) but it doesn't work whereas my XML is valid.

 

This is my XML response :

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <GetConsumerOrdersResponse xmlns="http://tempuri.org/">
         <GetConsumerOrdersResult xmlns:a="http://schemas.datacontract.org/2004/07/FujiTTModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <a:ConsumerOrders>
               <a:ConsumerOrder>
                  <a:ActionCode i:nil="true"/>
                  <a:Campaign i:nil="true"/>
                  <a:Consumer>
                     <a:Company i:nil="true"/>
                     <a:ConsumerId>e27dc-6e93-483f-bf14-fe01e477fc7b</a:ConsumerId>
                     <a:Email i:nil="true"/>
                     <a:ExternalId i:nil="true"/>
                     <a:FirstName i:nil="true"/>
                     <a:InvoiceAddress>
                        <a:AddressLine1 i:nil="true"/>
                        <a:AddressLine2 i:nil="true"/>
                        <a:AddressLine3 i:nil="true"/>
                        <a:AddressNumber i:nil="true"/>
                        <a:AddressNumberExtension i:nil="true"/>
                        <a:City i:nil="true"/>
                        <a:Company i:nil="true"/>
                        <a:Country i:nil="true"/>
                        <a:FirstName i:nil="true"/>
                        <a:LastName i:nil="true"/>
                        <a:State i:nil="true"/>
                        <a:Title i:nil="true"/>
                        <a:ZipCode i:nil="true"/>
                     </a:InvoiceAddress>
                     <a:Language i:nil="true"/>
                     <a:LastName>BARBARA BABA</a:LastName>
                     <a:ShippingAddress i:nil="true"/>
                     <a:Telephone i:nil="true"/>
                     <a:Title i:nil="true"/>
                  </a:Consumer>
                  <a:Dealer>
                     <a:Address>16, Rue de la merveille</a:Address>
                     <a:City>BOIS</a:City>
                     <a:Country>FR</a:Country>
                     <a:DealerId>8ff5-8715-48e3-9688-723039d3f212</a:DealerId>
                     <a:Email i:nil="true"/>
                     <a:LabCode>33</a:LabCode>
                     <a:Language i:nil="true"/>
                     <a:Name>Imaging France</a:Name>
                     <a:Number>7651</a:Number>
                     <a:ShippingCode>?-0494</a:ShippingCode>
                     <a:Telephone i:nil="true"/>
                     <a:Zipcode>78391</a:Zipcode>
                  </a:Dealer>
                  <a:Discount>0</a:Discount>
                  <a:ExternalId i:nil="true"/>
                  <a:IsMailOrder>false</a:IsMailOrder>
                  <a:LabCode>33</a:LabCode>
                  <a:Make>FFF</a:Make>
                  <a:MessageList i:nil="true"/>
                  <a:OrderSize>30634986</a:OrderSize>
                  <a:ParentFileId>62f1c94d-c967-49c8-8758-e32987422e3</a:ParentFileId>
                  <a:ProductList i:nil="true"/>
                  <a:ProductionOrders>
                     <a:ProductionOrder>
                        <a:BackupPath>\\fujife10\Backup-2013-10-24-55996</a:BackupPath>
                        <a:DateToShip>2013-10-28T17:00:00</a:DateToShip>
                        <a:DeliveryNoteList i:nil="true"/>
                        <a:FileId>62f1c94d-c967-49c8-8758-e32875f4b2e3</a:FileId>
                        <a:IsConfirmed>true</a:IsConfirmed>
                        <a:IsErrorFlagged>false</a:IsErrorFlagged>
                        <a:IsPriced>true</a:IsPriced>
                        <a:IsProduced>true</a:IsProduced>
                        <a:LabDays>0</a:LabDays>
                        <a:MessageList i:nil="true"/>
                        <a:PartNumber>0</a:PartNumber>
                        <a:PartsTotal>0</a:PartsTotal>
                        <a:ProductList i:nil="true"/>
                        <a:ProductionReference>55996</a:ProductionReference>
                        <a:Subcontractor i:nil="true"/>
                        <a:TimeDelivered>0001-01-01T00:00:00</a:TimeDelivered>
                        <a:TimePrices>0001-01-01T00:00:00</a:TimePrices>
                        <a:TimeProduction>0001-01-01T00:00:00</a:TimeProduction>
                        <a:TimeReOrder>0001-01-01T00:00:00</a:TimeReOrder>
                        <a:TimeUpload>0001-01-01T00:00:00</a:TimeUpload>
                        <a:TimesOrdered>0</a:TimesOrdered>
                        <a:TrackingCode i:nil="true"/>
                        <a:TransportCode>0</a:TransportCode>
                        <a:TransportName i:nil="true"/>
                     </a:ProductionOrder>
                  </a:ProductionOrders>
                  <a:SoftwareType>FFFKiosk</a:SoftwareType>
                  <a:Source>FFF/FTP</a:Source>
                  <a:SourceReference>963697</a:SourceReference>
                  <a:Time>2013-10-24T12:31:11.133</a:Time>
                  <a:TimeCompleted>2013-10-28T14:58:14.997</a:TimeCompleted>
                  <a:TimeIntake>2013-10-24T11:07:00</a:TimeIntake>
                  <a:TimeReceived>2013-10-24T12:31:00</a:TimeReceived>
                  <a:VersionNumber i:nil="true"/>
               </a:ConsumerOrder>
            </a:ConsumerOrders>
         </GetConsumerOrdersResult>
      </GetConsumerOrdersResponse>
   </s:Body>
</s:Envelope>

 

And this is my code :

xmlString = 'XML above';
		
Dom.Document doc = new Dom.Document();
doc.load(xmlString);
Dom.Xmlnode envelope = doc.getRootElement();
		
for(integer i = 0; i < envelope.getChildElements().size(); i++){
			
	Dom.XMLNode body = envelope.getChildElements()[i];
			
	for(Dom.XMLNode child : body.getChildElements()){
	   System.debug(child.getName());
	   System.debug('+++++ : ' + child.getText());
	}			
}

  I get only this : 

1
GetConsumerOrdersResponse
+++++ : 

 

What is the problem please?

Hi , 

 

I have installed an external application to find duplicates while creating lead records.

 

I am creating lead records through vf page,

<apex:pageMessage></apex:pagemessage>

 try {

    insert lead;

}

catch(DMLException e) {

       

String err = String.valueOf(e);
        ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The referral email or phone                       already existing with brigade group' );
        ApexPages.addMessage(myMsg);

}

 

 

The page Messages showing both application error as well as my own exception. 

 

 ex: 

  • <script src="/js/functions.js" type="text/javascript"></script><script src="/soap/ajax/20.0/connection.js" type="text/javascript"></script><script src="/soap/ajax/20.0/apex.js" type="text/javascript"></script><script type="text/javascript"> window.onload = SFSSDupeCatcher_doWork; function SFSSDupeCatcher_doBlockedDuplicate() {var issueTime = '1384764518550'; var sessionId = '00Df0000002KWPO!AQIAQC7RJBmJo7d1mSsbNRnPYJXFKyZ7sYxjTjo86mOTmlKdB7ZsSeNpRteo7_ysAFBovApCx7PSAMPvUzAk1o_y_XaPX3Mu'; var scenarioId = 'a0Jf0000000aDvEEAU'; try{SFSSDupeCatcher_incrementCounter(scenarioId, sessionId, issueTime)}catch(err){};} function SFSSDupeCatcher_doWork() { SFSSDupeCatcher_doBlockedDuplicate(); } function SFSSDupeCatcher_incrementCounter(scenarioId, sessionId, issueTime) {var scenarioQuery = 'Select Name, Id, SFSSDupeCatcher__Blocked_Duplicates__c from SFSSDupeCatcher__Scenario__c where (Id = \'' + scenarioId + '\')'; var state = {output : 'hello', startTime : new Date().getTime() }; var callback = { onSuccess: SFSSDupeCatcher_handleResults,onFailure: SFSSDupeCatcher_queryFailed,timeout: 1200,source: state}; sforce.connection.sessionId = sessionId; sforce.connection.clientId = 'SymphonicSource/DupeCatcher/'; sforce.connection.query( scenarioQuery , callback); } function SFSSDupeCatcher_handleResults(queryResult, source) { var records = queryResult.getArray('records'); for (var i = 0; i < records.length; i++) { var thisscenario = records[i]; thisscenario.SFSSDupeCatcher__Blocked_Duplicates__c++; records = sforce.connection.update(records); } } function SFSSDupeCatcher_queryFailed(error, source) { } </script><font color="blue"><br/>DUPECATCHER WARNING! The Lead that you created was not saved.</font><br/><font color="blue">It has been blocked because the value of the Lead 'Mobile Phone' field that you entered is similar to the 'Mobile Phone' field of the Contacts listed below.</font><br/><br/><font color="green">Click on the links below to view or edit the potential duplicate records.</font><br/>Potential duplicate Contact record: <a href="../003f00000097SVAAA2">Rama Raju</a><br/>Potential duplicate Contact record: <a href="../003f0000008s5PRAAY">Luke Roy</a><br/>Potential duplicate Contact record: <a href="../003f0000009e9FUAAY">Vijay Reddy</a><br/>Potential duplicate Contact record: <a href="../003f0000009AV9dAAG">Vijay Reddy</a><br/>Potential duplicate Contact record: <a href="../003f0000009e9H6AAI">Madhu R</a><br/>
  • The referral email or phone already existing with brigade group                     

 

I wdon't want show application error, i justwant show my own error message. is there any way to handle this exception?

 

Thanks 

siva.

 

I have written a method in controller class to pass two ids in the URL to the next vf page ... but it is not going properly in the URL..

 

public pagereference upload()
{
Id so ;
Id oppId = ApexPages.CurrentPage().getParameters().get('OpId');
for(SOWrap sw :wrapper)
{
so = sw.SOID;
}
return new pagereference('/apex/DocumentUploader?Id=' +so+ '&OppId =' + oppId);

}

 

 

The URL it is passing is :

 

https://cs16.salesforce.com/apex/DocumentUploader?+OppId+=006f0000003aqzUAAQ&Id=a39f00000004IKtAAM

 

I am not able to use OppId in the new page, page not loading .. any help here

Is it possible if a comunity user can tag an internal user by @mention tag?
Here is the issue I am facing:
  1. When the day-light saving was applied, 
  2. I created a account record and selected 11:00 AM in a datetime field.
  3. Now after 6 months, when the clock is reset, I see the same account record and now it displays 10:00 AM.
How can I handle this if anyone faced this issue earlier?
Is there any way I can remove the download link from the chatter file? The use case is, we need to upload a video on company chatter and this will be shared with all the users. Now we are concerned about if someone download it and upload it to the other networks also. like youtube etc. We want to avoid that situation. Is there any way to do that?

Regards,
Bhawani Sharma
When someone ask you to do an org review, what all you consider in that? I have been considered below points yet:
  1. Storage Usage
  2. Data Quality
  3. Profiles
  4. Chatter
  5. Salesforce1
  6. Field Trip
  7. Customization
  8. Notification Banner
  9. Home Page Links
  10. Full Sandbox
  11. Version Repository
Is there anything else that I should include in my assessment report?

Regards,
Bhawani
I am using Salesforce performance edition. I check Activity limits and it says I have been used 86% of custom fields on Activity object. Now whenever I am trying to create new fields, it is keep saying, Limit Exceeded. Anyone is having idea on, why this is happening.

Regardsm,
Bhawani Sharma 
Hi,

Can you please help me to find out the solution for a query?
If I attach a image/pdf file using "Attach File" button, I can view this file in new tab if I click "View" link.
But when I upload the same file through chatter file, I can't see this "View" link. Is there any way to open this file in the new tab exactly in the same way as "View" link opens? 
User-added image

Regards,
Bhawani Sharma
 
Hi,

I am trying to integrate Salesforce with Quickbooks. I have successfully completed the authorization part and I have authorized secret key and token. Now issue is coming when I am trying to call QB APIs:
I am trying to call "Read Account"  api:
Endpoint: https://qb.sbfinance.intuit.com/v3/company/XXXXXXXXXX/account/1
XXXXXXXXXX = CompanyId

and following error is coming:
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-11-11T12:53:14.076Z" requestId="47869c5ecc2442c4bbc15d4906aab328">
    <Fault type="VALIDATION">
        <Error code="7001">
            <Message>message=No destination found for given partition key; errorCode=007001; statusCode=400</Message>
        </Error>
    </Fault>
</IntuitResponse>



I read about this error nline and everyone says that "you need to update base URL to point sandbox". But I couldn't find where this need to be updated in Salesforce.
Can someone please help me to if you have done something similar?

Regards,
Bhawani Sharma
This must be pretty staright forward, but I am not sure why it's not working in sandbox.
I  want to change the company default language, but I am not seeing  any option to do that when I edit Company Profile. This is sandbox environemt. I tried the same thing in my developer edition and it was startight forward, but why it's language dropdown is not coming in sandbox ?  Even my profile is sys admin.

User-added image

Regards,
BSS
In salesforce, we can rewrite URLs for site user, but is there any way I can rewrite the URL for internal users ? 
Like : Rewrite
https://na6.visual.force.com/apex/ContactVFPage?id=003XXXXXXXXXXXX
to
https://na6.visual.force.com/apex/mycontact

I have created a sharing rule to share the contact records to other group when contact is owned by a specific user. This works in all the cases when Account is stamped on contact record, but when account is null on contact, users  from other groups can't see this contact. Is there any specific setting for contacts having no account stamped?
I saw this question lot of time on community, so thought to comeup  with a solution:
http://simplyforce.blogspot.in/2014/08/handling-inline-images-in-salesforce.html
Hi Devs,

Is there any option to check the incoming email priority in Email-to-Case function? Any standard or Custom way ?
Hi Experts,

I am trying to upload a file on S3. I have been verified everything couple of times and all looks correct to me, but whenever I am trying to upload file, getting error message saying

<Br/>
responseText =
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidArgument<BR/><Message>POST requires exactly one file upload per request.</Message><BR/><ArgumentValue>0</ArgumentValue><BR/><ArgumentName>file</ArgumentName><BR/><RequestId>3670E4EE52B3BCD5</RequestId><BR/><HostId>b3rOF/9WJHymo1ZENIOlrct/ZusAJ50AnSIP0df3K3+DdEcAFolJDx8qU6DH2N1l</HostId><BR/></Error></Code>

Can someone please help me to findout what I am doing wrong here?

<body>
       
        <div id="s3-fileuploader" class="dropArea"></div>
       
        <script type="text/javascript">

            j$ = jQuery.noConflict();

            //block and unblock UIbased on endpoint url
            function setUI(){
                j$('div.dropArea').unblock();
            }

            $(document).ready(function () {
           
                $('#s3-fileuploader').fineUploader({
               
                    request: {
                        endpoint: "https://{!bucketname}.s3.amazonaws.com",
                        accessKey: "{!key}"
                    },
                    signature: {
                       
                        //always included
                        "expiration": "{!expireStr}",
                       
                        signature : "{!signedPolicy}",
                        policy: "{!policy}",

                        "conditions":
                        [
                            //always included
                            {"acl": "public-read"},
                    
                            //always included
                            {"bucket": "{!bucketname}"},
                    
                            //not included in IE9 and older or Android 2.3.x and older
                            {"Content-Type": "{!ContentType}"},
                    
                            //always included
                            {"key": "{!key}"},
                    
                            //always included
                            {"x-amz-meta-qqfilename": "{!URLENCODE('test.jpg')}"},
                        ]
                    },
                    cors: {
                        expected: true, //all requests are expected to be cross-domain requests
                        sendCredentials: false, //if you want cookies to be sent along with the request
                        allowXdr: true
                    },

                    autoUpload: true,
                    multiple:false,
                    debug: true,
                   
                    text: {
                        uploadButton: '<i class="icon-plus icon-white">Select Files</i> '
                    },    
                    uploadSuccess: {
                        endpoint: "{!redirectURL}"
                    }
                }).on('submit',function(event,id,name){

                    //set endpoint
                    console.log('https://{!bucketname}.s3.amazonaws.com');
                    $(this).fineUploader('setEndpoint','https://{!bucketname}.s3.amazonaws.com');

                });
                setUI();
            });

        </script>
    </body>

Is there any way to synchronize the only  outlook contacts with Salesforce. I don't want to synchronize Salesforce contacts with my outlook.

I have a matrix report. This is showing data Lead count data.

Rows are grouped by Lead Owner and Columns are grouped by Lead Status.

 

Now I need to create a dashboard which display actual lead count in each status for each owner Vs Goal.

Like User A has 5 Leads in "Contacted" Status, while the Goal was 10. I am running in Professional Edition.

 

Hi All,

 

1. When we ceate a feedItem and mentioned user in it, he gets a notification email. Is there any  programmatic way to stop these notifications from trigger?

2. Is there any way to update an existing feedItem?

 

Hi All,

 

Looks like Salesforce bug, still wanted to check of wide community to make sure I am not missing anything. 

I have written a trigger on FeedItem object. In trigger, I am only adding a suffix in body. When I do this, body lost all the @mentions from it.

Can anyone please help me here to find out the answer? 

Can anyone help me on this? I am trying to find security token option, but couldn't find. This is happing in all he sandbox where Summer 13 has been reached.

This is just an announcement that you can save your component searching time using:

http://simplyforce.blogspot.in/2013/05/quick-finder-for-salesforce.html

Is it possible if a comunity user can tag an internal user by @mention tag?
When someone ask you to do an org review, what all you consider in that? I have been considered below points yet:
  1. Storage Usage
  2. Data Quality
  3. Profiles
  4. Chatter
  5. Salesforce1
  6. Field Trip
  7. Customization
  8. Notification Banner
  9. Home Page Links
  10. Full Sandbox
  11. Version Repository
Is there anything else that I should include in my assessment report?

Regards,
Bhawani
Here is the issue I am facing:
  1. When the day-light saving was applied, 
  2. I created a account record and selected 11:00 AM in a datetime field.
  3. Now after 6 months, when the clock is reset, I see the same account record and now it displays 10:00 AM.
How can I handle this if anyone faced this issue earlier?
We are getting following error while creating a task in Salesforce.
Error msg: Too many retries of batch save in the presence of Apex triggers with failures: when triggers are present partial save requires that some subset of rows save without any errors in order to avoid inconsistent side effects from those triggers. Number of retries: 2 
We are getting this error on calling SforceService.create() function.

Please let me know the solution for this.
Hi all,

I am trying to siiable chatter answers from my production org. I have never used the eclipse force.com plug in but i know this is how i have to delete them.

Would anyone be able to provide a step by step process to deleting a class on this?

I am not sure if i need to log into the sandbox or production

Thanks
Hi Experts,

I need a Formula help.
I have two date fields(T__c, F__c), I need difference between dates format like X Year(s) X Month(s) X Day(s)

To Date field: T__c
From Date field:  F__c

My formula is below..

IF(AND(Year(T__c)=Year(F__c),Month(T__c)>=Month(F__c),Day(T__c)>=Day(F__c)),TEXT(Month(T__c)-Month(F__c))&" Month(s) "&""&TEXT(Day(T__c)-Day(F__c))&" Day(s) ",
IF(AND(Year(T__c)=Year(F__c),Month(T__c)>Month(F__c),Day(T__c)<Day(F__c)),TEXT((Month(T__c)-Month(F__c))-1)&" Month(s) "&""&TEXT((30+Day(T__c))-Day(F__c))&" Day(s) ",

IF(AND(Year(T__c)>Year(F__c),Month(T__c)=Month(F__c),Day(T__c)=Day(F__c)),TEXT(Year(T__c)-Year(F__c))&" Year(s) ",

IF(AND(Year(T__c)>Year(F__c),Month(T__c)>Month(F__c),Day(T__c)=Day(F__c)),TEXT(Year(T__c)-Year(F__c))&" Year(s) "&""&TEXT(Month(T__c)-Month(F__c))&" Month(s) ",
IF(AND(Year(T__c)>Year(F__c),Month(T__c)>Month(F__c),Day(T__c)>Day(F__c)),TEXT(Year(T__c)-Year(F__c))&" Year(s) "&""&TEXT(Month(T__c)-Month(F__c))&" Month(s) "&""&TEXT(Day(T__c)-Day(F__c))&" Day(s) ",
IF(AND(Year(T__c)>Year(F__c),Month(T__c)>Month(F__c),Day(T__c)<Day(F__c)),TEXT(Year(T__c)-Year(F__c))&" Year(s) "&""&TEXT((Month(T__c)-Month(F__c))-1)&" Month(s) "&""&TEXT((30+Day(T__c))-Day(F__c))&" Day(s) ",

IF(AND(Year(T__c)>Year(F__c),Month(T__c)<Month(F__c),Day(T__c)=Day(F__c)),TEXT((Year(T__c)-Year(F__c))-1)&" Year(s) "&""&TEXT((30+Month(T__c))-Month(F__c))&" Month(s) ",
IF(AND(Year(T__c)>Year(F__c),Month(T__c)<Month(F__c),Day(T__c)>Day(F__c)),TEXT((Year(T__c)-Year(F__c))-1)&" Year(s) "&""&TEXT((12+Month(T__c))-Month(F__c))&" Month(s) "&""&TEXT(Day(T__c)-Day(F__c))&" Day(s) ",
IF(AND(Year(T__c)>Year(F__c),Month(T__c)<Month(F__c),Day(T__c)<Day(F__c)),TEXT((Year(T__c)-Year(F__c))-1)&" Year(s) "&""&TEXT(((12+Month(T__c))-Month(F__c))-1)&" Month(s) "&""&TEXT((30+Day(T__c))-Day(F__c))&" Day(s) ", 
TEXT(0) 
)))))))))

Formula is perfect, but it showing below error.

Error:  Compiled formula is too big to execute (5,153 characters). Maximum size is 5,000 characters.

Anyone can please sort out this.
Thanks in advance.

Thanks,
Manohar
When sending an email using the Salesforce API via AIR I can successfully send a HTML email like this:

var message:SingleEmailMessage = new SingleEmailMessage();
message.senderDisplayName = "SenderName";
message.replyTo = "sender@name.com";
message.saveAsActivity = true;
message.targetObjectId = recipientID;
message.subject = _emailSubject;
message.htmlBody = _htmlBody;
var messages:Array = [message];
airConnection.sendEmail(messages, new AsyncResponder(

But if I try to set a template ID the sending fails with no obvious error

var message:SingleEmailMessage = new SingleEmailMessage();
message.senderDisplayName = "SenderName";
message.replyTo = "sender@name.com";
message.targetObjectId = recipientID;
message.templateId = "Sample_HTML_Mail";
var messages:Array = [message];
airConnection.sendEmail(messages, new AsyncResponder(

The template does exist and the ID I'm specifying is the Template Unique Name specified in Salesforce.

Would anyone have any ideas why this is happening and how I might fix it?

Thanks,

Mark
Hi All,
Sometime before i was able to connect to SFDC through my java code..
https://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_code_walkthrough.htm

But now I am getting below error
2015-01-13 15:21:32,642 [main           ] INFO  SpringCamelContext             - Apache Camel 2.12.1 (CamelContext: camel) is shutting down
Exception in thread "main" org.apache.camel.RuntimeCamelException: [LoginFault [ApiFault  exceptionCode='INVALID_LOGIN'
 exceptionMessage='Invalid username, password, security token; or user locked out.'
]
]

    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1344)
    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
    at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:301)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:186)
    at org.apache.camel.spring.Main.doStart(Main.java:140)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:148)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:343)
    at org.genpact.onedb.eapp.MyRouteBuilder.main(MyRouteBuilder.java:35)
Caused by: [LoginFault [ApiFault  exceptionCode='INVALID_LOGIN'
 exceptionMessage='Invalid username, password, security token; or user locked out.'
]

Pls help.
Hi Everyone,

I am new to Salesforce Apex Coding and would greatly appreaciate if someone can help me out.

We have custom object called "Custom Payment" with a lookup field to Contact.
The following is my Apex Class that I am using as an Extension for a Visualforce Page to autopopulate the information from Contact Object when the Users Select a Contact on the Visualforce Page.

Everything is working fine and the record is also getting saved but than I recieve the Apex Governor Limit Warning emails from Salesforce.

Approaching limit for non-selective query against large object type (more than 100000 rows). Current size is approximately 90261 rows. When the limit is reached, the query will fail. Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times) null

*******************************************************************************************************************************
public class manualpaymentcntrl{
    public Custom_Payment__c ptxn { get; set; }
    public Contact con { get; set; }
        
public manualpaymentcntrl(ApexPages.StandardController std) {
    ptxn=new Custom_Payment__c ();//Create a new instance 
    con=new Contact();
}

public pagereference obtaindetails() {
   
       for ( Contact con : [select FirstName,LastName,Email,AccountID,Phone,MobilePhone,Title, MailingStreet,MailingCity,MailingState,MailingCountry,MailingPostalCode from Contact where Id = :ptxn.Contact__c]){
   
        ptxn.FirstName__c = con.FirstName;
        ptxn.LastName__c = con.LastName;
        ptxn.Email__c = con.Email;
        ptxn.Account__c = con.AccountID;
        ptxn.Phone__c = con.Phone;
        ptxn.MobilePhone__c = con.MobilePhone;
        ptxn.Salutation__c = con.Title;
        ptxn.MailingStreet__c = con.MailingStreet;
        ptxn.MailingCity__c = con.MailingCity;
        ptxn.MailingState__c = con.MailingState;
        ptxn.MailingCountry__c = con.MailingCountry;
        ptxn.MailingPostalCode__c = con.MailingPostalCode;
        
        ptxn.Payment_Setting__c = 'a0x900000012re5';
        ptxn.Frequency_Type__c = 'a0p9000000opqn1';
            
   
   }
    return null;
  }

    public PageReference save(){
       
        upsert ptxn;
      
        PageReference reRend = new PageReference('/apex/custommanualpayment');
        reRend.setRedirect(true);
        return reRend;
    }
    
    public PageReference cancel(){
       
            
        PageReference reRend = new PageReference('/apex/home/home.jsp');
        reRend.setRedirect(true);
        return reRend;
    }
}


Thanks In Advance......
Hi,

I have a post install script. All I want to do is add a record to a custom object (which comes with the package). In the record that i want to add automatically, I want to get details from the logged in User, and generate a random number.

After install I cannot see my the record which should be added with the post install script. The Test I did with test classes says its PASS. Here is my Post Install class. What am I doing wrong here? Please help. Thanks in advance.


global class PostInstallClass implements InstallHandler {
    global void onInstall(InstallContext context) {
        if(context.previousVersion() == null) {
            string userEmail = UserInfo.getUserEmail();
            string firstName = UserInfo.getFirstName();
            string lastName  = UserInfo.getLastName();
            string orgName   = UserInfo.getOrganizationName();
            string recName  = 'MyRec1';
            string uniqueId   = generateRandomString(40);
            
           MyCustomObject__c c = new MyCustomObject__c(UniqueID = uniqueId, Your_Company__c = orgName, Name = recName, First_Name__c = firstName, Last_Name__c = lastName, Email__c = userEmail);
            insert c;
       }
    }

public static String generateRandomString(Integer len) {
        final String chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
        String randStr = '';
        while (randStr.length() < len) {
           Integer idx = Math.mod(Math.abs(Crypto.getRandomInteger()), 62);
           randStr += chars.substring(idx, idx+1);
        }
        return randStr;
    }

}