• NILESH RAJ 20
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 26
    Replies
I Have Object : Country__c  With Fields: Name__c,Capital_City__c,Region__c,Sub_Region__c,
Regional_Block__c 
Country__c object  has records of various countries
And in Lead Object I have Fields Country_1__c,Region__c,Capital_City__c,Sub_Region__c,Regional_Block__c
Whenever we insert/update any country name in lead Country_1__c field which exist in Country__c(object) record field  Name__c
then populate all lead fields
trigger countryInfoUpdate on Lead (before insert, before update) {
 //List<Lead> lList = new List<Lead>();  
  Set<String> strSet = new Set<String>();
    for(Lead l : trigger.new){
    strSet.add(l.Country_1__c); 
    }
    List<Country__c> conList = [Select id,Name__c,Capital_City__c,Region__c,Sub_Region__c,
                                Regional_Block__c from Country__c Where Name__c in: strSet];
    map<String,Country__c>  conMap = new   map<String,Country__c>();
    for(Country__c c : conlist){
        conMap.put(c.Name__c, c);
    }
    for(Lead l : trigger.new){
        if(conMap.containsKey(l.Country_1__c)){
          l.Region__c = conmap.get(l.Country_1__c).Region__c;
          l.Capital_City__c = conmap.get(l.Country_1__c).Capital_City__c;
          l.Sub_Region__c = conmap.get(l.Country_1__c).Sub_Region__c;
          l.Regional_Block__c = conmap.get(l.Country_1__c).Regional_Block__c;
        }
    } 
}





 
Hi everyone,
Can anyone explain me why do we use batch class? Why do we use batch classess,In which scenario does the batch appear?
Thanks in Advance,
 
Apex class:
public class multiAddCEx {

    public multiAddCEx(ApexPages.StandardSetController controller) {

    }


    public multiAddCEx(ApexPages.StandardController controller) {

    }

List <Expense_Line_Item__c> CExList;
public Id cID = ApexPages.currentPage().getParameters().get('Id');
public Id getID {get; set;}
public PageReference reset()  {
CExList = [select name, Expense__c, Expense_Head__c, Amount__c, Date__c, Sub_Expense__c, Payment_Type__c, Cost_Head__c from Expense_Line_Item__c where Expense__c =: cID order by createddate limit 15 ];
return null; }
public List <Expense_Line_Item__c> getCExs() {
   if(CExList == null) reset();
   return CExList;}
public void setAccounts(List <Expense_Line_Item__c> cexs) {
   CExList = cexs;}
public PageReference save() {
upsert CExList;
ApexPages.Message myMsg = new ApexPages.message(ApexPages.Severity.Info, 'Records Saved Successfully');
return null;}
public PageReference add() {
CExList.add(New Expense_Line_Item__c(Expense__c= cID));
return null; }
}
Hi Folks,

Give me some tips for writing test class easily and give me some basic exmaples.

Regards
Ramakrishna
I have started using Salesforce in my new company but for now the use is very basic- feeding/pulling out customer database. I want to learn full-fledged Saelsfroce and excel in it, I am from non-developer/non-coding background. I have started learning the Salesforce Admin modules viaTrail Head.
It will be great if somebody can guide me since Salesforce is huge and I want to go step-by-step and learn each and every component of Salesforce applications. What could be the best way? What should I follow excatly?
Thank you
  • January 25, 2017
  • Like
  • 3
How to Display 15 Digit ID to 18 Digit ID in Sales force
What is meant by record type and why we use record type in salesforce can anyone explain with real time scenario
Adv Thanks.
why do we write batch class. Can some one give a real time example ?
I need programming interview questions for 3 years experience please help to face interview
Hi All
can you please share interview questions and different senarios which ask for experienced sfdc developers
 
I am new to salesforce developement, i am unable to understand importance of Test Classes. please any one help

Hello,

 

I feel pretty dumb asking all the bright minds on this forum this silly question but here goes. 

 

I can't figure out why some users get the option to choose a record type upon case creation while others go straight to the default. I know I'm missing something really basic. Any help would be greatly appreciated!

 

Thanks!

  • August 02, 2012
  • Like
  • 0

new here

 

i am only seeing the first 15 digits id of a record in the url when i choose 1 record. is there a way for me to see the whole 18 digits?

 

 

  • January 04, 2012
  • Like
  • 0

Simply put the following formula into a formula field of type "Text":

 

Id
& MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(
    IF(FIND(MID(Id,1,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0)
    +IF(FIND(MID(Id,2,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0)
    +IF(FIND(MID(Id,3,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0)
    +IF(FIND(MID(Id,4,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0)
    +IF(FIND(MID(Id,5,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0)
    )+1,1)
& MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(
    IF(FIND(MID(Id,6,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0)
    +IF(FIND(MID(Id,7,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0)
    +IF(FIND(MID(Id,8,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0)
    +IF(FIND(MID(Id,9,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0)
    +IF(FIND(MID(Id,10,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0)
    )+1,1)
& MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(
    IF(FIND(MID(Id,11,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0)
    +IF(FIND(MID(Id,12,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0)
    +IF(FIND(MID(Id,13,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0)
    +IF(FIND(MID(Id,14,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0)
    +IF(FIND(MID(Id,15,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0)
    )+1,1)

 

This is an optimized version of the code example "BPS: 18 digit external ID within the UI" you can find on the Online Help, but unlike the example provided there, it is small enough to fit into a formula field. Also, this code doesn't contain the error found in the online help example, where the second character byte equivalent of the first 5-character chunk was "4" instead of "2". I'd be more than happy if someone could come up with an even shorter version of this formula...Still, I hope you can use this.

 

Cheers,

Erik Mittmeyer

I'm trying to create a trigger that will allow me to auto-populate one field with the contents of another.  So, we want to create another account field for Account Owner, but we want it to have the current account owner to appear in the new field.  Unfortunately, it can't be done using a formula field. 

 

Please help!  I've never created a trigger before, so I have no clue where to start!

Hi all. I'm confused, and would welcome some help. In an activities-based report within salesforce.com, I use the Activity Id field to give the Id number.

I then export to Excel. Let's say the Excel spreadsheet contains only one Actitivity, Id is 00U20000001Rx6d

Later, we read back the spreadsheet with some changes. I build an SOSQL string like this:

SELECT Id,Outcome__c,TookPlace__c FROM Event WHERE ( Id='00U20000001Rx6d')

and I get one Event (the right one) back, which I read into a keyed dictionary. However, the Event object I read from the API has an Id of 00U20000001Rx6dEAC.

So why is it that the report gives 15-character Ids, and the API reports 18-character Ids on the same item? It makes it difficult to match them up. Is it always safe to reduce the 18-character Id to a 15-character one?

Yours,
Moray