• bryan.revelant1.36697709739127
  • 0 Points
  • Member since 2013

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 5



I want to create a master child relationship but I would like to do this off of the

Custom Fields & Relationships rather than the Standard Fields is this possible.


The way that I have set up my tables and objects are:


Questions (as a table)


Answers ( as a table)


It would be great to link the two via pick list such as


Question Tab

Question Number





Answer Tab

Question Number





This really doesnt seem possible. It appears if i want something like this: It would be more like the Question Tab: Question Number Standard field as either auto num or text


Then select the Question Number Standard as the corresponding one i want to answer


I would rather link the two tables via  pick list - less user errors.




I understand that this is a pretty general Question however I have been trying understand how to build Visual Force pages from scratch. I am running into issues when trying to display the data model/objects when creating a Visual Force Page.


I can have one object display data. However when I add one or more tables to the VF i get errors. 


Would it be possible for anyone to forward me an example of a VF, Controller and class of how they display three objects on a VF. Basic would be perfect 


Best regards, 


I'm working as a Software Test Engineer. I want to learn Salesforce. Please suggest me which module is good for tester. I do not have development experiece. 


I heard from my friends that the Salesfoce is useful for .Net developers. Please suggest me.





Below is a class to get all picklists and their values for an object, but I feel like there must be a more efficient way to do it. The main question is, given the name of the object as a string property, do I have to create list<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values() and then loop through all items in the list until I get to the object I want? Or is there a better way to do go directly to the one I want?


public class GetPicklistsForObject {

  public string theObjectType {get; set;} //the object we're going to get the picklists for
  public List<cObjects> getMyPicklist() {
    list<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values(); 
    list<cObjects> myobjects = new list<cObjects>();  

    for(Schema.SObjectType f : gd) { //for all objects in the schema

       if (f.getDescribe().getLabel() == theObjectType) { //we've found the one we're looking for
            Map<String, Schema.SObjectField> theFieldmap = f.getDescribe().fields.getMap(); //field map for object
            for(String field: theFieldmap.keyset()){ //for each field in the object
                   Schema.DisplayType theResult = theFieldmap.get(field).getDescribe().GetType(); //get field type

                   if (theResult == Schema.DisplayType.Picklist){ //if it's a picklist
                          //fill list with picklist values
                           list<Schema.PicklistEntry> pick_list_values = theFieldmap.get(field).getDescribe().getPickListValues();
                   for (Schema.PicklistEntry a : pick_list_values) {  
                        //for each value, add item to myobjects list
                        cObjects tempObject = new cObjects();
                        tempObject.myObjectName = f.getDescribe().getLabel();
                    tempObject.myFieldName = theFieldmap.get(field).GetDescribe().Name;
                    tempObject.myFieldValue = a.getValue();

                   } //if it's a picklist

            } //for loop
       } //if it matches theObjectType
    return myobjects;
  public class cObjects {
     public String myObjectName {get; set;}
      public String myFieldName {get; set;}
      public String myFieldValue {get; set;} 




I have a visual force page called Survey,which is a related list with case standard object

<apex:page standardController="Survey__c" extensions="Survey" sidebar="false">
 <apex:form style="background-color:#FFFFFF;"> 
    <style type="text/css">
        body {font-family:Arial Unicode MS;font-size:12px;}

 <apex:pageBlock title="Survey Form">
 <apex:pageBlockSection title="Please enter the details" collapsible="true"  columns="2" showHeader="true" onmouseover="hover">
 <apex:panelGrid columns="4" width="900px">
 <apex:outputText value="Survey Name:" style="width:50px">
 </apex:outputText><apex:inputField value="{!Survey__c.Name}"/>
 <apex:outputText value="How was the Case handling power:" style="width:50px">
 </apex:outputText><apex:inputField value="{!Survey__c.How_was_the_Case_handling_power__c}"/>
 <apex:outputText value="How was the feedback:" style="width:50px">
 </apex:outputText><apex:inputField value="{!Survey__c.How_was_the_feedback__c}"/>
  <apex:outputText value="Case" style="width:50px">
 </apex:outputText><apex:inputField value="{!Survey__c.Case__c}"/>
 <center><apex:commandButton value="Save" action="{!Survey}"/>
 <apex:commandButton value="Cancel" action="{!Cancel}"/> </center>



.I have a scenario over here like when ever a case is closed an email is send to the contact telling that ur case has been closed and it gives the link for the Survey.When the user click the survey ,the survey visual force page opens where the user put the survey details and when he saves it, the challenge is that survey record should go and sit with the same case no.



Below is the visual for page.


The controller below is


public  class Survey {
  public Survey__c sur;
  public Case cs;
  public integer n;
  public Id cid;
  public ApexPages.StandardController a;

    public Survey(ApexPages.StandardController controller) {
       this.sur = (Survey__c)Controller.getRecord();
        System.debug('nasir:' +sur);
     public PageReference Survey() {
        cs = new Case();
        sur = new  Survey__c();
        cs = [Select CaseNumber,id from Case Limit 1];
        System.debug('sana:' + cs);
        sur.Case__c = cs.CaseNumber;
      upsert sur;
        return null;


how can i achieve this..plz give some input thanks


  • April 13, 2011
  • Like
  • 0

I've been trying to create a wizard which steps through collecting data to populate accounts and contacts using, for example:




<apex:inputField  value="{!account.name}"/>





with the following code in the page controller:





Account accNewAccount;



public Account getAccount()
        return accNewAccount;  

public void setAccount(Account AccInfo)
        this.accNewAccount = AccInfo;  




However, now I am trying to populate fields in a custom object, whose name is "Offer", namespace prefix is "expw190209" and API name is "expw190209__Offer__c".


I try and follow the method for the account object on the page and the page controller, but it doesn't seem to work, and I cannot seem to find instructions that show you how to do it with anything other than a standard object!


If anyone could give me an example along the lines of what I wrote above, it would be much appreciated.







  • February 23, 2009
  • Like
  • 0