• Irvine Delacroix
  • NEWBIE
  • 70 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 13
    Replies

Hello, I am receiving the Error "system.limitexception too many future calls 51" when I Inserted 300+ records in our Org. I would like an assistance to get around this Error. I hope someone can help here.. I am new to Apex Code for Callouts.. Here's my code.


TRIGGER:

trigger SG_ContactTriggers on Contact (after insert) {

    //TriggerHandler
    TriggerHandlerREST handler = new TriggerHandlerREST();
    
    if(trigger.isAfter){
        handler.UPDATE_CONTACT_ADDRESS(trigger.new);
    }
}


And Here's my CLASS​

public class TriggerHandlerREST {
    //GET GEOCODE METHOD
    public void UPDATE_CONTACT_ADDRESS(List<contact> newContacts){
        
        List<contact> contactsToUpdate = new List<contact>();
        for(contact contacts : [select id, MailingPostalCode from contact where id in: newContacts]){
            
        	GET_GEOCODE(contacts.MailingPostalCode,contacts.id);
        
        }
    }
    
    @future(callout=true)
    public static void GET_GEOCODE(String POSTAL_CODE,string contactID){
        
        contact con = [select id,MailingCity,MailingState,MailingCountry from contact where id =:contactId];
        
        
        String ENDPOINT = 'https://maps.google.com/maps/api/geocode/json?key=AIzaSyAGXR9Ybwo_YxMQvyb-XRP_36fT5_wkeFU&components=country:AU|postal_code:'+POSTAL_CODE+'&sensor=false';
            try{
                HTTPRequest request = new HTTPRequest();
                request.setEndpoint(ENDPOINT);
                request.setHeader('Content-Type', 'application/json');
                request.setMethod('GET');
                
                HTTP http = new HTTP();
                HTTPResponse  response =  http.send(request);
                
                GeoCodeResult geo =(GeoCodeResult)JSON.deserialize(response.getBody(),GeoCodeResult.class);
                
                if(geo.status == 'OK'){
                for(Results results : geo.results){
                    for( Address_components address : results.address_Components){
                        if(address.types.get(0)=='locality'){con.MailingCity=address.long_name;}else if(address.types.get(0)=='administrative_area_level_1'){con.MailingState=address.long_name;}else if(address.types.get(0)=='country'){ con.MailingCountry=address.long_name; }
                    }
                }
                    update con; //UPDATE THE CONTACT
                    
                } else { system.debug('@NUR results === '+geo.status);}
   				
            }catch(Exception e){
               String errorMessage='';
               errorMessage=e.getMessage();
               errorMessage+= ' ::: inside updateAddressByGeocode.getUserByEmail(string email)  ....';
            }
    }
    
    /////HELPER CLASS
    public class GeoCodeResult {
        public List<Results> results;
        public String status;

    }
    
    public class Address_components {
        public String long_name;
        public String short_name;
        public List<String> types;
    }
    
    public class Results {
        public List<Address_components> address_components;
    }
}


Thank you so much in Advance!

Hello,

I need help on some calculation for my trigger.

Basically, what I would like to do is to get value like if the Result is 16, then this will round to 30, if it's 24 then it will still be 30, if the value is 32 then it will be 45.

What I did was :

integer x = 32;
double y = doubleValueOf(x - math.mod(x)) + 15;

But this doesn't seem to be consistent. Can I have some other sure approach to achieve this?


Thanks

Hi Experts,

I'd like your guidance on how to use checkbox in visualforce to delete multiple records.

Below is how my visualforce look like. I want to be able to select multiple attachments then click on the "Delete Selected" button to delete the records that are selected.

User-added image

I'm stuck and I don't know how to achieve this.

I appreciate the help. Thanks much!


Here's my Code:

=====Page=====

<apex:page standardController="Contact" extensions="AttachmentController">
    <apex:form >
        <apex:pageBlock Title="Notes and Attachments">
            <!-- Buttons -->
            <apex:commandButton value="New Note"/>
            <apex:commandButton value="Attach File"/>
            <apex:commandButton value="Delete Selected"/>
            <apex:commandButton value="View All"/>
            <!-- Buttons -->
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!Attachments}" var="att">                    
                   <apex:column >
                       <apex:inputCheckbox />
                   </apex:column>
                   <apex:column value="{!att.id}"/>
                   <apex:column value="{!att.name}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
 

=====Class=====

 

public class AttachmentController {

    public AttachmentController(ApexPages.StandardController controller) {}

    string AttParentId = apexPages.currentPage().getParameters().get('id');
    
    public List<Attachment> getAttachments(){
        list<attachment> att = [select id, name, body from Attachment where parentId =:AttParentId ];
        return att;
    }
}
User-added image

Hi Experts,

I'd like someone to help me understand how to use Map collection. I've seen some examples, articles and documentions that are too advanced and really hard to understand. Some explanations seems to hard to imagine how to use them in a Real World.

So in the scenario Above, I'd like to update a field from Contact when it's created with a value from other Related list undre Account.

I know it can be done with Maps but I don't know how to start my query or how to apply Maps.

•I'd like to know which one should be the Map
•What's going to be my first step then second then third etc.
•What are the best practices for this.


It's would be awesome if someone can comment based on Experience and not just post some artilces. Mostly, articles are confusing and don't really explain how to use things in the Real world.

P.S.

If it's possible for me to have copy of some sort of documents about Maps or Apex, I'd like to have them in my email. vinzell999@gmail.com :)

Thanks a Bunch! 
Hi Experts!

I hope you can help me with this.

I'm trying this experiment some apex code
I have ObjectX, ObjectA and ObjectB.
ObjectA and ObjectB are a Lookup in ObjectX.

First is that I create ObjectA, then in Related List when ObjectX is created, I want to have fields updated on ObjectA with the value fields from Object B which is a lookup on ObjectX. It should do something like the image below.

User-added image

I'm able to do it with the below code but it's giving me incorrect records when I update All records in DataLoader.

Not sure if my approach is correct. Please Help. Here's my code.

trigger TestFieldUpdate on ObjectX__c (after insert, after update){

Map<ID, ObjectA__c> ObjectA = new Map<ID, ObjectA__c>();
  Set<Id> Ids = new Set<Id>();
  Set<Id> ObjectBids = new Set<Id>();
    
  for (ObjectX__c ObjX : Trigger.new) {
    Ids.add(ObjX.ObjectA__c);
    ObjectBids.add(ObjX.ObjectB);
  }

  ObjectA = new Map<Id, ObjectA__c>([SELECT id, Field_1__c, Field_2__c,
                                        (SELECT id,ObjectB__r.Field_1__c, ObjectB__r.Field_2__c
                                         FROM ObjectX__c) 
                                         FROM ObjectA__c 
                                         WHERE ID IN :Ids]);
  
  //I'm not sure if this part is correct though

  List<ObjectB__c> ObjectB = [SELECT Id, Field_1__c, Field_2__c FROM ObjectB__c 
                                      WHERE Id =: ObjectBids ];
 
  for (ObjectX__c ObjectX: Trigger.new){
      
      ObjectA ObjA = ObectA.get(ObjectX.ObjectA__c);
      ObjA.Field1__c = ObjectB[0].Field_1__c;
      ObjA.Field1__c = ObjectB[0].Field_2__c;
      //And So on..
    
  }
      
  IF(ObjectB.size()>0) update ObjectB.values();
    
}


Please let me know what's is the correct code to use if my code is a total none sense :(

Thanks a Lot!

P.S. I'm still learning things, so please explain what each lines does :)

 
Hi Experts,

I'm still confused with how to bulkify the Codes so I don't reach the Governor Limit. I've created some Triggers in our sandbox but it seems that this is not bulkified even though it's working. Can anyone give me Idea on the best practice and how to bulkify the code below.. Thanks :)

/*Mainly, here's the story of my code.. There are two related lists under Account, the ObjectA and ObjectB. I want to have a value (Hourly) from ObjectB to Test__c from ObjectA when ObjectA is Created or Updated */

trigger TestField on ObjectA (before insert, before update) {
    
    Set<Id> AccIDs = new Set<Id>(); //store Account IDs where ObjectA is associated
    String Type;  //Get the Type of the ObjectA (Picklist)
    
    For(ObjectA__c ObjA:Trigger.new){
        AccIDs.add(ObjA.Account__c);
        Type = ObjA.Type__c;
    }
    
    //Create a list of ObjectB where Account ID is equal to the Account ID from ObjectA and the type is equal to the Type of ObjectA.
    List<ObjectB__c> ObjB = [SELECT id, Hourly__c, Type__c  
                                    FROM ObjectB__c
                                    WHERE Account__c IN: AccIDs AND Job_Type__c = : Type];

     //Update the field Test__c from Object A with the Hourly value from the Related List ObjectB from Account.                       
    For(ObjectA__c Obj:Trigger.new) {
            Obj.Test__c = RateCards[0].Hourly__c;
    }

}



Thanks in advance :)
Hi Guys,

I'm a newbie with Apex coding and I'm trying to summarize the value of List and then have the output to a field in the Account.

My Trigger is on Account object and I'm trying to query all the Contacts and then Sum a number field from contact object. (Like Roll up summary field)

List<Contact> conList = [SELECT NumFieldFromContact__c FROM CONTACT WHERE ID IN: <AccountID>];

Account A has 3 Contacts, and the NumFieldFromContact__c contains 10 value. So when my trigger run, the field under Account Object should be updated with the 30 Value.

Here's what I'm testing in Developer Console.

String accID = '0019000001EnVzf';
List<Contact> conList = [SELECT NumFieldFromContact__c FROM Contact WHERE contact.Account.id = :accID];

Integer i=0;
Double x;
Double y;

Do {
    x = conList[i].Formula_Number_Field__c;
    y = x + x;
    i++;
    
} WHILE (i<conList.size());
    
System.debug(y);

Just experimenting on how things works. Can anyone please give me a correct syntax and Explanation of the Line? :)
Hello Guys,

Can anyone please help me on my Visualforce Email Template.

Basically, I have Start and End Date in my Object.

Here's how I referenced the Date start and End to my Visualforce Email Template.

<apex:outputText value="{0,date,EE MMM dd YYYY}">
         <apex:param value="{!MyObject.Start__c }"/>
</apex:outputText> to
<apex:outputText value="{0,date,EE MMM dd YYYY}">
        <apex:param value="{!MyObject.End__c}"/>
</apex:outputText>


Example expected Result:

If my Start is December 20 and End is December 20 as well, then I should get December 20 to December 20 when my Template is used.

However, the result that I got was December 19 to December 20 even if Both fields are the same date.

What is the correct syntax so that my Visualforce template will just copy the exact value of my Date Fields.

Thanks a bunch!
Hello,

Just trying to figure out how to populate the Object Records to visualforce. This is my first day with the visualforce and it got my interest.

My code doen't seem to work (Not sure if I'm doing it right or if I'm missing something). Can anyone please give me an Idea about what I'm trying to do? or is this something that a begginer should not start with.

My Code:

<apex:page standardController="Replicate__c" > 
        <apex:pageBlock title="Replicate Records">
            <apex:pageBlockTable value="{!Replicate__c}" var="Rep">
                <apex:column value="{!Rep.name}"/>                        
            </apex:pageBlockTable>                         
        </apex:pageBlock>
</apex:page>

What I'm expecting it to do is that if I run the visualforce page, it will output like a list view. But is shows something like the picture below.

Output

Thank you! :)
Hello there,

I'm trying to learn custom button, I wanna start with the basic like understanding the parameters and what those fp0=1, lg4=1, lg1="TextCharacter" are for and how to use them. Can anyone suggest a documentation to help me start with these? I could not find useful information from Help and Training and I usually find answers here.

Mainly, I've been asked to have a custom button on a record page that will send an email and do a field update. 

Thanks a lot :)
Hello,

Can you guys help on my simple trigger experiment please. What I am trying to do is to find the name of the UserID.
I have object (TestObject__c) and Fields (txtField__c, WhoUser__c).

My goal is to return the name of the UserID that is in the txtField under my TestObject. Say for example, my user is Bob and his user ID is 0053000000AtjAhAAJ.

So, if the txtField value is 0053000000AtjAhAAJ, the WhoUser field will return Bob when I save the Record.

I've tried experimenting on this but it seems my codes does not make any sense.. I'm always getting that "Unexpected Token" error when trying to query.. (I'm still learning the syntax though) :D

Thanks a lot!
Hey guys,

Need help please. How do you create a test class if your trigger is on Notes and Attachments?

Through the use of Force.com Developer Console, I've created a Test Field update (I'm gonna use the field update for my email alert.. If there is new attachment to the record, then it will fire an Email Alert notification).

Can I have a suggestion please? I am very new to Apex coding..

Thanks a lot!

Regards,

vinzell999

Hello, I am receiving the Error "system.limitexception too many future calls 51" when I Inserted 300+ records in our Org. I would like an assistance to get around this Error. I hope someone can help here.. I am new to Apex Code for Callouts.. Here's my code.


TRIGGER:

trigger SG_ContactTriggers on Contact (after insert) {

    //TriggerHandler
    TriggerHandlerREST handler = new TriggerHandlerREST();
    
    if(trigger.isAfter){
        handler.UPDATE_CONTACT_ADDRESS(trigger.new);
    }
}


And Here's my CLASS​

public class TriggerHandlerREST {
    //GET GEOCODE METHOD
    public void UPDATE_CONTACT_ADDRESS(List<contact> newContacts){
        
        List<contact> contactsToUpdate = new List<contact>();
        for(contact contacts : [select id, MailingPostalCode from contact where id in: newContacts]){
            
        	GET_GEOCODE(contacts.MailingPostalCode,contacts.id);
        
        }
    }
    
    @future(callout=true)
    public static void GET_GEOCODE(String POSTAL_CODE,string contactID){
        
        contact con = [select id,MailingCity,MailingState,MailingCountry from contact where id =:contactId];
        
        
        String ENDPOINT = 'https://maps.google.com/maps/api/geocode/json?key=AIzaSyAGXR9Ybwo_YxMQvyb-XRP_36fT5_wkeFU&components=country:AU|postal_code:'+POSTAL_CODE+'&sensor=false';
            try{
                HTTPRequest request = new HTTPRequest();
                request.setEndpoint(ENDPOINT);
                request.setHeader('Content-Type', 'application/json');
                request.setMethod('GET');
                
                HTTP http = new HTTP();
                HTTPResponse  response =  http.send(request);
                
                GeoCodeResult geo =(GeoCodeResult)JSON.deserialize(response.getBody(),GeoCodeResult.class);
                
                if(geo.status == 'OK'){
                for(Results results : geo.results){
                    for( Address_components address : results.address_Components){
                        if(address.types.get(0)=='locality'){con.MailingCity=address.long_name;}else if(address.types.get(0)=='administrative_area_level_1'){con.MailingState=address.long_name;}else if(address.types.get(0)=='country'){ con.MailingCountry=address.long_name; }
                    }
                }
                    update con; //UPDATE THE CONTACT
                    
                } else { system.debug('@NUR results === '+geo.status);}
   				
            }catch(Exception e){
               String errorMessage='';
               errorMessage=e.getMessage();
               errorMessage+= ' ::: inside updateAddressByGeocode.getUserByEmail(string email)  ....';
            }
    }
    
    /////HELPER CLASS
    public class GeoCodeResult {
        public List<Results> results;
        public String status;

    }
    
    public class Address_components {
        public String long_name;
        public String short_name;
        public List<String> types;
    }
    
    public class Results {
        public List<Address_components> address_components;
    }
}


Thank you so much in Advance!

Hello,

I need help on some calculation for my trigger.

Basically, what I would like to do is to get value like if the Result is 16, then this will round to 30, if it's 24 then it will still be 30, if the value is 32 then it will be 45.

What I did was :

integer x = 32;
double y = doubleValueOf(x - math.mod(x)) + 15;

But this doesn't seem to be consistent. Can I have some other sure approach to achieve this?


Thanks

Hello, I am receiving the Error "system.limitexception too many future calls 51" when I Inserted 300+ records in our Org. I would like an assistance to get around this Error. I hope someone can help here.. I am new to Apex Code for Callouts.. Here's my code.


TRIGGER:

trigger SG_ContactTriggers on Contact (after insert) {

    //TriggerHandler
    TriggerHandlerREST handler = new TriggerHandlerREST();
    
    if(trigger.isAfter){
        handler.UPDATE_CONTACT_ADDRESS(trigger.new);
    }
}


And Here's my CLASS​

public class TriggerHandlerREST {
    //GET GEOCODE METHOD
    public void UPDATE_CONTACT_ADDRESS(List<contact> newContacts){
        
        List<contact> contactsToUpdate = new List<contact>();
        for(contact contacts : [select id, MailingPostalCode from contact where id in: newContacts]){
            
        	GET_GEOCODE(contacts.MailingPostalCode,contacts.id);
        
        }
    }
    
    @future(callout=true)
    public static void GET_GEOCODE(String POSTAL_CODE,string contactID){
        
        contact con = [select id,MailingCity,MailingState,MailingCountry from contact where id =:contactId];
        
        
        String ENDPOINT = 'https://maps.google.com/maps/api/geocode/json?key=AIzaSyAGXR9Ybwo_YxMQvyb-XRP_36fT5_wkeFU&components=country:AU|postal_code:'+POSTAL_CODE+'&sensor=false';
            try{
                HTTPRequest request = new HTTPRequest();
                request.setEndpoint(ENDPOINT);
                request.setHeader('Content-Type', 'application/json');
                request.setMethod('GET');
                
                HTTP http = new HTTP();
                HTTPResponse  response =  http.send(request);
                
                GeoCodeResult geo =(GeoCodeResult)JSON.deserialize(response.getBody(),GeoCodeResult.class);
                
                if(geo.status == 'OK'){
                for(Results results : geo.results){
                    for( Address_components address : results.address_Components){
                        if(address.types.get(0)=='locality'){con.MailingCity=address.long_name;}else if(address.types.get(0)=='administrative_area_level_1'){con.MailingState=address.long_name;}else if(address.types.get(0)=='country'){ con.MailingCountry=address.long_name; }
                    }
                }
                    update con; //UPDATE THE CONTACT
                    
                } else { system.debug('@NUR results === '+geo.status);}
   				
            }catch(Exception e){
               String errorMessage='';
               errorMessage=e.getMessage();
               errorMessage+= ' ::: inside updateAddressByGeocode.getUserByEmail(string email)  ....';
            }
    }
    
    /////HELPER CLASS
    public class GeoCodeResult {
        public List<Results> results;
        public String status;

    }
    
    public class Address_components {
        public String long_name;
        public String short_name;
        public List<String> types;
    }
    
    public class Results {
        public List<Address_components> address_components;
    }
}


Thank you so much in Advance!
Hi,
I have the following dynamic query in a batch process:
I have a lookup relation between Tracking_Number__c  and Account but I'm getting this error:

Didn't understand relationship 'Account_Id__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropri

String query;
global Database.QueryLocator start(Database.BatchableContext BC) {
query = 'SELECT Id, Marchex_Campaign_Id__c, Tracking_Phone_Number__c, Opportunity_Product_Id__c (Select Marchex_Account_Id__c From Account_Id__r) FROM Tracking_Number__c Where  Deactivated_Date__c <= Today and Deactivation_Processed__c = true';
return Database.getQueryLocator(query);
}
Thanks

Hi Experts,

I'd like your guidance on how to use checkbox in visualforce to delete multiple records.

Below is how my visualforce look like. I want to be able to select multiple attachments then click on the "Delete Selected" button to delete the records that are selected.

User-added image

I'm stuck and I don't know how to achieve this.

I appreciate the help. Thanks much!


Here's my Code:

=====Page=====

<apex:page standardController="Contact" extensions="AttachmentController">
    <apex:form >
        <apex:pageBlock Title="Notes and Attachments">
            <!-- Buttons -->
            <apex:commandButton value="New Note"/>
            <apex:commandButton value="Attach File"/>
            <apex:commandButton value="Delete Selected"/>
            <apex:commandButton value="View All"/>
            <!-- Buttons -->
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!Attachments}" var="att">                    
                   <apex:column >
                       <apex:inputCheckbox />
                   </apex:column>
                   <apex:column value="{!att.id}"/>
                   <apex:column value="{!att.name}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
 

=====Class=====

 

public class AttachmentController {

    public AttachmentController(ApexPages.StandardController controller) {}

    string AttParentId = apexPages.currentPage().getParameters().get('id');
    
    public List<Attachment> getAttachments(){
        list<attachment> att = [select id, name, body from Attachment where parentId =:AttParentId ];
        return att;
    }
}
User-added image

Hi Experts,

I'd like someone to help me understand how to use Map collection. I've seen some examples, articles and documentions that are too advanced and really hard to understand. Some explanations seems to hard to imagine how to use them in a Real World.

So in the scenario Above, I'd like to update a field from Contact when it's created with a value from other Related list undre Account.

I know it can be done with Maps but I don't know how to start my query or how to apply Maps.

•I'd like to know which one should be the Map
•What's going to be my first step then second then third etc.
•What are the best practices for this.


It's would be awesome if someone can comment based on Experience and not just post some artilces. Mostly, articles are confusing and don't really explain how to use things in the Real world.

P.S.

If it's possible for me to have copy of some sort of documents about Maps or Apex, I'd like to have them in my email. vinzell999@gmail.com :)

Thanks a Bunch! 
Hi Experts!

I hope you can help me with this.

I'm trying this experiment some apex code
I have ObjectX, ObjectA and ObjectB.
ObjectA and ObjectB are a Lookup in ObjectX.

First is that I create ObjectA, then in Related List when ObjectX is created, I want to have fields updated on ObjectA with the value fields from Object B which is a lookup on ObjectX. It should do something like the image below.

User-added image

I'm able to do it with the below code but it's giving me incorrect records when I update All records in DataLoader.

Not sure if my approach is correct. Please Help. Here's my code.

trigger TestFieldUpdate on ObjectX__c (after insert, after update){

Map<ID, ObjectA__c> ObjectA = new Map<ID, ObjectA__c>();
  Set<Id> Ids = new Set<Id>();
  Set<Id> ObjectBids = new Set<Id>();
    
  for (ObjectX__c ObjX : Trigger.new) {
    Ids.add(ObjX.ObjectA__c);
    ObjectBids.add(ObjX.ObjectB);
  }

  ObjectA = new Map<Id, ObjectA__c>([SELECT id, Field_1__c, Field_2__c,
                                        (SELECT id,ObjectB__r.Field_1__c, ObjectB__r.Field_2__c
                                         FROM ObjectX__c) 
                                         FROM ObjectA__c 
                                         WHERE ID IN :Ids]);
  
  //I'm not sure if this part is correct though

  List<ObjectB__c> ObjectB = [SELECT Id, Field_1__c, Field_2__c FROM ObjectB__c 
                                      WHERE Id =: ObjectBids ];
 
  for (ObjectX__c ObjectX: Trigger.new){
      
      ObjectA ObjA = ObectA.get(ObjectX.ObjectA__c);
      ObjA.Field1__c = ObjectB[0].Field_1__c;
      ObjA.Field1__c = ObjectB[0].Field_2__c;
      //And So on..
    
  }
      
  IF(ObjectB.size()>0) update ObjectB.values();
    
}


Please let me know what's is the correct code to use if my code is a total none sense :(

Thanks a Lot!

P.S. I'm still learning things, so please explain what each lines does :)

 
Hi Guys,

I'm a newbie with Apex coding and I'm trying to summarize the value of List and then have the output to a field in the Account.

My Trigger is on Account object and I'm trying to query all the Contacts and then Sum a number field from contact object. (Like Roll up summary field)

List<Contact> conList = [SELECT NumFieldFromContact__c FROM CONTACT WHERE ID IN: <AccountID>];

Account A has 3 Contacts, and the NumFieldFromContact__c contains 10 value. So when my trigger run, the field under Account Object should be updated with the 30 Value.

Here's what I'm testing in Developer Console.

String accID = '0019000001EnVzf';
List<Contact> conList = [SELECT NumFieldFromContact__c FROM Contact WHERE contact.Account.id = :accID];

Integer i=0;
Double x;
Double y;

Do {
    x = conList[i].Formula_Number_Field__c;
    y = x + x;
    i++;
    
} WHILE (i<conList.size());
    
System.debug(y);

Just experimenting on how things works. Can anyone please give me a correct syntax and Explanation of the Line? :)
Hello,

Just trying to figure out how to populate the Object Records to visualforce. This is my first day with the visualforce and it got my interest.

My code doen't seem to work (Not sure if I'm doing it right or if I'm missing something). Can anyone please give me an Idea about what I'm trying to do? or is this something that a begginer should not start with.

My Code:

<apex:page standardController="Replicate__c" > 
        <apex:pageBlock title="Replicate Records">
            <apex:pageBlockTable value="{!Replicate__c}" var="Rep">
                <apex:column value="{!Rep.name}"/>                        
            </apex:pageBlockTable>                         
        </apex:pageBlock>
</apex:page>

What I'm expecting it to do is that if I run the visualforce page, it will output like a list view. But is shows something like the picture below.

Output

Thank you! :)
Hello,

Can you guys help on my simple trigger experiment please. What I am trying to do is to find the name of the UserID.
I have object (TestObject__c) and Fields (txtField__c, WhoUser__c).

My goal is to return the name of the UserID that is in the txtField under my TestObject. Say for example, my user is Bob and his user ID is 0053000000AtjAhAAJ.

So, if the txtField value is 0053000000AtjAhAAJ, the WhoUser field will return Bob when I save the Record.

I've tried experimenting on this but it seems my codes does not make any sense.. I'm always getting that "Unexpected Token" error when trying to query.. (I'm still learning the syntax though) :D

Thanks a lot!