• Sumitkumar_Shingavi
  • SMARTIE
  • 1206 Points
  • Member since 2014
  • Founder & Senior Technical Consultant
  • CloudZeal & Cloud Sherpas Inc.


  • Chatter
    Feed
  • 27
    Best Answers
  • 0
    Likes Received
  • 12
    Likes Given
  • 0
    Questions
  • 314
    Replies
Hi, I would like to create a trigger on the ideas object to send an email to all voters/commentors on the particular ID, when a custom field (Idea_Status__c) is updated,    Any help would be awesome,  Here is what I have so far


trigger IdeaTrigger on Idea (after update) {
    
    Set<Id> ideaIds = trigger.newMap.keySet();
    
    Map<Id,List<User>> ideaUserMap = new Map<Id,List<User>>();
    
    for(Id i : ideaIds)
        ideaUserMap.put(i.Id,new List<User>());
    
    for(IdeaComment ic : [SELECT Id, CreatedBy.Id,IdeaId FROM IdeaComment WHERE IdeaId IN :ideaIds]){
        ideaUserMap.get(ic.IdeaId).add(ic.CreatedBy);
    }
    
    for(Vote iv : [SELECT Id, CreatedBy.Id, ParentId FROM Vote WHERE ParentId IN :ideaIds AND Type = 'Up']){
        ideaUserMap.get(iv.ParentId).add(ic.CreatedBy);
    }
    
    //create list of outbound emails
    Messaging.SingleEmailMessage[] messages = new Messaging.SingleEmailMessage[]{};
    
    for(Idea i : Trigger.new){
        
        //Need to check that the custom field has changed on the ideas object
        if(i.Idea_Status__c == oldMap.get(i).Idea_Status__c)
            continue;
        //"merge" fields into template
        String EmailSubject = i.Name;
        String EmailBody = 'Name:' + i.Name;
        emailBody += '\nIdea Id: ' + i.Id;
        //add the rest of the fields you want in the body.
    
        
    
        //for each user, create a template, set the text
        for(User u : ideaUserMap.get(i.Id)){
    
             Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
             email.setTargetObjectId(u.id);
             //email.setOrgWideEmailAddressId(BlackHoleOrgWide);
             email.setSubject(EmailSubject);
             email.setHtmlBody(EmailBody);
             messages.add(email);
        }
    
    }

    //send the list of messages
    Messaging.sendEmail(messages);
    
}
 
I used the code that Jeff Douglas http://blog.jeffdouglas.com/2010/07/13/building-a-dynamic-search-page-in-visualforce/ wrote to create a case search but cannot get the test code to work. 

Here is the controller:
public with sharing class CaseSearchController {

  // the soql without the order and limit
  private String soql {get;set;}
  // the collection of cases to display
  public List<Case> cases {get;set;}

  // the current sort direction. defaults to asc
  public String sortDir {
    get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
    set;
  }

  // the current field to sort by. defaults to caseNumber
  public String sortField {
    get  { if (sortField == null) {sortField = 'caseNumber'; } return sortField;  }
    set;
  }

  // format the soql for display on the visualforce page
  public String debugSoql {
    get { return soql + ' order by ' + sortField + ' ' + sortDir + ' limit 40'; }
    set;
  }

  // init the controller and display some sample data when the page loads
  public CaseSearchController() {
    soql = 'select casenumber,Business_Unit__c , Site_Account__r.name, product_family__c from case where casenumber != null';
    runQuery();
  }

  // toggles the sorting of query from asc<-->desc
  public void toggleSort() {
    // simply toggle the direction
    sortDir = sortDir.equals('asc') ? 'desc' : 'asc';
    // run the query again
    runQuery();
  }

  // runs the actual query
  public void runQuery() {

    try {
      cases = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 40');
    } catch (Exception e) {
      ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));
    }

  }

  // runs the search with parameters passed via Javascript
  public PageReference runSearch() {

    String caseNumber = Apexpages.currentPage().getParameters().get('caseNumber');
    String bu = Apexpages.currentPage().getParameters().get('bu');
    String accountSite = Apexpages.currentPage().getParameters().get('accountSite');
    String productFamily = Apexpages.currentPage().getParameters().get('productFamily');

    soql = 'select CaseNumber, Business_Unit__c, Site_Account__r.name, product_family__c from case where casenumber != null';
    if (!caseNumber.equals(''))
      soql += ' and caseNumber LIKE \''+String.escapeSingleQuotes(caseNumber)+'%\'';
    if (!bu.equals(''))
      soql += ' and Business_Unit__c = \''+bu+'\'';
    if (!accountSite.equals(''))
      soql += ' and Site_Account__r.name LIKE \''+String.escapeSingleQuotes(accountSite)+'%\'';  
    if (!productFamily.equals(''))
      soql += ' and product_family__c = \''+productFamily+'\'';

    // run the query again
    runQuery();

    return null;
      }

  // use apex describe to build the picklist values
  public List<String> productfamilies {
    get {
      if (productfamilies == null) {

        productfamilies = new List<String>();
        Schema.DescribeFieldResult field = Case.product_family__c.getDescribe();

        for (Schema.PicklistEntry f : field.getPicklistValues())
          productfamilies.add(f.getLabel());

      }
      return productfamilies;          
    }
    set;
  }
  public List<String> businessunits {
    get {
      if (businessunits == null) {

        businessunits = new List<String>();
        Schema.DescribeFieldResult field = Case.Business_Unit__c.getDescribe();

        for (Schema.PicklistEntry f : field.getPicklistValues())
          businessunits.add(f.getLabel());

      }
      return businessunits;          
    }
    set;
  }
 }

Here is the page:
<apex:page controller="CaseSearchController" sidebar="false">

  <apex:form >
  <apex:pageMessages id="errors" />

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

  <table width="100%" border="0">
  <tr>  
    <td width="200" valign="top">

      <apex:pageBlock title="Parameters" mode="edit" id="criteria">

      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("caseNumber").value,
          document.getElementById("bu").options[document.getElementById("bu").selectedIndex].value,
          document.getElementById("accountSite").value,
          document.getElementById("productFamily").options[document.getElementById("productFamily").selectedIndex].value
          );
      }
      </script> 

      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors">
          <apex:param name="caseNumber" value="" />
          <apex:param name="bu" value="" />
          <apex:param name="accountSite" value="" />
          <apex:param name="productFamily" value="" />
      </apex:actionFunction>

      <table cellpadding="2" cellspacing="2">
      <tr>
        <td style="font-weight:bold;">Case Number<br/>
        <input type="text" id="caseNumber" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">BU<br/>
          <select id="bu" onchange="doSearch();">
            <option value=""></option>
            <apex:repeat value="{!businessunits}" var="bus">
              <option value="{!bus}">{!bus}</option>
            </apex:repeat>
          </select>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Site Account<br/>
        <input type="text" id="accountSite" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Product Family<br/>
          <select id="productFamily" onchange="doSearch();">
            <option value=""></option>
            <apex:repeat value="{!productfamilies}" var="prod">
              <option value="{!prod}">{!prod}</option>
            </apex:repeat>
          </select>
        </td>
      </tr>
      </table>

      </apex:pageBlock>

    </td>
    <td valign="top">

    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{!cases}" var="case">

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Case Number" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="caseNumber" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>                
            <apex:outputLink value="/{!Case.Id}" target="_blank">{!Case.casenumber}</apex:outputLink>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="BU" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Business_Unit__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!case.Business_Unit__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Site Account" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Site_Account__r.name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!case.Site_Account__r.name}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Product Family" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Product_Family__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!case.Product_Family__c}"/>
            </apex:column>

        </apex:pageBlockTable>

    </apex:pageBlock>

    </td>
  </tr>
      </table>

  <apex:pageBlock title="Debug - SOQL" id="debug">
      <apex:outputText value="{!debugSoql}" />           
  </apex:pageBlock>   

  </apex:pageBlock>

  </apex:form>

</apex:page>

Here is the test code that I am trying to use, the error is "Error: Compile Error: Variable does not exist: sources at line 25 column 15" and the line it is referring to is "testSources = controller.sources;"
@isTest 

private class theCaseSearchController { 
static testMethod void testSearchController() { 

//instantiate a page      

PageReference pg = Page.Case_Search_auto; 
Test.setCurrentPage(pg); 
pg.getParameters().put('caseNumber', '999999'); 
pg.getParameters().put('bu', 'test MC'); 
pg.getParameters().put('accountSite', 'test acct site'); 
pg.getParameters().put('productFamily', 'test prod family'); 

// instantiate the controller 

CaseSearchController controller=new CaseSearchController(); 
System.assert(controller.runSearch() == null); 
String testDebugSoql = controller.debugSoql; 

controller.toggleSort(); 
System.assertequals (controller.sortDir, 'desc'); 

List<String> testSources = new List<String>(); 
testSources = controller.sources; 
System.assertequals (testSources[0], 'vesta');

//to test the catch clause we need to make the query fail 
 

controller.sortField = 'badfield'; 
controller.runQuery(); 
}
}
Any help is greatly apprechiated!!
Thanks, Linda

 
When a lead is updated and the owner is X and the Matched Status is Enriched, run the default lead assignment rule. My code is below, but when it runs I get the error below. It looks like it is looping the updating over and over.

Can you tell me where I am going wrong?

Code:

trigger AssignLeadAfterClean on Lead(after update) {
    Database.DMLOptions dmo = new Database.DMLOptions();
    dmo.assignmentRuleHeader.useDefaultRule= true;
    
    // Get the related leads in this trigger.        
    List<Lead> relatedLeads = [SELECT ID,OwnerID,ivm__MatchedStatus__c FROM Lead
                               WHERE Id IN :Trigger.New];
    
    List<Lead> leadsToUpdate = new List<Lead>();
    
    // Iterate over the related leads
    for(Lead lead_n1 :relatedLeads) {      
        // Run the Lead Assignement Rule when the owner is 005C0000006pm5r and clean process has completed
        if ((lead_n1.OwnerID == '005C0000006pm5r') && (lead_n1.ivm__MatchedStatus__c == 'Enriched')) {
            lead_n1.setOptions(dmo);
            leadsToUpdate.add(lead_n1);
        }
    }
    
    // Perform DML on a collection
    update leadsToUpdate;
}


Error:

Error:Apex trigger AssignLeadAfterClean caused an unexpected exception, contact your administrator: AssignLeadAfterClean: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 00QM0000006fq8JMAQ; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AssignLeadAfterClean: maximum trigger depth exceeded Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J] Lead trigger event AfterUpdate for [00QM0000006fq8J]: []: Trigger.AssignLeadAfterClean: line 21, column 1
I have 2 fields Source_System__c (Picklist) and  Currency__c (Text) fields. I need to write a formula for the below condition.
I created a formula field formula_value.

if(source system == abc) && (currency == 1) then formula_value= x1
if(source system == abc) && (currency == 2) then formula_value= x2 and so on.

I wrote a formula as below which is repeating ISPICKVAL( Source_System__c, "abc"). 
 
IF((ISPICKVAL( Source_System__c, "abc")) && (Currency__c == 'Afghanistan Afghani'),"AFN",
IF((ISPICKVAL( Source_System__c, "abc")) && (Currency__c == 'Albanian Lek'),"ALL",
"NULL"))

Can anyone optimise the above formula by using picklist value only once. I need to check like this for 20 times.
Ineed help withthe following Apex Trigger:

trigger ForceSourceCrossRef on Lead (before insert, before update ) {
   
    For (Lead l:Trigger.new) {        
        if(l.Source__c != null) {
           List<CrossRef__c> cr = new List<CrossRef__c>();
           cr = [Select Id from CrossRef__c WHERE
                   CrossRef__c.Name = :l.Source__c ORDER BY Id LIMIT 1];
              if(cr.size()>0){
                    cr.Source_Cross_Reference__c = cr[0].Id;
            }
        }
    }    
}

Attempting to update a custom lookup field on the Lead object called Source_Cross_Reference__c with the value that's imported in a Lead field called Source__c.  (Source__c is a picklist field.)  There is a custom object called CrossRef__c that uses the Source__c picklist value in the CrossRef__c.Name field.  I want to populate the Source_Cross_Reference__c field with the ID value from the CrossRef__c object.  The Devleoper Console is displaying the following Problem: "Initial term of field expression must be a concrete SObject: List&lt;CrossRef__c&gt;".. What is neededto correct this problem?  Will this trigger perform the update described earlier?
Hi,

I have a javascript which gets the next case assigned to user who is logged in. If the case owner is a queue, by clicking the get next case, the case is assigned to that user. What I want is to prevent the user to change the owner from queue to him/her if the condition says the user is out of office = True. Here is my code. I don't how to insert the ischange(owner) function in javascript.
{!REQUIRESCRIPT("/soap/ajax/18.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/18.0/apex.js")} 
{!REQUIRESCRIPT("/xdomain/xdomain.js")}
{!REQUIRESCRIPT("/support/console/30.0/integration.js")} 

var id = sforce.apex.execute("RetrieveNextUtils","retrieveNextCase",{userId:""}); 

// Prevent the user to change the owner from queue to him/her if the condition says the user is out of office = True//
if ( '{!Case.Agent_Out_of_Office__c}' == true ){
   alert ('Next case cannot be assigned because you are marked as out of office.');
     }

else if (id!='') { 
var querystringParams = ""; 
if (window.location.href.indexOf("isdtp=mn")!=-1) { 
querystringParams = "?isdtp=mn"; 
} else if (window.location.href.indexOf("isdtp=vw")!=-1) { 
querystringParams = "?isdtp=vw"; 
} 
//We have successfully retrieved a case 
if (sforce.console.isInConsole()) { 
sforce.console.openPrimaryTab(null, '/'+id + querystringParams, true, null, null, null);
} else { 
navigateToUrl('/'+id + querystringParams);
}
} else { 
alert('No cases are available at this time.'); 
}

Can anyone help please?
  • June 04, 2015
  • Like
  • 0
I have an Visual Force page which when visited launches an Apex Callout (With the use of URL Parameters from visualforce page), when this callout is done (Contact object has been created/updated) the original VisualForce page needs to update to reflect the returned contact object.
How can this be done?
 
I was trying to build a URL using the address saved as a field in the database. 

I'm having trouble figuring out how to get the result of a database query as a string so as to edit and append it tio URL. 

Is there an easy way to do that?

Thanks.
Please help me in making the code work for multiple records.

Ii am having two queries ..I wrote where condition as xyz[0].abc.Xyz is another list.

Here are my queries:

List<Opportunitylineitem> Opplinitemlist =[select Id,PricebookEntry.Product2.Name,PricebookEntry.Product2.id,
from Opportunitylineitem  where Opportunityid IN :Trigger.newMap.keySet() and Acc__c =''];
    if(opplinitemlist.size()>0)       
 List<acc__c>   query=[select id,name,serfvice date  from Acc__c  where Acc__c.product__c=:opplinitemlist[0].PricebookEntry.Product2.id and Acc__c.Account__c =: Opportunitylist[0].accountid ];

I am aware that i have to use for loop and run through each record.but i am getting error:INitiall term field expression.

Pls help

 
Hi folks,
       Can anyone tell me what is the purpose of DESK.com ?
How to use DESK.com?


Thanks in advance
Karthick
Hi,

I have two pageblock table to display the data from two different variables.Can anyone please guide me how can i show the data in single table.

Below is my code

<apex:page StandardController="Campaign"  extensions="singleListView">
<apex:form >
        <apex:pageBlock mode="maindetail" >
                      <apex:pageblocktable value="{!CampaignMembers}" var="cm">
                 
                 <apex:column headerValue="Phone">
                           <apex:repeat value="{!cm.CampaignMembers}" var="cpm"> 
                             <apex:outputfield value="{!cpm.Lead.Phone}" />
                              </apex:repeat>
                               </apex:column>
                                                   
            </apex:pageblocktable>
 
            <apex:pageBlockTable value="{!ContactMembers}" var="cmc">
                            <apex:column headerValue="Phone">
                           <apex:repeat value="{!cmc.CampaignMembers}" var="cpmc"> 
                            <apex:outputfield value="{!cpmc.Contact.Phone}" rendered="{!cpmc.Contact.Phone != null}"/>
                            </apex:repeat>
                            </apex:column>
                          </apex:pageBlockTable> 
              
                        </apex:pageBlock>   
    
    </apex:form>
</apex:page>

We have a test class with (SeeAllData=true),
The class recently started failing due to 'Too many SOQL queries: 101 in test class'.

We understand the problem in the code but now we don't seem to be able to update the test class on the live organization 
(In a change set from the sandbox) because the test fails on deploy.

Any way to solve this issue?

Thanks

I have a trigger for converting leads but I can not get the code coverage past 26%.  Please Help

Trigger:
trigger AutoConvert on Lead (after update) {
    list<Lead> LeadsToConvert = new list<Lead>();
    for(Lead myLead: Trigger.new){
        if(!myLead.isConverted && myLead.status=='Consult to be Scheduled' )
            LeadsToConvert.add(myLead);
    }

    list<Database.LeadConvert> leadConverts = new list<Database.LeadConvert>();
    for(Lead myLead : LeadsToConvert){
        Database.LeadConvert lc = new database.LeadConvert();
        lc.setLeadId(myLead.Id);
        lc.convertedStatus = 'Consult to be Scheduled';
        //Database.ConvertLead(lc,true);
        lc.setDoNotCreateOpportunity(False);
        leadConverts.add(lc);
    }

    if(!leadConverts.isEmpty()){
        for(Integer i = 0; i <= leadConverts.size()/100 ; i++){
            list<Database.LeadConvert> tempList = new list<Database.LeadConvert>();
            Integer startIndex = i*100;
            Integer endIndex = ((startIndex+100) < leadConverts.size()) ? startIndex+100: leadConverts.size();
            for(Integer j=startIndex;j<endIndex;j++){
                tempList.add(leadConverts[j]);
            }
            Database.LeadConvertResult[] lcrList = Database.convertLead(tempList, false);
            for(Database.LeadConvertResult lcr : lcrList)
                System.assert(lcr.isSuccess());
        }
    }
}
Anyone please tell me what this means. I've created an apex class and I'm trying to access in VF. It throws an error like the above. 

Please help me out. I'm new to apex
Hi experts,

I'm trying to integrate amazon S3 with Sales force, i did it with the toolkit. When it says to
upload image,it shows the image to a bigger size which I do not want.How do i resize it ?.Pressing my head onto this from many days . Can anybody please help me to fix this ?

Thank you !
hi all,

i am trying to execute upsert call from enterprise wsdl via SOAP UI tool
below is my soap request.

Problem: i am unable to specify the object type.
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:enterprise.soap.sforce.com" 
xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
     
      <urn:SessionHeader>
         <urn:sessionId>XXXXXXXXXXXXXXX</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:upsert>
         <urn:externalIDFieldName>Product_Id__c</urn:externalIDFieldName>
         <!--Zero or more repetitions:-->
         <urn:sObjects urn:type="Product__c">
            <!--Zero or more repetitions:-->
          <Product_Id__c>456721</Product_Id__c>
          <Name>My test</Name>
          <Product_Brand__c>HIGHLAND PARK</Product_Brand__c>
         </urn:sObjects>
      </urn:upsert>
   </soapenv:Body>
</soapenv:Envelope>
When i run this request i get the below response
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>sf:INVALID_TYPE</faultcode>
         <faultstring>INVALID_TYPE: Must send a concrete entity type.</faultstring>
         <detail>
            <sf:InvalidSObjectFault xsi:type="sf:InvalidSObjectFault">
               <sf:exceptionCode>INVALID_TYPE</sf:exceptionCode>
               <sf:exceptionMessage>Must send a concrete entity type.</sf:exceptionMessage>
               <sf:row>-1</sf:row>
               <sf:column>-1</sf:column>
            </sf:InvalidSObjectFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
i then added the namespace to my request 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 and the upsert was successfull.Is this a correct way to add the namespace explicitly?
If i send such a wsdl to third party it would eventually fail 
hi all,

I would like to know the procedure of how to register for develoepr  summer maintenance exam.
i logged in to my developer account and followed the path
Register for a new exam--->developer exam--->
however i am unable to proced further as i get a pop up saying that you have already passed this exam.But i have only passed the Spring exam and i now i want to give my summer release exam


Someone please help

 
Hello Everyone.

I have created a trigger by using context varibale.Need to bulkfying my code.
Can you please help out.

trigger AccountTestTrigeer on Account (before insert, before update) {
    AccountTestTrigeerhandler handler = new AccountTestTrigeerhandler();

     if(Trigger.Isbefore && Trigger.isInsert)
    
     {
      handler.onDuplicateCheck(Trigger.New);
     }else if (Trigger.Isbefore && Trigger.Isupdate)
     {
      handler.onDuplicateCheck(Trigger.New);
     }
   
}

And here is my Trigger Handler class

public without sharing class AccountTestTrigeerhandler
{



public void onDuplicateCheck(List<Account> Acctlist)
{
 
  for(Account acterror:Acctlist)
  {
   List<Account> acc=[Select id from Account where Name=:acterror.Name ]; //Need to query this outside the for lOOP who to Acheive this please
   system.debug('AccountistVaues' +acc);
   system.debug('AccountSize@@@@@@@@@@@'+acc.size());
  if(acc.size()>0)
  {
   acterror.addError('You Cannot Create the Duplicate Account');
  }
 
}
 
 
}

}

Regards,
Jyo
Hello Bill,

I have created a number of flows and am now setting up a trigger.  
How and where do I pass a flow variable?  See screen shot
Flow Trigger Variable
For Example

public Pagereference method1()
{
        return null;
}

why we use pagereference as a return type,............ what is the situation to use the pagereference,,,,......... Please explain me with code example..............
Hi folks I wondered if you could help.

I have a custom object named 'RM Database' with two custom fields named 'RM Email Address' and 'Portfolio Code' (the unique record identifier).

On the 'Lead' and 'Account' objects I have a custom Lookup Relationship field called 'RM Portfolio Code' and an email field called 'RM Email address'.  I want the 'RM Email address' field to reference the selected 'RM Portfolio Code' field and this is where I'm struggling.

So far I've tried to edit the formula for the default value on the email field to reference the custom object however it won't let me do that.  I've also tried to create a Workflow rule to update the field which works but not in the desired way, I want it to happen automatically.

Please can someone help me write a trigger (and a test class) that will help with this?

Many thanks,
Dave
Hello,

I have been using Process Builder for a few weeks now. Its main purpose for me has been in its ability to update records in my database without having to click "edit" and "save". I have certain triggers firing off foreign field values, which are therefore only updating when I enter into their object and click the mentioned buttons. Process builder has enabled me to fix this problem. All has been working swell - that is until just recently.

Currently every time I build a new process, an old one stops working; it does not deactivate, it simply ceases to operate successfully. I understand there are governor limits etc, however I do not fully understand these. From my comprehension, after doing a bit of reading, my APEX coding and Processes are hardly close to these limitations. 

I am curious if anybody knows of a solution. These processes are very important to the operations of my database. I would appreciate any sort of help.

To be clear, it is the actions within the processes which stop working. For example, I have a process that updates a custom object upon the change of a field in the opportunity object. This change should update two separate objects - obj1 and obj2. I therefore create two processes and activate them. They are however failing to work simultaneously. When I deactivate one, the other works - vice versa. When I bring the two actions into one process the top-most action is the only one which works. 

Thank you for your time in reading this. Enjoy your day.

All the best,
Cole
Lab Object is the child of Student objectWorkflow action rulesStudent Object is the Master Object of Lab Object

Hi All
I would appreciate any help with the above scenario, Attached are the screen shots of the scenario.
The situation is :
I have created a Master-Detail relationship from Lab object to Student Object, where student is the Master and lab is child.
On student object i created a rollup summary field called "Lab Absent"
My workflow rule is (Whenever a student is absent for the lab for 2 consecutive days, the "Lab absent" field on student object should update and automatically send an email to the faculty).

******** The problem we have is ---- when the student returns on the third day and is marked present on the "Lab Object"
The "Lab Absent"  field on student object doesn't change the value back to zero and it is still sending an email that the student is absent.

Please advise solution for the above problem and if there is any issues with my logic.
Note: the above situation doesn't involve any coding, its purely using Admin. If there is any coding required please advise the code.

Regards
Ramesh
Hi Guys,
I have enabled chatter notification on each post to a group in the settings. But the problem is I get email only on commenting on the post, but not on new post. Can anyone help me with this?

Thanks,
Vetri
According to the ISVForce quickstart guide ( https://na1.salesforce.com/help/pdfs/en/salesforce_packaging_guide.pdf
) the first steps to packaging and publishing an app require the use of Environment Hub within your partner account in order to create a dev org, test org and business org.

Our partner account doesn't seem to have Environment Hub enabled.  When we asked to enable it, SalesForce said:

"Environment hub should be enabled in the org where the majority of your users have access, in many cases SFDC recommends the Partner Business Org or your CRM environment. We do not recommend enabling this feature in a test/demo org or a customer trial org.
You can also have this feature enabled in a DE org if you would like to provide your developers with the ability to spin up Test / Developer Edition orgs without access to your main business org. However we cannot enable this in an org that contains a managed package as it may cause issues when pushing an upgrade to your customer or creating new package versions."


I'm confused as to why they say that the hub is attached to a "DE org"... in the pdf it seems more like it attaches to a partner account as a requirement to let them manage multiple orgs.  They also say not to use it for a test/demo org... but the pdf describes using it to create your dev and test orgs.  Are there different object types that they are using the word "org" to reference?

Finally it says that they can't enable the hub on an org that contains a managed package...  the entire reason that I want the hub is that I need to create a managed package and that is what the pdf is telling me to do.

In short the response that we got from Salesforce seems to directly contradict their documentation and I am unsure as to how to proceed to create our managed package for AppExchange distribution.
 
Hi all,

Using page layout i have created a custom button for detail page, by default it will be placed top and bottom of the page,, what i am expecting is: want to be set the button on top of the page as like cancel, save, quiksave button. what can i do for that,,

can anybody clear it to me... 

Thanks in advance.
Hi, I would like to create a trigger on the ideas object to send an email to all voters/commentors on the particular ID, when a custom field (Idea_Status__c) is updated,    Any help would be awesome,  Here is what I have so far


trigger IdeaTrigger on Idea (after update) {
    
    Set<Id> ideaIds = trigger.newMap.keySet();
    
    Map<Id,List<User>> ideaUserMap = new Map<Id,List<User>>();
    
    for(Id i : ideaIds)
        ideaUserMap.put(i.Id,new List<User>());
    
    for(IdeaComment ic : [SELECT Id, CreatedBy.Id,IdeaId FROM IdeaComment WHERE IdeaId IN :ideaIds]){
        ideaUserMap.get(ic.IdeaId).add(ic.CreatedBy);
    }
    
    for(Vote iv : [SELECT Id, CreatedBy.Id, ParentId FROM Vote WHERE ParentId IN :ideaIds AND Type = 'Up']){
        ideaUserMap.get(iv.ParentId).add(ic.CreatedBy);
    }
    
    //create list of outbound emails
    Messaging.SingleEmailMessage[] messages = new Messaging.SingleEmailMessage[]{};
    
    for(Idea i : Trigger.new){
        
        //Need to check that the custom field has changed on the ideas object
        if(i.Idea_Status__c == oldMap.get(i).Idea_Status__c)
            continue;
        //"merge" fields into template
        String EmailSubject = i.Name;
        String EmailBody = 'Name:' + i.Name;
        emailBody += '\nIdea Id: ' + i.Id;
        //add the rest of the fields you want in the body.
    
        
    
        //for each user, create a template, set the text
        for(User u : ideaUserMap.get(i.Id)){
    
             Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
             email.setTargetObjectId(u.id);
             //email.setOrgWideEmailAddressId(BlackHoleOrgWide);
             email.setSubject(EmailSubject);
             email.setHtmlBody(EmailBody);
             messages.add(email);
        }
    
    }

    //send the list of messages
    Messaging.sendEmail(messages);
    
}
 
Hi,

Is there a way to access the trusted IP ranges through Apex and SOQL? I'm creating a visualforce application that checks if the user has specific Ip ranges set.

Thanks,
Andrew
Hi All,

I facing an issue that batch class is not updating records for large number of records.

Batch Class:

global class oppwithmarketing implements Database.Batchable<sObject>, Database.AllowsCallouts, Database.Stateful 
{
  global Map<string,Decimal> MrktSignals;
  global map<string,string>Dosierurl;
  global map<string,string>DosierSummaryurl;
  
  global final string query = 'select id, name, Marketing_Signal__c,dosierurl__c,dosiersummaryurl__c from opportunity';

  global Database.QueryLocator start(Database.BatchableContext BC) 
  {  
      Update_Records op = new Update_Records();
       op.OppData();
       MrktSignals =  op.MrktRatngMap.clone();
       system.debug('MrktSignals** '+MrktSignals );
       Dosierurl= op.dossierurlMap.clone();
       system.debug('Dosierurl** '+Dosierurl);
       DosierSummaryurl= op.dossierurlsummarymap.clone();
       system.debug('DosierSummaryurl** '+DosierSummaryurl);
    return Database.getQueryLocator(query);
  }

  global void execute(Database.BatchableContext BC, List<sObject> batch) 
  {    
     try
     {
       for(Sobject so :batch)
       {
           opportunity opp1 = (opportunity)so;      
           if(MrktSignals.containsKey(opp1.name) && MrktSignals.get(opp1.name) <> null){
              so.put('Marketing_Signal__c',MrktSignals.get(opp1.name));      
           }
           if(Dosierurl.containsKey(opp1.name) && Dosierurl.get(opp1.name) <> null){
          
              so.put('dosierurl__c',Dosierurl.get(opp1.name));      
           }
           if(DosierSummaryurl.containsKey(opp1.name) && DosierSummaryurl.get(opp1.name) <> null){
          
              so.put('dosiersummaryurl__c',DosierSummaryurl.get(opp1.name));      
           }
       }
         if (batch.size()>0)
         {
             Database.SaveResult[] list_save=Database.Update(batch, false);
         for (Database.SaveResult sr: list_save)
         {
             if (sr.isSuccess())
             {
                 system.debug( ' **** ' + sr.getId());
             }
             else
             {
                 for (Database.Error err: sr.getErrors())
                     system.debug(err.getStatusCode()+' **** '+err.getMessage()+ ' **** '+err.getFields());
                     //system.debug(sr.getStatusCode()+' **** '+sr.getMessage());
             }
         }
        }
     }
     catch(System.QueryException e)
     { 
         System.debug('System.QueryException on oppwithmarketing batch class ' + e);  
     }
  }

  global void finish(Database.BatchableContext BC) { 
      system.debug(LoggingLevel.WARN, 'Batch Job Complete');
  }
}

Developer Console:

Execute:
oppwithmarketing  b = new oppwithmarketing();
      database.executebatch(b);

Note: When I run the batch class 'oppwithmarketing' for 100 records, it works. But, for  500 or more records, it is not updating the records. Although, I am getting no error. 
i want to retrive record from contact object and showing that in vf page with checkboxes left to every record .
and after checking some checkboxes when i click submit button then it will show only cheked record and other will reomve .
how to do this functionality ?
 
I used the code that Jeff Douglas http://blog.jeffdouglas.com/2010/07/13/building-a-dynamic-search-page-in-visualforce/ wrote to create a case search but cannot get the test code to work. 

Here is the controller:
public with sharing class CaseSearchController {

  // the soql without the order and limit
  private String soql {get;set;}
  // the collection of cases to display
  public List<Case> cases {get;set;}

  // the current sort direction. defaults to asc
  public String sortDir {
    get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
    set;
  }

  // the current field to sort by. defaults to caseNumber
  public String sortField {
    get  { if (sortField == null) {sortField = 'caseNumber'; } return sortField;  }
    set;
  }

  // format the soql for display on the visualforce page
  public String debugSoql {
    get { return soql + ' order by ' + sortField + ' ' + sortDir + ' limit 40'; }
    set;
  }

  // init the controller and display some sample data when the page loads
  public CaseSearchController() {
    soql = 'select casenumber,Business_Unit__c , Site_Account__r.name, product_family__c from case where casenumber != null';
    runQuery();
  }

  // toggles the sorting of query from asc<-->desc
  public void toggleSort() {
    // simply toggle the direction
    sortDir = sortDir.equals('asc') ? 'desc' : 'asc';
    // run the query again
    runQuery();
  }

  // runs the actual query
  public void runQuery() {

    try {
      cases = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 40');
    } catch (Exception e) {
      ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));
    }

  }

  // runs the search with parameters passed via Javascript
  public PageReference runSearch() {

    String caseNumber = Apexpages.currentPage().getParameters().get('caseNumber');
    String bu = Apexpages.currentPage().getParameters().get('bu');
    String accountSite = Apexpages.currentPage().getParameters().get('accountSite');
    String productFamily = Apexpages.currentPage().getParameters().get('productFamily');

    soql = 'select CaseNumber, Business_Unit__c, Site_Account__r.name, product_family__c from case where casenumber != null';
    if (!caseNumber.equals(''))
      soql += ' and caseNumber LIKE \''+String.escapeSingleQuotes(caseNumber)+'%\'';
    if (!bu.equals(''))
      soql += ' and Business_Unit__c = \''+bu+'\'';
    if (!accountSite.equals(''))
      soql += ' and Site_Account__r.name LIKE \''+String.escapeSingleQuotes(accountSite)+'%\'';  
    if (!productFamily.equals(''))
      soql += ' and product_family__c = \''+productFamily+'\'';

    // run the query again
    runQuery();

    return null;
      }

  // use apex describe to build the picklist values
  public List<String> productfamilies {
    get {
      if (productfamilies == null) {

        productfamilies = new List<String>();
        Schema.DescribeFieldResult field = Case.product_family__c.getDescribe();

        for (Schema.PicklistEntry f : field.getPicklistValues())
          productfamilies.add(f.getLabel());

      }
      return productfamilies;          
    }
    set;
  }
  public List<String> businessunits {
    get {
      if (businessunits == null) {

        businessunits = new List<String>();
        Schema.DescribeFieldResult field = Case.Business_Unit__c.getDescribe();

        for (Schema.PicklistEntry f : field.getPicklistValues())
          businessunits.add(f.getLabel());

      }
      return businessunits;          
    }
    set;
  }
 }

Here is the page:
<apex:page controller="CaseSearchController" sidebar="false">

  <apex:form >
  <apex:pageMessages id="errors" />

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

  <table width="100%" border="0">
  <tr>  
    <td width="200" valign="top">

      <apex:pageBlock title="Parameters" mode="edit" id="criteria">

      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("caseNumber").value,
          document.getElementById("bu").options[document.getElementById("bu").selectedIndex].value,
          document.getElementById("accountSite").value,
          document.getElementById("productFamily").options[document.getElementById("productFamily").selectedIndex].value
          );
      }
      </script> 

      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors">
          <apex:param name="caseNumber" value="" />
          <apex:param name="bu" value="" />
          <apex:param name="accountSite" value="" />
          <apex:param name="productFamily" value="" />
      </apex:actionFunction>

      <table cellpadding="2" cellspacing="2">
      <tr>
        <td style="font-weight:bold;">Case Number<br/>
        <input type="text" id="caseNumber" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">BU<br/>
          <select id="bu" onchange="doSearch();">
            <option value=""></option>
            <apex:repeat value="{!businessunits}" var="bus">
              <option value="{!bus}">{!bus}</option>
            </apex:repeat>
          </select>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Site Account<br/>
        <input type="text" id="accountSite" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Product Family<br/>
          <select id="productFamily" onchange="doSearch();">
            <option value=""></option>
            <apex:repeat value="{!productfamilies}" var="prod">
              <option value="{!prod}">{!prod}</option>
            </apex:repeat>
          </select>
        </td>
      </tr>
      </table>

      </apex:pageBlock>

    </td>
    <td valign="top">

    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{!cases}" var="case">

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Case Number" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="caseNumber" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>                
            <apex:outputLink value="/{!Case.Id}" target="_blank">{!Case.casenumber}</apex:outputLink>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="BU" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Business_Unit__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!case.Business_Unit__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Site Account" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Site_Account__r.name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!case.Site_Account__r.name}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Product Family" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Product_Family__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!case.Product_Family__c}"/>
            </apex:column>

        </apex:pageBlockTable>

    </apex:pageBlock>

    </td>
  </tr>
      </table>

  <apex:pageBlock title="Debug - SOQL" id="debug">
      <apex:outputText value="{!debugSoql}" />           
  </apex:pageBlock>   

  </apex:pageBlock>

  </apex:form>

</apex:page>

Here is the test code that I am trying to use, the error is "Error: Compile Error: Variable does not exist: sources at line 25 column 15" and the line it is referring to is "testSources = controller.sources;"
@isTest 

private class theCaseSearchController { 
static testMethod void testSearchController() { 

//instantiate a page      

PageReference pg = Page.Case_Search_auto; 
Test.setCurrentPage(pg); 
pg.getParameters().put('caseNumber', '999999'); 
pg.getParameters().put('bu', 'test MC'); 
pg.getParameters().put('accountSite', 'test acct site'); 
pg.getParameters().put('productFamily', 'test prod family'); 

// instantiate the controller 

CaseSearchController controller=new CaseSearchController(); 
System.assert(controller.runSearch() == null); 
String testDebugSoql = controller.debugSoql; 

controller.toggleSort(); 
System.assertequals (controller.sortDir, 'desc'); 

List<String> testSources = new List<String>(); 
testSources = controller.sources; 
System.assertequals (testSources[0], 'vesta');

//to test the catch clause we need to make the query fail 
 

controller.sortField = 'badfield'; 
controller.runQuery(); 
}
}
Any help is greatly apprechiated!!
Thanks, Linda

 
I get the following error while trying to delete an account:

"Your attempt to delete (Name of Account) could not be completed because it is associated with the following accounts. If the following table is empty, it is because you do not have access to the records restricting the delete."

And the table shows only 1 record, that record is the account I tried to delete (verified by ID).

The account is not associated to itself in any way with a custom lookup or elsewhere. I'm not sure what could be causing this I'm using an Admin user with all of the delete permissions you would normally need.
We have a requirement to post wishes every year on Chatter for the users records
in our community. Our organisation have more than 350,000 employees, so on a minimum basis, we might have about 2000 posts everyday. So can anyone suggest an app or a way to go ahead with this requirement. 

I was thinking if we can run a batch process or have some appexchange tools to get the job done. Can anyone suggest some apps that are very helpful?

Hi All

     I want to retrieve Magento Orders/Customers into salesforce. How can i make a call  to magento through apex to retrieve,
1. I want to retrieve AccessToken and Token Secret (Also)
2. Retrieve customers/orders
          presently my role is Admin in magento and, am created user and consumerkey and consumerSecret keys

          Right now i am testing Authendication by using Oauth Play ground in test Sandbox. But it is displaying error like

<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.6.0</center>
</body>
</html>

if any one having code(In APEX), then please share with me

Thanks in Advance, I would appriciate for any kind of replay

WE are looking to integrate Salesforce.com with our Oracle Ebiz systems using Oracle SOA BPEL process.  We will not be using the Salesforce Adapter.  

The Steps with BPEL is to log in then get the session ID and URL

When logging in we need the user name and password

Is there a way that we can have the username and password encrypted?

How can I go about doing that in BPEL

thank you
I have to say, I do not consider the new online version of the Apex manual an improvement.  I'm finding it much are to look things up than in the old more book-like version with the Index and Search.  Yes, I know there's a PDF but find then it's too bulk.

Also te scrolling area on the left is only a couple lines.

At least in the version of Firefox I'm suing ESR 31.6.0 the rendering is all messed up with text on top of it.

For a learning manual, the new manual might be okay but it really isn't as efficient as the old one when you have to really quickly look up one little detail.
Hi All,
I am trying to include survey force application with our existing app and creating a manage package. After submitting the code for Force.com Security review I have received below error messages:

Frame Spoofing
==============
If a user supplied value is used to construct a frame within the page, it can lead to an attacker controlling what is rendered into the page.  By modifying the URL value to a malicious site, an attacker can successfully launch a phishing scam to attempt to steal user credentials.  Given the base domain is from an application they trust, they are more likely to believe the request as legitimate and provide the details requested.

Demonstrative Examples:
======================
In the example below, the developer is taking input from the user from the querystring and using that to load into an iframe on the page:

<apex:iframe src="{!$CurrentPage.parameters.iframesrc}"></apex:iframe>

With input provided from an attacker, the iframe will be rendered into the page with the host of the attackers choosing, such as the link below.

<iframe src="http://www.badguy.com/stealcreds.php" >

Potential Mitigations  
=====================
Frame spoofing can be mitigated by strongly validating the user input provided to your application.  In the case where

user input is needed to construct the parameters used in a frame, the developer should control the domain loaded

through a constant or white list if possible.  The example below shows a very simplistic method

<apex:iframe src="http://domainofchoice.com/page?{!$CurrentPage.parameters.iframesrc}"></apex:iframe>

===================================================================================================================
Issue in Classes

42. get //viewsharesurveycomponentcontroller.cls      
...
48. String urlPrefix = setupUrlPrefix(surveySite);

163. private String setupUrlPrefix(String site) //viewsharesurveycomponentcontroller.cls       
...

167. return site+'/';

42. get //viewsharesurveycomponentcontroller.cls

48. String urlPrefix = setupUrlPrefix(surveySite);
...

50. String urlToSave= domain+'/'+urlPrefix+'TakeSurvey?';
...
55. return urlToSave;
41. <apex:iframe src="!surveyURLBase + surveyURL}" scrolling="True" /> //viewsharesurveycomponent.component

63. public viewShareSurveyComponentController() //viewsharesurveycomponentcontroller.cls      
...
66. urlType.add(new SelectOption('Email Link w/ Contact Merge',System.Label.LABS_SF_Email_Link_w_Contact_Merge));
41. <apex:iframe src="!surveyURLBase + surveyURL}" scrolling="True" /> //viewsharesurveycomponent.component      
42. get //viewsharesurveycomponentcontroller.cls      
...
48. String urlPrefix = setupUrlPrefix(surveySite);
163. private String setupUrlPrefix(String site) //viewsharesurveycomponentcontroller.cls      
167. return site+'/';
...
42. get //viewsharesurveycomponentcontroller.cls
...
48. String urlPrefix = setupUrlPrefix(surveySite);      
...
50. String urlToSave= domain+'/'+urlPrefix+'TakeSurvey?';
...
55. return urlToSave;

41. <apex:iframe src="!surveyURLBase + surveyURL}" scrolling="True" /> //viewsharesurveycomponent.component

Any Idea ??
Hi All,
i want  to create dynamic tab in visualforce. Under each tab i should have data table and apex:inputFile. The tab, datat table should have custom style.
how to achieve this? 

Visualforce:
<apex:dynamicComponent componentValue="{!myTabs}"/>

apex:

public Component.Apex.TabPanel getMyTabs()
{
//create parent panel
Component.Apex.TabPanel myTabPanel = new Component.Apex.TabPanel();
for (integer i=0;i<3;i++) //just a sample, this could easily be a SOQL loop
{
Component.Apex.Tab myTab = new Component.Apex.Tab();
myTab.Label = 'Tab ' + string.valueOf(i+1);
 //add child tabs to the parent myTabPanel.childComponents.add(myTab);
}
return myTabPanel;
}
Hi, I have a requirement like this. 
I can send the sms from my phone.I want to capture this sms into salesforce and i will create task based on sms.
With out using app exchange tools. Thanks in Advance...
hi all,

i am trying to execute upsert call from enterprise wsdl via SOAP UI tool
below is my soap request.

Problem: i am unable to specify the object type.
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:enterprise.soap.sforce.com" 
xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
     
      <urn:SessionHeader>
         <urn:sessionId>XXXXXXXXXXXXXXX</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:upsert>
         <urn:externalIDFieldName>Product_Id__c</urn:externalIDFieldName>
         <!--Zero or more repetitions:-->
         <urn:sObjects urn:type="Product__c">
            <!--Zero or more repetitions:-->
          <Product_Id__c>456721</Product_Id__c>
          <Name>My test</Name>
          <Product_Brand__c>HIGHLAND PARK</Product_Brand__c>
         </urn:sObjects>
      </urn:upsert>
   </soapenv:Body>
</soapenv:Envelope>
When i run this request i get the below response
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>sf:INVALID_TYPE</faultcode>
         <faultstring>INVALID_TYPE: Must send a concrete entity type.</faultstring>
         <detail>
            <sf:InvalidSObjectFault xsi:type="sf:InvalidSObjectFault">
               <sf:exceptionCode>INVALID_TYPE</sf:exceptionCode>
               <sf:exceptionMessage>Must send a concrete entity type.</sf:exceptionMessage>
               <sf:row>-1</sf:row>
               <sf:column>-1</sf:column>
            </sf:InvalidSObjectFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
i then added the namespace to my request 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 and the upsert was successfull.Is this a correct way to add the namespace explicitly?
If i send such a wsdl to third party it would eventually fail 
hi all,

I would like to know the procedure of how to register for develoepr  summer maintenance exam.
i logged in to my developer account and followed the path
Register for a new exam--->developer exam--->
however i am unable to proced further as i get a pop up saying that you have already passed this exam.But i have only passed the Spring exam and i now i want to give my summer release exam


Someone please help

 
My company has the self-service portal activated.
Under Setup >> App Setup >> Customize >> Self Service, there are three entries:
Public Solutions
Web-to-Case
Self-Service Portal

However, in my dev sanbox, I see only the first two options, and I cannot find a way to enable the Self-Service portal.  Every document or post that I've found that tells how to do this seems dated - the options suggested are not there or don't work.  I feel I must be missing something simple, but I cannot find it. 

I need to activate this to test changes in our company web site that exposes the Salesforce self-service portal to our customers.
Hello,
I have a complete website coded and designed including all pages and a login page. I am having trouble figuring out how to "mesh" this into Salesforce as a community. I have investigated both Site.com and Force.com options. From Site.com I've imported my zip file, but the output was quite messy. A few questions I have are:

- Where do I upload the website assets so I can call them in my visualforce pages?
- How would I use our login page to align with Salesforce's login credentials as a Community User?
- How do I implement a dynamic "leaderboard" from a custom object?

I have very basic level knowledge of Java, but am very familiar with SQL and HTML.

Any help is much appreciated! Thanks!
Hi,

I am having a following requirement for which i need help,

1) I am having a text box (comments) and followed by a button in my visualforce page

2) when i enter the value in the comments and click on the button a new case has to be created and the comments that i have entered should be mapped to the case and case subject is to be "Lead override" 



My controller :

public class AF_ScriptController {
  
    public String status {get;set;}
    public Lead_Object__c obj {get; set; }
 
   /**
   ** Constructor
   **/
   public AF_ScriptController (ApexPages.StandardController controller) {
 
      String newId = ApexPages.currentPage().getParameters().get('leadId');
      System.debug ('new Id *** :' + newId);

      if (newId != '') {
         obj = [Select Id,Lead_Override_Comments__c,First_Name__c,Last_Name__c,Dealer_Type__c,Products_Dealership__c,F_I_Manager__c,Contracts_Electronically__c,Dealer_Track_RouteOne__c,What_percent_of_inventory_has_a_selling__c,What_percent_of_your_inventory_has_less__c,What_percent_of_your_inventory_is_newer__c,How_many_front_line_ready_units_do_you_c__c,What_are_your_average_monthly_used_vehic__c,Service_Department_on_site__c,Dealership_Retail__c,Dealership_Permanent_Building__c,Dealership_Payed__c,How_many_years_have_you_been_in_business__c,Leadstatus__c, test__c, salutation__c  from Lead_Object__c where id = :newId limit 1];
        
         if (obj.LeadStatus__c == 'Qualified' ) {
            System.debug ('Qualified *** : ' + status);
            status = System.Label.AF_QualifiedScript;
         }
         else {
            status = System.Label.AF_UnqualifiedScript;
            System.debug ('UnQualified *** :' + status);
         }
        
      }

   }

}



Please help me how to do this

Thanks in Advance

To an expert developer in SFDC:

1. Does SalesForce to SalesForce really suppot auto publishing and subscription of data records from source org to target org as described in documentation? Or any coding realy needed besides configuring connection? My interest and need is for one parner to publish bunch of core objects like contacts and accounts and another partner org to auto consume without manual intervention

2. Once initial volume of data is published and consumed by target, will changes on those records in source automatically flow to target

3. Any known issues or limitations with salesforce to salesforce? 

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.