• Sravs
  • NEWBIE
  • 65 Points
  • Member since 2012
  • Salesforce Consultant
  • http://dmgt.com/


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 22
    Replies
Hi Everybody,
           Can anyone tell me how to get the group   Id based on user logged in 


Thanks in advance
Karthick
HI guys im trying to create a forumla on a VP page that shows an image based on a date

value="{!If(Account.LatestCompaintDate__c = System.now().addMonths(-6), $Resource.xxx,"")}"

but for some reason i get a missing ')' error

any help would be great!
Hi,

What is standardset controller and where we use standardset controller?

Regards,

Anil Kumar
HI I am trying to create a visual force email template to pass the brnach details of an rfi object when created. I am missing something in the code . The object is RFI__c and the field is Branch__c. The line of code I am using is:
Branch: {RFI__c.Branch__c}
However I am not gtetting anything resturned, Am I missing somethiing in the syntax?
Thanks in advance

trigger fieldupdate on Contact (before insert, before update) {
     for(Contact c : Trigger.new){
    Account val = [SELECT Acc_Cost__c from Account where Id=:c.AccountId];
    val.Acc_Cost__c +=c.Cost__c;
    upsert val;
    }
I want to hyperlink as "Back" on PDF to navigate Page to Case list view page -

<div align="right" >
     <b><apex:commandLink target="_blank" action="{!cancel}"  value="Back " id="theCommandLink" /></b>
 </div>

User-added image

It is not working. please assist on this.

Thanks for support !!!!!!!!!!!
/Rohit Sharma
trigger LeadConvert on Lead (before update)
{
    for(Lead l : Trigger.New)
    {
    
     if (trigger.old[0].isConverted == false && trigger.new[0].isConverted == true)
     {    
         if (Trigger.new[0].ConvertedContactId != null)
         {
    Contact contCk = [Select Id, Name From Contact Where Id =: l.ConvertedContactId];
             contCk.LastName = l.Name;
             update contCk;
         }
            if (Trigger.new[1].ConvertedContactId != null)
         {
    Contact contCk = [Select Id, Name From Contact Where Id =: l.ConvertedContactId];
             contCk.LastName = l.Name;
             update contCk;
         }
            if (Trigger.new[2].ConvertedContactId != null)
         {
    Contact contCk = [Select Id, Name From Contact Where Id =: l.ConvertedContactId];
             contCk.LastName = l.Name;
             update contCk;
         }
            if (Trigger.new[3].ConvertedContactId != null)
         {
    Contact contCk = [Select Id, Name From Contact Where Id =: l.ConvertedContactId];
             contCk.LastName = l.Name;
             update contCk;
         }
            if (Trigger.new[4].ConvertedContactId != null)
         {
    Contact contCk = [Select Id, Name From Contact Where Id =: l.ConvertedContactId];
             contCk.LastName = l.Name;
             update contCk;
         }
         if (Trigger.new[0].ConvertedAccountId != null)
         {
             Account accCk = [Select Id, Name From Account Where Id =: l.ConvertedAccountId];
             accCk.Name = l.Name;
             update accCk;               
         }
         if (Trigger.new[0].ConvertedOpportunityId != null)
         {
          Opportunity oppCk = [Select Id, Name From Opportunity Where Id =: l.ConvertedOpportunityId];
             oppCk.Name = l.Name;
             update oppCk;
         }
     }
}
}
This shows 
Error: System.DmlException: Update failed. First exception on row 0 with id 00Q9000000TNp8GEAT; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LeadConvert: execution of BeforeUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 003900000158pD8AAI; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Last Name]: [Last Name] Trigger.LeadConvert: line 12, column 1: [] (System Code)
Hello everybody,

I would like to run a report (Matrix report with lookup and formula fields) from Apex with the code below:

// Get the report ID
List <Report> reportList = [SELECT Id,DeveloperName FROM Report where 
    DeveloperName = 'My_custom_report'];
String reportId = (String)reportList.get(0).get('Id');

// Run a report synchronously
Reports.reportResults results = Reports.ReportManager.runReport(reportId);

The following exception is thrown:

reports.MetadataException: Can't run the report because it doesn't have any columns selected. Be sure to add fields as columns to the report through the user interface.

Can somebody explain me what the problem is?

Cheers
Hi Everybody,
           Can anyone tell me how to get the group   Id based on user logged in 


Thanks in advance
Karthick
HI guys im trying to create a forumla on a VP page that shows an image based on a date

value="{!If(Account.LatestCompaintDate__c = System.now().addMonths(-6), $Resource.xxx,"")}"

but for some reason i get a missing ')' error

any help would be great!
Hi folks,
Can anyone tell me what is profile and permission set and what is difference between profile and permission set

Thanks in advance
Karthick
I have a set of accounts. I want to get last modified opportunity from each account. Is it possible to get in single query?
Hi All,
   I am sending a mail by using "Messaging.SingleEmailMessage" entity. I want to a task to be created and available under "Activity History" section of any entity.

Thanks in advance.


When I click on a row in a table it should retrieve particular fields of a particular coloumn in below table.

<apex:page controller="prac1">
    <apex:pageBlock title="Multiple Search and Split">
            <table cellpadding="3px" cellspacing="4px" >
                <tr height="20px">
                    <apex:form >
                    <td style="vertical-align:middle;">
                    Search by </td> <td style="vertical-align:middle;">
                 <apex:selectList size="1">
                <apex:selectOption itemValue="Serial" itemLabel="Serial Number"/>
                <apex:selectOption itemValue="Oppo" itemLabel="Opportunity"/>
                <apex:selectOption itemValue="EUC" itemLabel="End User Company"/>
            </apex:selectList>
                </td>
                <td style="vertical-align:middle;">
            <apex:inputTextarea style="overflow-y:scroll; resize:none; min-height:30px; max-height:30px; min-width:250px; max-width:250px" value="{!searchstring}"/> </td>  
            <td style="vertical-align:middle;">    <apex:commandButton value="Search" action="{!search}"/> </td>  
           <td style="vertical-align:middle;">    <apex:commandButton value="Split"/></td>  
           <td style="vertical-align:middle;">    <apex:commandButton value="Consolidate"/></td>  
           <td style="vertical-align:middle;">    <apex:commandButton value="Unconsolidate"/> </td>  
           <td style="vertical-align:middle;">    <apex:commandButton value="Export"/> </td>  
                    <td style="vertical-align:middle;">    <apex:commandButton value="Export Asset"/> </td>
                    </apex:form>
                </tr>
                </table>
         <apex:pageBlockTable value="{!acc}" var="a" cellpadding="10px" width="100%">
         <apex:column >
         <apex:facet name="header">Name</apex:facet>
         <apex:outputlink value="https://ap1.salesforce.com/{!a.id}">{!a.Name} </apex:outputlink>
         </apex:column>
         <apex:column >
                <apex:facet name="header">Opportunity id</apex:facet>
                        {!a.id}
         </apex:column>
     <apex:column >
                 <apex:column >
                <apex:facet name="header">Amount</apex:facet>
                        {!a.amount}
         </apex:column>
       <apex:actionSupport event="onRowClick" reRender="" action="{!click}">
        <apex:param name="cId" value="{!a.Name}" assignTo="{!myStringValue}"/>
      </apex:actionSupport>
    </apex:pageBlockTable>   
       <apex:pageBlockTable id="sa" value="{!ass}" var="b" rendered="true">
            <apex:column value="{!b.asset1__c}"/>
              </apex:pageBlockTable>
           </apex:pageBlock>
</apex:page>

And the controller is

public with sharing class prac1 {
   public list <opportunity> acc {get;set;}
   public list <Asset> ass {get;set;}
   public string searchstring {get;set;}
   public string myStringValue {get;set;}

public prac1()
   {
   }

public void search()
{
     string searchquery='select name, Id, Amount, CloseDate, StageName from Opportunity where name like \''+searchstring+'%\' Limit 20';
     acc= Database.query(searchquery);
}
public void click()
  {
   string squery='select name, asset1__c, asset2 from Asset__c where name like \''+myStringValue+'%\' Limit 20';
        ass= Database.query(squery);
  } 
}

And in this Opportunity is a standard object and Asset is a custom object..
I have a scenario, where I need to insert data into Lead object using Data Loader by checking for the duplicates based on the Email field. Inserting data and preventing duplicate fields has been done with import wizard.

But here, while importing data into Lead we also need to save all the rejected/duplicate records into a Custom Object. I have created a before Insert trigger to prevent duplicates and to save the records into Custom Object. But, custom Object records are not populated.
Any suggestions, where  I am going wrong.

trigger findduplicates on Lead (before insert) {
Map<String, Lead> leadMap = new Map<String, Lead>();
  List<Duplicate_Lead__c> dups = new List<Duplicate_Lead__c>();
    for (Lead lead : System.Trigger.new) {
       
        // Make sure we don't treat an email address that 
        // isn't changing during an update as a duplicate. 
   
        if ((lead.Email != null) &&
                (System.Trigger.isInsert ||
                (lead.Email !=
                    System.Trigger.oldMap.get(lead.Id).Email))) {
       
            // Make sure another new lead isn't also a duplicate 
   
            if (leadMap.containsKey(lead.Email)) {
              lead.Email.addError('Another new lead has the same email address.');
                  system.debug('Another new lead has the same email address.');
                 
       Duplicate_Lead__c dup= new Duplicate_Lead__c ();
       dup.First_Name__c = lead.FirstName;
       dup.Last_Name__c = lead.LastName;
       dup.Email__c = lead.Email;      
      
       dups.add(dup);                
 
                                                    
      }else{
                leadMap.put(lead.Email, lead);
            }
       }
     
    }
     insert dups;
}

Thanks in Advance