• Abhishek Kedari
  • NEWBIE
  • 110 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 22
    Replies
Hi,
I have a class which contains list of custom class objects (list of different class object which I created). Now I want to show this list of objects on visualforce page and I need access to every field of this list of class object. How I can do that ?

Please find below code snippest for better understanding of the problem. 

Apex Classes :
1)  ShipmentHistoryRecord   (Class whose data I want to show on visualforce page)
public with sharing class ShipmentHistoryRecord {
     public String businessContact;	         
     public String techContact;	        
     List<Product> products;	         	     
    // Constructor
    public ShipmentHistoryRecord(String businessContact, String techContact,List<Product> products) {
	            this.businessContact = businessContact;
	            this.techContact = techContact;
	 
	            this.products = products.clone();
	        }
	         
       public class Product {
	            public String productName;
	            public String version;
	    }   
	 
	}

2) ShipmentHistory
public with sharing class ShipmentHistory {

     

 

   public List<ShipmentHistoryRecord> shipmentHistoryTest{get;set;}

    

 

    public ShipmentHistory(ApexPages.StandardController controller) {

 

         shipmentHistoryTest = new List<ShipmentHistoryRecord>();

         getShipmentHistory(<"sending some JSON string which is valid and works for below code">);

    

    }

     

   

     public void getShipmentHistory(String jsonStr) {

 

          // Parse entire JSON response.

          JSONParser parser = JSON.createParser(jsonStr);

          while (parser.nextToken() != null) {

            if (parser.getCurrentToken() == JSONToken.START_ARRAY) {

                while (parser.nextToken() != null) {

                    if (parser.getCurrentToken() == JSONToken.START_OBJECT) {

                        ShipmentHistoryRecord history =(ShipmentHistoryRecord)parser.readValueAs(ShipmentHistoryRecord.class);

                        String s = JSON.serialize(history);

                        system.debug('JSONParser:getShipmentHistory: Shipment History : ' + s);

                        shipmentHistoryTest.add(history);

                        parser.skipChildren();

                    }

                }

            }

          }    

     }

3) Visualforce page code sample :
<apex:page standardController="Opportunity" extensions="ShipmentHistory">
.
.
.
<apex:repeat value="{!shipmentHistoryTest}" var="history"> 

     <apex:outputText title="Product" value="{!history.businessContact}"></apex:outputText>

</apex:repeat>

Solutions I tried :
1) Define multiple extensions lik1 <apex:page standardController="Opportunity"extensions="ShipmentHistory,ShippingHistoryRecord">
     Issue got: [Error] Error: Unknown property 'ShipmentHistoryRecord.'
     but if I print 'history' instead of 'history.businessContact', it prints the whole record correctly

2) Creatin inner classes, of ShippingHistoryRecord and Product
    Issue I got: Save error: Initial term of field expression must be a concrete SObject:  LIST<LIST<String>>
    
IMP Note:
There is no object created like ShipmentHistory or ShippingHistoryRecord (So I am not storing any of these values), these re just classes used to hold the values temporaly.

Thanks,
Abhishek
 
Hi,
I have a class which contains list of custom class objects (list of different class object which I created). Now I want to show this list of objects on visualforce page and I need access to every field of this list of class object. How I can do that ?

Please find below code snippest for better understanding of the problem. 

Apex Classes :
1)  ShipmentHistoryRecord   (Class whose data I want to show on visualforce page)
public with sharing class ShipmentHistoryRecord {
     public String businessContact;	         
     public String techContact;	        
     List<Product> products;	         	     
    // Constructor
    public ShipmentHistoryRecord(String businessContact, String techContact,List<Product> products) {
	            this.businessContact = businessContact;
	            this.techContact = techContact;
	 
	            this.products = products.clone();
	        }
	         
       public class Product {
	            public String productName;
	            public String version;
	    }   
	 
	}

2) ShipmentHistory
public with sharing class ShipmentHistory {

     

 

   public List<ShipmentHistoryRecord> shipmentHistoryTest{get;set;}

    

 

    public ShipmentHistory(ApexPages.StandardController controller) {

 

         shipmentHistoryTest = new List<ShipmentHistoryRecord>();

         getShipmentHistory(<"sending some JSON string which is valid and works for below code">);

    

    }

     

   

     public void getShipmentHistory(String jsonStr) {

 

          // Parse entire JSON response.

          JSONParser parser = JSON.createParser(jsonStr);

          while (parser.nextToken() != null) {

            if (parser.getCurrentToken() == JSONToken.START_ARRAY) {

                while (parser.nextToken() != null) {

                    if (parser.getCurrentToken() == JSONToken.START_OBJECT) {

                        ShipmentHistoryRecord history =(ShipmentHistoryRecord)parser.readValueAs(ShipmentHistoryRecord.class);

                        String s = JSON.serialize(history);

                        system.debug('JSONParser:getShipmentHistory: Shipment History : ' + s);

                        shipmentHistoryTest.add(history);

                        parser.skipChildren();

                    }

                }

            }

          }    

     }

 3) Visualforce page code sample :
<apex:page standardController="Opportunity" extensions="ShipmentHistory">
.
.
.
<apex:repeat value="{!shipmentHistoryTest}" var="history"> 

     <apex:outputText title="Product" value="{!history.businessContact}"></apex:outputText>

</apex:repeat>

Thanks,
Abhishek
Hi,

    I want to get some infromation from third party application into salesforce. I can get the information from third party application using future method with callout=true, but How to display that data onto visual force page? Because future method can not return any value. and I do not want to create any new object to insert the received data because I am getting large list of data(records). Also I dont want to perform any operation on this data. I just want to display it on visualforce page.

Can anyone please help me with this?

Thanks,
Abhishek
Hi,
I have create new 'abcd' button which is a standard button of 'abcd' object and when I clicked on that it launches my visualforce page. This object is added into opportunity page . Now what I want to do is whenever I click on create new 'abcd ' button, I want to pass opportunity ID to this visualforce page. How I can do that ?

Please let me know if my question is not clear.

Thanks,
Abhishek
Hi,
   I deployed my code on production and I can see that from he logs that my apex class is getting called from my visualforce page, but not a single debug statement is getting printed. It works fine in sandbox enviornment but on production its not printing anything. I have run this code on production before and it used to work fine. but suddenly it stopped working.

Anyone faced same issue before ?

Thanks,
Abhishek 
Hi,
   
    I am sending some data written in japnese format from apex code to my other application using callout. But when I recieve data at other application servlet from apex, the data is garbled like   'æ ªå¼<8f>ä¼<9a>社Ji2'

Can anyone please tell me how I can handle this ? 

Thanks,
Abhishek
Hi,
    When I used executive account, I dont get this message but if I use account with limited privilges I see below error message and my object is not getting updated.
 
​1 Update failed. First exception on row 0 with id a0ZR00000049iquMAA; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, This record has been locked, and changes cannot be made.: []

My flow :
    1. Call apex method and insert a record 
    2. Call future method
    3. Future method will call some external webservice and will return some id
    4. Update the record in future method by assigning this value to one of field in object
    5. Call  update on the object
    6. Future method ends here

Changes I made :
   1. Changed edit permission in workflow from 'admin' to 'admin and current approver'
   2. Provided edit pormission on that object field for every user

Please let me know if there is any issue in understanding this issue.


Thanks,
Abhishek
Hi,
 
    I am not able to see future method logs in production server where as I can see thos elogs on my sandbox account ?
    Can anyone please help me, How can I enable future method logs in production server ?
    Note : However I can see application logs in my production salesforce.   

Thank,
Abhishek
Hi,
 
   I am creating JSON object in salesforce using 
 
JSONGenerator gen = JSON.createGenerator(true);

I keep adding some fields and values at different hierarchy in this object, but while doing this if I get some different values later for my other computations, I would like to modify already created values in this above object.

So my question is whether I can modify the JSON object or not ? 
If yes, How? It would be good if you provide some good links or sample code.

Thanks,
Abhishek

 
Hi,
 
    I wrote some Apex code in sandbox and now I want to deploy it on production server.
    But there are some rules defined on production because of which some of test cases in production gets failed. Nothing related to my code.
    Now because of those errors I can not check in my code on production. So I need to fix those errors first. Can anyone please help me with this?
    Solutions I tried :
    1. Modify test class file in sandbox (which throws validation error) and tried to update it on production, but iits not allowing me to deploy any code on production because it executes those test cases and tells me that validation error exist on production server.
   2. Disabled that validation rule on production, but still got same error.


Please help me with this.

Thanks,
Abhishek
 


Hi,
 
    I want to deploy my changes to production from sandbox. Here is wat I am doing right now.
1. I imported sandbox code in Eclipse IDE.
2. Created some apex class and tested it on sandbox salesforce. (while saving I used right click -> save to server option)
3. To deploy chnages to production (write click on file -> deploy to server)
4. I entered user name, password and security token
5.  Its givin me error for two class files which I never modified and those files exist on production server (some syntax error in those files) and I really can not modify those file


How I can deploy my changes in production. Can anyone please help me with this ? Any help in this regards will be appreciated.

Thanks,
Abhishek
Hi,
  
    I want to deploy my changes to production from sandbox. Here is wat I am doing right now.
 1. I imported sandbox code in Eclipse IDE.
 2. Created some apex class and tested it on sandbox salesforce. (while saving I used right click -> save to server option)
 3. To deploy chnages to production (write click on file -> deploy to server)
 4. I entered user name, password and security token
 5.  Its givin me error for two class files which I never modified and those files exist on production server (some syntax error in those files) and I really can not modify those file


How I can deploy my changes in production. Can anyone please help me with this ? Any help in this regards will be appreciated.

Thanks,
Abhishek

Hi All,

   I want to access variables of object which is part of current object in my apex class.
   e.g.
           Shipments__c shipment       where Shipments__c contains object opportunity as one of its field. Suppose oppourtunity field contains field name. How I can access these fields (id and name) of opportunity using shipment object variable.

it should be something like shipment.Opportunity__r.Id & shipment.Opportunity__r.Name

Apex code :
    System.debug('I M WRITTNG   :  ' + shipment.Related_Opportunity__r.Account.Name);

Debug Log :
   14:58:44.271 (271899101)|USER_DEBUG|[63]|DEBUG|I M WRITTNG   :  null



How I am creating new shipmenet object -
1 ) Create new account
2) Inside account there is a field call Opportunity
3) Every opportunity has shipment object associated with it.

User-added image

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

User-added image


I expect to see account name for any particular shipment as account and opportunity are already created and I am creating new shipment inside this opportunity,

I am accessing values getting passed from viualforce page to my apex class.
Do I need to populate the value in visualforce manually or it will get populate automatically ?

Thanks,
Abhishek
Hi All,

   I want to access variables of object which is part of current object in my apex class.
   e.g.
           Shipments__c shipment       where Shipments__c contains object opportunity as one of its field. Suppose oppourtunity field contains field name. How I can access these fields (id and name) of opportunity using shipment object variable.

shipment.opportunity.id  /  shipment.Opportunity__c.id
shipment.opportunity.name  / shipment.Opportunity__c.name

but its not working and saying id and name does not exist.

Can anyone please help me with this?
Let me know if I am not clear with the question.


Thanks,
Abhishek
 

Hi,

   Do we have anything like resource bundle in salesforce like we have in java, where I can keep all my replacement strings / constants.
   If yes can you give me the example. I want to access those replacement values from apex code.
    If not what is the alternative way for doing this ?

Thanks,
Abhishek

Hi All,

    I have many apex classed and everhwere I have some values store in different variables. Now depending upon the value contained by that variable, I want to get some other value from Constant declared file (in short Mapping). How I can do that.  I tried this with few ways -

1) declare Constants.cls but problem with this apprach is - suppose variable 'x' contains value 'a' which i want to replace with 'A' from Constants file,  I can't use Constants.x to get the value A, I need to use Constants.a .  Is there any solution to this. (I really dont want to check string everytime with some constant value)

2) using Maps, but I dont know how I can use Maps (key,value) to declare constant values. Because I want this data as static and dont want to use new operator to create new Map everytime.  I would prefer this apprach if anyone helps mw to find out how to use this approach.


Please let me now if I am not clear.


Thanks,
Abhishek
Hi,

    I have JSON object created using JSONGenerator class. I want to pass this JSON object to my servlet in java.
    I want to send JSON object something like this http://www.xyz.com/basics/test.php(any extension here)?param=JSONObject.
     where JSONObject is json object.  and after that I want to write JSON parser inside my servlet (in java)

Can anyone help me, how to send JSON object to/from Salesforce and send/recievc JSON object in servlet.

Regards,
Abhishek
Hi,

    How I can access methods from different class ( static / through instance variable ).
    e.g.
           I need something like this - 
public class A {
      public void callA(){
          :
      }
   }

public class B {
      public void callB() {
           A obj = new A();
           obj.callA();
      }
   }

Thanks,
Abhishek
Hi, 

   I want to develop salesforce code in my local eclipse environment. I follwed steps mentioned here :
    https://developer.salesforce.com/page/Force.com_IDE
So my eclipse is ready now but I dont know how to import code(apex classes, components, visual force pages) from my sandbox into my local enviornment and how I can again deply changes to salesforce cloud.

Can anyone please help me to solve this issue.


Thanks,
Abhishek
  
Hi All,

      I have created visual force page and I want to show owner field of the object on this page for which I created this page.
      I tried different ways mentioned below but it did not work. I am able launch the page but owner field remains blank where as other fields works fine.
      Other fields are custom fields and owner field is standard field     

      My code is like this - 

      Visualforce page :
              ( Not complete code just important one) 
<apex:page standardController="Shipments__c" extensions="shipment">
       <apex:inputField value="{!shipment.Related_Opportunity__c}"/>
       <apex:inputField value="{!shipment.Basis_Technical_Contact__c}"/>
       <apex:outputField label="Owner" value="{!Shipments__c.Owner.name}"/>
  I also tried replacing value of fields to :

<apex:outputField label="Owner" value="{!Shipments__c.Owner}"/>           // with controller name 
<apex:outputField label="Owner" value="{!Shipments__c.Ownerid}"/>        // with controller name
<apex:outputField label="Owner" value="{!Shipments.Owner}"/>                 // using object name
<apex:outputField label="Owner" value="{!Shipments.Ownerid}"/>             // using object name

and My controller class is :
public class shipment {

   public Shipments__c shipment{get;set;}

    public shipment(ApexPages.StandardController controller) {
         shipment = new Shipments__c();
    }
}

Is this because I am creating new object and new object contains all null values initially ?
How I can get owner name on my vusalforce page ?
When I use standard layout for creating new object provided by salesforce without using visualforce page, I do see owner field gets populated properly.
Please help.

Thanks,
Abhishek

Hi,

   I wanted something like this in my code

User-added image

I got this using single controller with few methods and and one visualforce page.

Now what I want is :

User-added image

But I want to use single controller which will operate on different lists.
So planning to have somethink like this

1) 1 Visual force 
2)  controller A has got different objects like multiselect1, multiselect2 and multiselect3   (These 3 objects are of type multiselect)
3) one generic controller/class 'multiselect' which will store information related to data in left panel, right panel, selected and unselected and some functions to move data from one panel to another. I can call these methods from controller A by calling methods using specific objects (like we do in Java).

How I can make this work?
So basically, what I want is visualforce page calls methods on particular object which will get pass to controller A and controller A will again call method from multiselect class on the same object passed by visualforcepage.

Current visualforcepage code :

<apex:panelGrid columns="3" id="abcd">
            <apex:selectList id="sel1" value="{!leftselected}" multiselect="true" style="width:100px" size="5">
                <apex:selectOptions value="{!unselectedvalues}" />
            </apex:selectList>
                <apex:panelGroup >
                    <br/>
                    <apex:image value="{!$Resource.moveRight}">
                        <apex:actionSupport event="onclick" action="{!selectclick}" reRender="abcd"/>
                    </apex:image>
                    <br/><br/>
                    <apex:image value="{!$Resource.moveLeft}">
                        <apex:actionSupport event="onclick" action="{!unselectclick}" reRender="abcd"/>
                    </apex:image>
                </apex:panelGroup>
            <apex:selectList id="sel2" value="{!rightselected}" multiselect="true" style="width:100px" size="5">
                <apex:selectOptions value="{!SelectedValues}" />
            </apex:selectList>
        </apex:panelGrid>



Please let me know if my question is confusing.



Best Regards,
Abhishek








Hi,
I have a class which contains list of custom class objects (list of different class object which I created). Now I want to show this list of objects on visualforce page and I need access to every field of this list of class object. How I can do that ?

Please find below code snippest for better understanding of the problem. 

Apex Classes :
1)  ShipmentHistoryRecord   (Class whose data I want to show on visualforce page)
public with sharing class ShipmentHistoryRecord {
     public String businessContact;	         
     public String techContact;	        
     List<Product> products;	         	     
    // Constructor
    public ShipmentHistoryRecord(String businessContact, String techContact,List<Product> products) {
	            this.businessContact = businessContact;
	            this.techContact = techContact;
	 
	            this.products = products.clone();
	        }
	         
       public class Product {
	            public String productName;
	            public String version;
	    }   
	 
	}

2) ShipmentHistory
public with sharing class ShipmentHistory {

     

 

   public List<ShipmentHistoryRecord> shipmentHistoryTest{get;set;}

    

 

    public ShipmentHistory(ApexPages.StandardController controller) {

 

         shipmentHistoryTest = new List<ShipmentHistoryRecord>();

         getShipmentHistory(<"sending some JSON string which is valid and works for below code">);

    

    }

     

   

     public void getShipmentHistory(String jsonStr) {

 

          // Parse entire JSON response.

          JSONParser parser = JSON.createParser(jsonStr);

          while (parser.nextToken() != null) {

            if (parser.getCurrentToken() == JSONToken.START_ARRAY) {

                while (parser.nextToken() != null) {

                    if (parser.getCurrentToken() == JSONToken.START_OBJECT) {

                        ShipmentHistoryRecord history =(ShipmentHistoryRecord)parser.readValueAs(ShipmentHistoryRecord.class);

                        String s = JSON.serialize(history);

                        system.debug('JSONParser:getShipmentHistory: Shipment History : ' + s);

                        shipmentHistoryTest.add(history);

                        parser.skipChildren();

                    }

                }

            }

          }    

     }

 3) Visualforce page code sample :
<apex:page standardController="Opportunity" extensions="ShipmentHistory">
.
.
.
<apex:repeat value="{!shipmentHistoryTest}" var="history"> 

     <apex:outputText title="Product" value="{!history.businessContact}"></apex:outputText>

</apex:repeat>

Thanks,
Abhishek
Hi,
I have create new 'abcd' button which is a standard button of 'abcd' object and when I clicked on that it launches my visualforce page. This object is added into opportunity page . Now what I want to do is whenever I click on create new 'abcd ' button, I want to pass opportunity ID to this visualforce page. How I can do that ?

Please let me know if my question is not clear.

Thanks,
Abhishek


Hi,
 
    I want to deploy my changes to production from sandbox. Here is wat I am doing right now.
1. I imported sandbox code in Eclipse IDE.
2. Created some apex class and tested it on sandbox salesforce. (while saving I used right click -> save to server option)
3. To deploy chnages to production (write click on file -> deploy to server)
4. I entered user name, password and security token
5.  Its givin me error for two class files which I never modified and those files exist on production server (some syntax error in those files) and I really can not modify those file


How I can deploy my changes in production. Can anyone please help me with this ? Any help in this regards will be appreciated.

Thanks,
Abhishek
Hi,
  
    I want to deploy my changes to production from sandbox. Here is wat I am doing right now.
 1. I imported sandbox code in Eclipse IDE.
 2. Created some apex class and tested it on sandbox salesforce. (while saving I used right click -> save to server option)
 3. To deploy chnages to production (write click on file -> deploy to server)
 4. I entered user name, password and security token
 5.  Its givin me error for two class files which I never modified and those files exist on production server (some syntax error in those files) and I really can not modify those file


How I can deploy my changes in production. Can anyone please help me with this ? Any help in this regards will be appreciated.

Thanks,
Abhishek

Hi All,

   I want to access variables of object which is part of current object in my apex class.
   e.g.
           Shipments__c shipment       where Shipments__c contains object opportunity as one of its field. Suppose oppourtunity field contains field name. How I can access these fields (id and name) of opportunity using shipment object variable.

it should be something like shipment.Opportunity__r.Id & shipment.Opportunity__r.Name

Apex code :
    System.debug('I M WRITTNG   :  ' + shipment.Related_Opportunity__r.Account.Name);

Debug Log :
   14:58:44.271 (271899101)|USER_DEBUG|[63]|DEBUG|I M WRITTNG   :  null



How I am creating new shipmenet object -
1 ) Create new account
2) Inside account there is a field call Opportunity
3) Every opportunity has shipment object associated with it.

User-added image

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

User-added image


I expect to see account name for any particular shipment as account and opportunity are already created and I am creating new shipment inside this opportunity,

I am accessing values getting passed from viualforce page to my apex class.
Do I need to populate the value in visualforce manually or it will get populate automatically ?

Thanks,
Abhishek
Hi All,

   I want to access variables of object which is part of current object in my apex class.
   e.g.
           Shipments__c shipment       where Shipments__c contains object opportunity as one of its field. Suppose oppourtunity field contains field name. How I can access these fields (id and name) of opportunity using shipment object variable.

shipment.opportunity.id  /  shipment.Opportunity__c.id
shipment.opportunity.name  / shipment.Opportunity__c.name

but its not working and saying id and name does not exist.

Can anyone please help me with this?
Let me know if I am not clear with the question.


Thanks,
Abhishek
 

Hi,

    I have JSON object created using JSONGenerator class. I want to pass this JSON object to my servlet in java.
    I want to send JSON object something like this http://www.xyz.com/basics/test.php(any extension here)?param=JSONObject.
     where JSONObject is json object.  and after that I want to write JSON parser inside my servlet (in java)

Can anyone help me, how to send JSON object to/from Salesforce and send/recievc JSON object in servlet.

Regards,
Abhishek
Hi, 

   I want to develop salesforce code in my local eclipse environment. I follwed steps mentioned here :
    https://developer.salesforce.com/page/Force.com_IDE
So my eclipse is ready now but I dont know how to import code(apex classes, components, visual force pages) from my sandbox into my local enviornment and how I can again deply changes to salesforce cloud.

Can anyone please help me to solve this issue.


Thanks,
Abhishek
  
Hi All,

      I have created visual force page and I want to show owner field of the object on this page for which I created this page.
      I tried different ways mentioned below but it did not work. I am able launch the page but owner field remains blank where as other fields works fine.
      Other fields are custom fields and owner field is standard field     

      My code is like this - 

      Visualforce page :
              ( Not complete code just important one) 
<apex:page standardController="Shipments__c" extensions="shipment">
       <apex:inputField value="{!shipment.Related_Opportunity__c}"/>
       <apex:inputField value="{!shipment.Basis_Technical_Contact__c}"/>
       <apex:outputField label="Owner" value="{!Shipments__c.Owner.name}"/>
  I also tried replacing value of fields to :

<apex:outputField label="Owner" value="{!Shipments__c.Owner}"/>           // with controller name 
<apex:outputField label="Owner" value="{!Shipments__c.Ownerid}"/>        // with controller name
<apex:outputField label="Owner" value="{!Shipments.Owner}"/>                 // using object name
<apex:outputField label="Owner" value="{!Shipments.Ownerid}"/>             // using object name

and My controller class is :
public class shipment {

   public Shipments__c shipment{get;set;}

    public shipment(ApexPages.StandardController controller) {
         shipment = new Shipments__c();
    }
}

Is this because I am creating new object and new object contains all null values initially ?
How I can get owner name on my vusalforce page ?
When I use standard layout for creating new object provided by salesforce without using visualforce page, I do see owner field gets populated properly.
Please help.

Thanks,
Abhishek

Hi All,

   How to use datepicker on visualforcepage ?
   I tried different codes avialble on internet but it is either not showing calendar else gives error while saving page itself i.e.  "Error: Component <apex:input> in '/apex/samplePage' requires HTML docType version 5.0 or higher in samplePage at line 16 column 82"
  I want to run it on my current settings.

Can anyone please help me ?

Tried code : 
1) public Date datename { get; set; }

    <apex:input label="datePicker" value="{! datename }" type="auto"/>

2) public String datename { get; set; }

    <apex:form>   
    Date: <apex:inputText value="{!datename}" size="10" id="demo"    onfocus="DatePicker.pickDate(false, this , false);" />   
   </apex:form>

Thanks,
Abhishek

Hi All,

    I have an objecte created with custom field Gender (type is pick list and contains 2 values Male and Female). Now I want to show this values on my visualforce page.
   Can anyone please tell me how I can do that ?

   When I searched on internet i got this piece of code :
<apex:selectList value="{!countries}" multiselect="true">
            <apex:selectOptions value="{!items}"/>
        </apex:selectList><p/>
but I only know my object name and field name. Not sure how to use above.
For example suppose my object name is 'Information' and picklist custom field is 'Gender' How I can write this in above snippest.

Also after that I want to send selected value to apex controller.

Thanks in advance.


Best Regards,
Abhishek 

   

Hi All,

   I am new to salesforce developemnt.
   I want to know, how I can access fields from custom objects to my apex controller through visualforce page.
   To be more detail about my question - 
   - I have a custom object 'shipment' and some fields created for that object (Fileds are like dropdown, multiselect, long text etc)
   - I have visual force page and I am not able to show fields like drop down list with values defined in my custom object (values are predefined in object fields with type as picklist) Anyone knows how I can do that ?
   -  and after that I want to send those values to my controller from my visualforce page where I can write my actual business logic and process that data.

Let me know if I am not clear. Thanks is advance.

Best Regards,
Abhishek

Hello Apex Wizards (-: I

 

I have an annoying problem.

 

In our system we have an object called “Dongles” and this object has a reference field(Lookup Relationship) to the account object named customer_c.

 

I have a case on dongle save where I need to take a value from the account related to it and put it in the dongle record.

 

I am assuming it’s possible to get the data of the account(that is related to the dongle) without doing an extra query (As we know, apex is very cheap on queries :smileyvery-happy:) but when I try to get a pointer to the account object using the syntax below I get a null object.

 

Account AccountPointer = dongleToSync.Customer__r;

 

Anyway, I figure there is a way to get over this hump without making an extra query. But I could be wrong )-:

 

Any help will be greatly appreciated….