function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
askask 

Auto populate text fields based on selecting a record from lookup field

Hi

 

I am very new to salesforce and apex programming...so needed some help...

I have created a custom object  with some text fields as Name,Address...etc and a lookup field .Now when I select a record or a value  from the lookup field I need the text fields to be filled automatically  ,based on which value is selected from lookup field.

 

Any help or guidance on this will be great !!!

Thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

Best advice I can give is to try to use all aspects of the system mentioned in the study guide - don't just read about them but actually configure the system in a dev org.

All Answers

bob_buzzardbob_buzzard

Do these have to be text fields - i.e. does the user need to be able to edit the values?  If not, you could use formula fields.  If you do need this you'll need to create a trigger that retrieves the lookup record values via a SOQL call and then writes that information into the custom object record.

 

This sounds like a before insert/update.  In the before update situation you'd only want to copy the information if the lookup value had changed.

askask

Thanks bob...

Actually I just need to retrieve the values of the record that is selected from lookup field.

Ex. I have a custom object A with lookup as one of its custom fields.Now in that lookup field (created a custom object) i have custom fields Name,Address and auto number as Serial no to lookup field records.

So when i choose a autonumber from the lookup field i want its Name,address values to be displayed..Hope i am clear with my problem...

 I have created the cross object formula fields for the lookup fields but i am unable to display its values(contents) in visualforce page...I dunno the code to display the values as i am a newbie and learning it now...

Please help

bob_buzzardbob_buzzard

You won't be able to display these values until the record is saved.  Formula fields are populated via the database, so it has to go round trip.

askask

Can you just give example of how to go about it...Formula fields example...

bob_buzzardbob_buzzard

If you are using a standard controller for 'My_Object__c' and your lookup field is called 'My_Lookup__c', you'd use:

 

<apex:outputField value="{!My_Object__c.My_Lookup__r.Name}"/>

 

However, this will not display any value until you save the record to the database and retrieve it afresh.

askask

I am stuck with this problem...How do i continue?Please give me the steps to proceed with this.

Please help

bob_buzzardbob_buzzard

You would save the record to the database, either through an insert (if new record) or update (if existing record) call.

 

 

askask

Actually I have created 3 records for the lookup field (i.e. for employee) but i am unable to display the field values for any of the record selected.

I have created a custom object named Company which has the custom fields Employee(this is the lookup field),Phone as another field.I have created 2 cross object formula fields(in relation to employee custom fields).

I have also created a new record for Company custom object.

Now in Employee custom object i have the fields employee name,job profile(2 text fields) and a standard field emp no(set to auto number).

How do i proceed with apex code now to display the fields on selecting a record from the lookup field.I used the formula field as you said and still its blank(no value displayed).

Please help me on this...

bob_buzzardbob_buzzard

Have these records been written to the database, or are you looking to display the values as soon as the user fill in the lookup field?

askask

I am looking to display the values as soon as the user fill in thre lookup field.

I have created new records for both Employee object as well as for Company object so i feel it is stored in the database...Correct me if i am wrong

 

bob_buzzardbob_buzzard

To do that you'll have to put an actionsupport on to the inputfield that the lookup comes from and do one of two things:

 

(1) retrieve the record that the lookup is pointing to and populate fields on the record being managed with the details from the lookup record.  You won't be able to do this with the formula fields though, as they are not writeable.

 

(2) save the record that is being managed and redirect to the current page,so that the details get pulled afresh from the database  - not the greatest user experience I'm afraid.

askask

How do i proceed?

bob_buzzardbob_buzzard

I don't have any code available to share I'm afraid - I'd have to write it from scratch.  

askask

 

 

all my records are saved and are written to database

 

can i pass the selected value of lookup field via url query to another VF page..If so how do i go about it?

bob_buzzardbob_buzzard

If you change the value of the lookup, you have to save the record to the database and query it again in order to be able to get at the formula fields.  There's no way round this - the formula field gets populated when the record is retrieved from the database.

 

If you want to update the values in real time, you'll need to use different fields on the sobject or use properties in the controller.  You'll need to put an action support on the lookup for the onchange event and have this submit the page back.  The action method that is invoked via the action support will then retrieve the information from the looked up record and populate the sobject fields/controller properties.

 

You can't use formula fields in this way as they are not writeable.

askask

ok.

I want to try using the onchange event on the lookup field.

Now when onchange event is executed(i.e. text box changed with value of lookup field) it must call a javascript code and write ajax call and from that javascript code i need to call the controller to populate the fields..Correct?If so can you provide any example on how to call the controller from javascript...

 

 

bob_buzzardbob_buzzard

The actionsupport component allows you to call an action method directly,  e.g

 

Page:

<apex:inputField value="{!obj.My_Field__c}">
   <apex:actionSupport event="onchange" action="{!MyMethod}"/>
</apex:inputField>

 This will invoke the MyMethod action method in the controller.  You can use the id from obj.My_Field__c to query the details of the record.

 

askask
I tried using the actionsupport tag.Now i am facing another problem how do i retrieve the values from the id to the text fields(inputfield or outputfield or outputlabel-which is better? i just need to read those values) back to the visualforce page.

 

Thanks a lot...Please help

bob_buzzardbob_buzzard

Presumably you are using an extension controller, if you are invoking your own action method?

 

That being the case, I'd suggest you just store an Employee__c property in your controller.

 

Something like:

 

Controller:

public class MyController
{
   public Employee__c emp {get; set;}
   private Company__c comp {get; set;}

   public MyController(ApexPages.StandardController std)
   {
       comp=std.getRecord();
       setupEmp();
   }
 
   private void setupEmp()
   {
       if (null!=comp.Employee__c)
       {
           emp=[select id, Empname__c from Employee__c where id = :comp.Employee__c];
       }
   }

   public PageReference MyMethod()
   {
      // comp.Employee__c will have been updated by the change to the lookup, so set up the employee record again
      setupEmp();
   }
}

 

Page:

 

<apex:outputField value="{!emp.Empname__c}"/>

 

askask

I tried your code but got some errors.It is also giving a nullpointer exception.

 

bob_buzzardbob_buzzard

I don't post code from existing projects that can be dropped straight in - I write this stuff off the top of my head to provide a starting point.

 

Cast the standard controller record to the correct type.

 

comp=(Company__c) std.getRecord();// here it tells Illegal assignment from SObject to SOBJECT:Company__

 

Add a return null to the end of the method, that will cause the page to be refreshed with the latest information.

 

askask

Thanks a lot BOB :)

I had an error i rectified it...now its working fine...thanks

 

Any idea how to use 2 custom objects(that has no relation i.e. master-detail or lookup) in the same visualforce page and link it to each other ?

Can we do something like that?

 

Thank you once again... :)

 

 

bob_buzzardbob_buzzard

How do you want to link them together if they have no relationship?  By the same token, how would you be able to determine which objects to display, or would the user choose in some way?

 

You can have as many unrelated objects as you like, as long has you have their ids you can execute SOQL and store the result in a property.

askask

Thanks bob :-) Your advice was very helpful.

I have another problem i.e.
i have created a pageblocktable and included few fields of a custom object in the first column and in second column i have checkboxes for all fields of the custom object.
now on selecting the checkbox i want the field value to be passed to next page so that i can make use of this value in the next page...how to do this?
any help or suggestion on this will be great!!!

please guide me...

bob_buzzardbob_buzzard

Is the next page using the same controller as the first page?

askask

Please tell me which is better?

bob_buzzardbob_buzzard

If you use the same controller, the same instance will be used across both the pages, so any data that has been entered can be retained in the controller.  If you use different controllers, you'll have to write back to the database and/or pass parameters on the URL.

askask

I am using different controllers for both the pages as i need to use another custom object in the next page.

So can you please tell me how do i proceed with different controllers?

bob_buzzardbob_buzzard

I'll need some more information I'm afraid - what are each of these pages doing in terms of capturing user information, writing to the database etc?

askask

the second page is doing partially both i.e. capturing user information from first page and for some other fields capturing from database.

 

 

bob_buzzardbob_buzzard

In that case you'd need to pass the information on the URL I think.  

askask

 

please help me...

bob_buzzardbob_buzzard

Apex:param can pass information back to the controller.  If you want to pass information between pages, you have to add parameters to the pagereference that is returned to the browser to send the user to the next page in the sequence.

 

The URL parameters are name=value pairs, thus you'd pass true/false, 0/1 or something along those lines to set the checkbox values.

askask


Is there any other way to pass the checkbox value

bob_buzzardbob_buzzard

In your controller you will need to determine which checkboxes have been filled in and pass those parameters as appropriate.  name=value pairs can contain any string values, although you may need to encode them to avoid spaces etc.

 

This is the only way to communicate between pages if you aren't using the same controller.

askask

 

 

please help...

bob_buzzardbob_buzzard

For each value that you need to pass between the controllers, you'll need to specify a name=value pair parameter. If it were me, I'd spend some time trying to use a single controller, as it gets a bit messy when you are trying to pass information from collections.

askask

Thanks bob...Was waiting for your reply...

If i use 2 different controllers then i need to  pass the IDs of the selected records as URL parameters, then parsing these values, then re-querying the object

Am i correct?How do i parse the values I have passed the whole object which stores the selected records?

 

 

Thanks a lot...

 

bob_buzzardbob_buzzard

You'll have to iterate your list of wrapper classes, and for each account add a parameter that contains the account number.

 

I don't think you'll be able to add multiple parameters with the same name like you can in regular HTML, so you'll need to have an Integer counter and then iterate the list of wrappers and add a param called something like 'AccountNumber' + the counter, giving 'AccountNumber0, AccountNumber1' etc.  Set the value of the parameter to the selected account number.

 

 

askask

I am not clear on how to add the counter to iterate the list of wrappers and add a parameter to it and set it.Can you provide any snippet code so that i can understand it better.

 

Thanks...

bob_buzzardbob_buzzard

In your save method, you'd have something like:

 

PageReference pr=Page.NextPage;
Integer idx=0;

for (AccountWrapper accWrap : accWraps)
{
   pr.getParameters.put('AccountNo' + idx, accWrap.Account.Account_Number__c);
   idx++;
}

 

bob_buzzardbob_buzzard

I'm a bit confused about the question you are asking here - isn't the code snippet that you have posted doing the calculation of the total?  What are you missing here?

askask
Thanks bob...Thankyou so much :) I was able to rectify my error and got the solution... Thanks...Your support was really helpful to me. As i am new to this field,can you give me some useful links on writing apex class. any materials/examples of apex class...Any thing to start with... Thanks a lot :) :) :)
bob_buzzardbob_buzzard

Glad to hear you got there.

 

There's a number of resources out there - the cookbook and wiki on developerforce, the apex developer's guide.

 

There's also my blog: http://bobbuzzard.blogspot.com/

bob_buzzardbob_buzzard

Do you really need the autonumber, or are you looking for the actual Salesforce id of the newly inserted record?  You can get at that very easily, as it will be populated on the record once it is inserted:

 

 if(detail.get('ID') == null)  insert detail;
 else update detail;

 Id=detail.id;

  // if you need any other information for the record, simply query it back here

 

bob_buzzardbob_buzzard

That sounds like you don't have an id present, or the id doesn't match an existing object.

bob_buzzardbob_buzzard

What you are doing sounds correct - I'd say you need some debug in the controller to check that you have pulled the value correctly from the URL, and that you are able to retreive the record detail from the database correctly.

bob_buzzardbob_buzzard

In the "next page", what record are you using the back the input fields etc?  Is it the one that you have created server side, or are you relying on a standard controller?

bob_buzzardbob_buzzard

Have you instantiated a new instance of the object being managed in your first page?

askask

No...

Currently i have used only standard controller=my_obj__c and not used any extension or custom controller in my second page.

bob_buzzardbob_buzzard

No, you can get at the fields using the standard controller.

 

As you are getting null pointer exceptions, its better if you post your code rather than me post ideas - can you do that for the first page and controller.

bob_buzzardbob_buzzard

You can't store a list in a Salesforce record, you'd need to create another custom object and instantiate an instance of that for each entry in the list.  Then you'd create a lookup to the parent record.

askask

I have created another object but i am unable to instantiate an instance of that for each entry in the list.  

Can you give me any snippet code on how to do that.Please...

Apart from storing the list of objects,how do i update my other fields i.e. detail.Total_rate__c  and others...Its not getting updated.Please help me on this...

 

bob_buzzardbob_buzzard

It doesn't look to me that you have assigned the "detail" property to an instance of a record.  You have declared it, and then the next use is to attempt to assign some values to it.  Somewhere in between you need to query back the record detail in question.

 

 

bob_buzzardbob_buzzard

The disconnect here is that you don't have a record instance tied to the detail property.  Thus when you try to set a field value, you get a null pointer exception.  Is the idea that the user is accessing an existing record?  if so, you need to pull those record details back via a query and allow them to be changed.  Otherwise the database can't know which record you want to apply the changes to.

askask

Please help me...Thanks

bob_buzzardbob_buzzard

The thing is, you have stored the results in a list and then tried to apply the update to an unrelated property named detail.  You should probably set detail to the first element of the list and then you will be updating the record that you have queried back.

 

I can't write the code for you I'm afraid - I have a day job doing that and I charge quite a lot of money :)

 

askask

Can you just help me with how to set detail to first element of list and initating an instance...Any link or snippet code to proceed with my code...

 

Thankyou for your help...

bob_buzzardbob_buzzard

Assuming detail and the list are the same type, its just:

 

date=myList[0];

 

To instantiate an instance of an object (e.g. myobject) you'd use:

 

MyObject__c myObj=new MyObject__c();

askask

 

 I have followed the steps below and did the some changes in controller


create an instance of the object.
query the fields of the object.
iterate the list and assign the field name to the variable.
assign the new value of variable to the field queried.

update the list

 


Still it does'nt gets updated.What changes am i supposed to do?

 

 

bob_buzzardbob_buzzard

A couple of things stand out for me:

 

(1) Why are you updating Lst?  All you have done is iterate this, you haven't applied any changes

(2) You are not updating an existing instance of RentDetail as you are creating a new one via the line:

 

Rentdetails__c detail=new Rentdetails__c();

If you want to update an existing instance you have to query it back from the database and assign it to the detail property.

bob_buzzardbob_buzzard

That isn't quite the code you posted above though - for example you weren't updating the entries from the list as you iterated them, but you are now.

 

In this section:

 

if(detail.id == idnew){
update detail; 

You will be trying to update a record instance that you haven't associated with any record from the database, so I would expect the update to fail.  

askask

Oh sorry i had pasted the wrong code before...

   public PageReference printpage(){
if(detail.id == idnew){    // i mean if the id matches with the current id then do the following
detail.Total_Rate__c=invoiceAmount;  //save this value in this field
update detail;   //overall update the id
}

 

Am i doing wrong..If so how do i correct it?

bob_buzzardbob_buzzard

The problem is that detail is always a newly backed record - you instantiate it in the controller, and then set various fields on it.  If you wanted to update an existing record, you would need to extract the details from the database first.  Then you would be able to update it.

bob_buzzardbob_buzzard

That sounds like the id isn't of the correct type for the controller.  If you retrieve the record for that id via the standard UI, is it an instance of obj2 or obj1?

askask

The id is a record detail of obj1.

I want to retrieve this id from the url and query it and assign the fields of obj1 to fields of obj2 as i have shown in my code.

What changes should i do?

 

bob_buzzardbob_buzzard

For a start, you can't pass the id of an obj1 sobject and use the standard controller for obj2.  Do you need to apply the field values to a specific instance of an obj2?

askask

Yes i need to use the field values of Obj2__c.

 i am using in 1st page as 
  <apex:page standardcontroller="Obj1__c" extensions="obj1controller">

in obj1controller

public pageReference{
   PageReference page = new PageReference('/apex/page2?id='+idnew);
         page.setRedirect(true);
         return page;
}




in 2nd page
<apex:page standardcontroller="Obj2__c" extensions="Mycontroller1">
               <apex:outputField value="{!Obj2_c.New_ID__c}"/>

Mycontroller1

Obj2__c detail;
public Mycontroller1 (ApexPages.StandardController controller){
    String idvalue = ApexPages.currentPage().getParameters().get('id');

        detail = (Obj2__c)controller.getRecord();
         detail.New_ID__c = idvalue;
         

    }

 
i need to get the id (tried with salesforce 15 digit id and autonumber standard field id but same error with both)
and need to display the id in 2nd page by linking it to Obj2__c field New_ID__c.
The id is getting passed from 1st page but i am unable to display in second page.Where am i going wrong?

bob_buzzardbob_buzzard

You are going wrong by passing the id of an obj1 record and trying to use it as an obj2 record.  You need to pass an id of the correct type.  It sounds like you are passing the id fo the record being managed from page 1 rather than the lookup to obj2.

askask

I am using obj1 record detail id and passing that to page2 that contains obj2,and in this page i am querying all the fields of obj1 by using the id passed in url and then assigning these fields to obj2 fields.

Can this be done in any other approach?

bob_buzzardbob_buzzard

Here's a blog post that shows how to pass parameters.  Like I've said before, I think you are using the correct technique but you are passing the wrong data (incompatible ids).

 

http://www.forcetree.com/2009/06/passing-parameters-to-visualforce-page.html

 

Reports in salesforce can take a custom date range, so you can definitely do that.

askask

I tried passing the autonumber id to next page so that i can query using this id to get all other fields but the problem is still there.Really clueless where am i going wrong.Can you show how to do this...so that i can atleast pass a field value instead of salesforce id.

 

Can you give me any link  or procedure on creation of custom reports for date ranges.

Am i supposed to create by clicking Setup | Create | Report Types

 

bob_buzzardbob_buzzard

I doubt it will make any difference which sort of data you pass, the underlying problem appears to be that you are trying to use an obj1 on on obj2 page.  The mechanism works fine for salesforce ids, you just need to pass the correct one across.  

Look in the Salesforce help for custom report types - there's plenty of information in there.

askask

Actually i need to get some data from 1st page and send those data via mail on entering mail id .Is it possible to send mail/sms?If so,how do i do that?Should i create an object named Email with subject,body and other info.

So when i mail it ,does it save as a record detail or will it be mailed...Completely no idea on mailing in salesforce.

 

Also how do i store my list of selected records of one custom object into another custom object?

 

In reports, i am not refering to filter,groupings that are provided in custom reports...

Is there anything such as a calendar planner so that at a glance i can see a booking in report with  start and  end date and implement the same in dashboard.

 

Please help me out with my issues...Any links or suggestions on how to go about it

 

 

 

bob_buzzardbob_buzzard

You might want to look at workflow for sending email - that way you can configure it declaritively rather than writing code.  Nothing gets saved as part of a mail unless you send it via the button on the record detail page.

 

You can't store lists in sobjects - you'd have to create a relationship between them.

 

I don't understand why filters wouldn't give you what you want in a custom report.

 

bob_buzzardbob_buzzard

I wrote a blog post over the weekend regarding pulling information from a related object as soon as the relationship field is filled in, which I recall was the original question on this thread.  Hopefully this will be of use if you find yourself in that situation again:

 

http://bobbuzzard.blogspot.com/2011/11/retrieve-related-object-fields.html

 

 

askask

Went through your blog...Quite good :)

 

Needed small help in storing selected records in sobjects -you said that its possible by creating a relationship between them.

 public PageReference getSelected()
    {
        selectedval.clear();
        for(newwrapper accwrapper : recList)
        if(accwrapper.selected == true)
        selectedval.add(accwrapper.acc);
        return null;
            
    }

 Above code shows the wrapper class that stores the selected records.Now how do i store them into a record detail?How do i create a relationship that stores only these selected records and displays these records when its record detail is accessed?

 

Also i went through the workflow but in that they have used standard objects.I want to use custom objects and send e mail from VF page.

Went through this link http://www.forcetree.com/2009/07/sending-email-from-your-apex-class.html.Here what exactly is the template id? can this be used with custom objects? Do you have any other link regarding sending mail using VF page?

 

Please help ...

bob_buzzardbob_buzzard

The relationship that I am referring to to is standard salesforce - the child records would have a lookup or master detail relationship to the parent record.  When you save the record that you are managing, you would need to iterate each of the selected records and fill in their lookup/master detail field with the id of the parent record.  Then when you access the parent record through the standard UI, the child records will be displayed in a related list.

 

The template id is the id of the email template that you are looking to use.  These can apply to standard or custom objects.

 

Here's another link on using email templates from apex, courtesy of my fellow MVP Wes Nolte:

 

http://th3silverlining.com/2010/05/08/using-basic-email-templates-within-apex/

askask

Please help...Any idea how do i proceed...

bob_buzzardbob_buzzard

You need to give some information about what error you are seeing - its quite difficult to suggest help with a drip feed like this.

 

Looking at your code, in this section:

 

 for(Tax__c o:SelectedTax){

     Charges__c=o.name;

    }

 The compiler has no idea what Charges__c is - you'll need to prepend it with the object in question - 'o' in this case.

 

 

With regard to the email template stuff, you should raise that in a separate thread.  Its likely nobody else is reading this because of the length of the thread.

bob_buzzardbob_buzzard

You don't store the list of selected records into a field (haven't we covered this before?).

 

Each of the selected records has a lookup relationship to the parent object - this is the field that gets filled in for each selected record.

askask

Yes i remember that.

I tried using lookup as well as master detail relationship.In both only the first selected record gets stored.

Am i missing something?

Did you mean we need to create a lookup relation for  "each " selected record so that each lookup relation shows the details of that particular record selected?

I even tried with long text area.Here too only the first record gets stored.

I just want the selected record ( containing Tax name and Rate) to be saved.Is there any other approach?

 

bob_buzzardbob_buzzard

Lets revisit this in baby steps:

 

You have an object A, which you want to relate a number of object B records to - is that correct?

askask

 :)

Yes correct..

I just want to store those Obj B selected records(all) in Obj A

bob_buzzardbob_buzzard

So in that case you need a lookup relationship on object B that points to an object A.

 

Then when you are associating a number of object B records to an object A record, you would traverse all the selected records and set the object B relationship field to the id of the object A record.

 

If you are only able to create one association, that sounds like you have the relationship on the wrong sobject (i.e. you have it on object A).

askask

Ok. Now i have created a field Example__c that has a lookup relationship on Object B  (the one used to create records that will be selected in future) that refers to Object A .

Am i correct now?

 

how do i set this field ( Example__c of Object B) to the id of Object A ?

 

    for(ObjB o:SelectedRecords){
    o.Example__c = o.id;     

     }
  

After this how do i set it?Should i create a field in Object A and link this field to that?

bob_buzzardbob_buzzard

Yes, that sounds correct.

 

As you want to set up this relationship, presumably you have an instance of object A that you are allowing the user to associate the object B records with?  If that isn't the case, how will the user choose the object A instance?

askask

Can you tell me what am i missing in my code to associate object B records ?

 

<apex:page standardcontroller="ObjectA__c" extensions="objtest">

 

 

In controller...

 

public class objtest {

    public objtest(ApexPages.StandardController controller) {
   test=(ObjectA__c) controller.getRecord();
    }

    List<ObjectB__c> selectedRecords= new List<ObjectB__c>();

 

ObjectA__c test=new ObjectA__c(); // instance of object A

 

 public String newtest{get;set;}

 

// here display of ObjectB records(it can be edited) and used the wrapper class to select the ObjectB selected records and they are stored in SelectedRecords (holds edited values if any...)

 

 

for(ObjectB__c o:SelectedRecords){

         o.Example__c = o.id;
         newtest = o.Example__c;

           }

 

// now how do i associate the Object B selected records (it can be changed edited record / original record) to Object A

 

Really clueless where am i going wrong and why it is not getting saved.

bob_buzzardbob_buzzard

Why are you creating a new instance of objectA__c?  You can use the record from the standard controller.  

 

What is the name of the relationship field on objectB that points to objectA?  That field needs to be populated with the id of the record from the standard controller.

askask


Object B has a lookup field named Example__c that points to Object A

and in Object A it displays Object B as related list where the created records of Object B can be stored on selecting them from checkbox(using VF page and apex).


Am i correct? Did you mean the same?

 

Can we edit these created records of object B using apex class and store the edited values as related list on updating the id of Object A ?

 

Also when we deploy some metadata components from one developer edition to another edition using force.com ide ,the records already created for a custom object will not be displayed is it?

bob_buzzardbob_buzzard

Yes, once you populate the lookup field with the id of object a, they will appear as related list entries.  You can change the value of this field in Apex and the object B records will move to the new "parent" object A related list entries.

 

Deploying metadata is separate to deploying data, so yes, nothing will happen to move any data around.

askask

Thanks for your help for so long ...

Thank you so much... :)

 

 

 

bob_buzzardbob_buzzard

No problem.

askask

Hi

Can you provide me the details of salesforce force.com developer certification with the latest study guide for the same.( i have downloaded an older version of study guide i.e.summer '11).

In summer '11 study guide they have mentioned force.com fundamentals book as one of the study material. Is this book enough to learn and appear for the exam?Or should we go through any other materials.If so please provide me the materials / links for the same.

Thanks...

bob_buzzardbob_buzzard

The study guides are available from:

 

http://certification.salesforce.com/

 

I found the fundamentals book to be enough, but I took dev 2.5 years ago so that may not be the case any more.  There are linked in groups for certification study as well as the salesforce certification twitter/facebook accounts.

askask

Thanks a lot ...

Any advice/suggestion on what are the key areas to be focussed for certification apart from the topics mentioned in study guide.

 

Happy new year !!!

bob_buzzardbob_buzzard

Best advice I can give is to try to use all aspects of the system mentioned in the study guide - don't just read about them but actually configure the system in a dev org.

This was selected as the best answer
BALA_RAMBALA_RAM

TRY this code defenitly u get the solution for Autopopulation just you have to make Looup relation with User

 

trigger populateContactfromUser on Contact (before insert , before update){
    
    Set<ID> setConIds = new Set<ID>();
    for(Contact obj : trigger.new){
        if(obj.User_Name__c!= null)
        setConIds.add(obj.User_Name__c);
    }
    
     MAP<ID , User> mapCon = new MAP<ID , User>([Select Id,Email,Phone from User where id in: setConIds]);
     for(Contact obj : trigger.new)
       {
        if(obj.User_Name__c != null)
          {
            User c = mapCon.get(obj.User_Name__c);
            obj.Email= c.Email;
            //Similarly you can assign Address fields as well, just add those field in Contact SOQL as well
          }
       
       }
}