• abivenkat
  • NEWBIE
  • 75 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 45
    Questions
  • 57
    Replies

Hi friend,

i have created an visualforce page where i have used <apex:inputFile /> to take any CSV file as input

then i am displaying that CSV file's data into the same vf page in tabular format...

 

but i want that selected CSV's data should be displayed in another vf page. (so by setting attribute renderas="pdf" i can view CSV's data in a PDF format)

 

 

how can i do this?

 

 

here is my code...

 

<apex:page controller="uploadCSVcontroller">
  <apex:form >
  <apex:pageMessages id="pm"/>
  <apex:inputFile value="{!contentFile}" filename="{!nameFile}"/>
  <apex:commandButton value="Display" id="theButton"/>  
  
  
  
  <apex:pageBlock >
  <apex:outputPanel id="results">
  <p>nameFile: {!nameFile}</p>
  <p>rowCount: {!rowCount}</p>
  <p>colCount: {!colCount}</p>
    <table title="CSV Output" border="1" width="100%">
       <apex:repeat value="{!results}" var="row">
           <tr>
               <apex:repeat value="{!row}" var="cell">
                   <td> {!cell} </td>
               </apex:repeat>
           </tr>
       </apex:repeat>
     </table>
  </apex:outputPanel>
  </apex:pageBlock>
  </apex:form>
</apex:page>







Controller


public class uploadCSVcontroller 
  {

    public Blob contentFile { get; set; }
    public String nameFile { get; set; }
    public Integer rowCount { get; set; }
    public Integer colCount { get; set; }
    
    public List<List<String>> getResults() 
    {
        List<List<String>> parsedCSV = new List<List<String>>();
        rowCount = 0;
        colCount = 0;
        if (contentFile != null)
        {
            String fileString = contentFile.toString();
            parsedCSV = parseCSV(fileString, False);
            rowCount = parsedCSV.size();
            for (List<String> row : parsedCSV)
            {
                if (row.size() > colCount)
                {
                    colCount = row.size();
                }
            }
        }
        return parsedCSV;
    }
    
    public Pagereference CreatePDF()
     {
      pagereference pr = new pagereference('/apex/FinalReport1');
      pr.setredirect(true);
      return pr;
     }
    
    public static List<List<String>> parseCSV(String contents,Boolean skipHeaders) 
     {
        List<List<String>> allFields = new List<List<String>>();
        contents = contents.replaceAll(',"""',',"DBLQT').replaceall('""",','DBLQT",');
        contents = contents.replaceAll('""','DBLQT');
        List<String> lines = new List<String>();
        try 
        {
          lines = contents.split('\r'); // using carriage return accomodates windows, unix, and mac files
        }
        catch (System.ListException e) 
        {
            System.debug('Limits exceeded?' + e.getMessage());
        }
        Integer num = 0;
        for(String line: lines) 
        {
           if (line.replaceAll(',','').trim().length() == 0) break;
            List<String> fields = line.split(',');  
            List<String> cleanFields = new List<String>();
            String compositeField;
            Boolean makeCompositeField = false;
            for(String field: fields) 
            {
                if (field.startsWith('"') && field.endsWith('"')) 
                {
                    cleanFields.add(field.replaceAll('DBLQT','"'));
                }
                else if (field.startsWith('"')) 
                {
                    makeCompositeField = true;
                    compositeField = field;
                }
                else if (field.endsWith('"')) 
                {
                    compositeField += ',' + field;
                    cleanFields.add(compositeField.replaceAll('DBLQT','"'));
                    makeCompositeField = false;
                }
                else if (makeCompositeField) 
                {
                    compositeField +=  ',' + field;
                }
                else
                {
                    cleanFields.add(field.replaceAll('DBLQT','"'));
                }
            }
            
            allFields.add(cleanFields);
        }
        if (skipHeaders) allFields.remove(0);
        return allFields;       
     }

}

 

 

 

Thanks,

Amit Singh

how do i make a pop up window after pointing or clicking on something. for example there is a table with a list of  customers. if you hover your mouse over customer name or click on cutomer name, a pop up window will apear showing information about that customer.

I am developing a .Net website to which i have integrated the salesforce using the WSDL file. I am getting an issue occasionally while trying the following.

1. I have an XML in the .net website where the SOQL queries resides. In the same XML file, i am having the Username, password and the security token of the SFDC org.
2. First up, i will read the login credentials from the XML file and login to the SFDC org.
3. After login, i will be fetching the SOQL query from the same XML file and trying to run the query in the salesforce to fetch a n number of rows.
4. While the query runs in the SFDC org, i am getting an error as below,

An unexpected error has occurred: There is an error in XML document (1, 1229).
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at WebReferences.SForceService.SforceService.query(String queryString) in 'my file path'
   at RowDI.DataReader.fGetData() in 'my file path'


Another important thing is, this application will be accessed by n number of users at the same time. It will run simulteanously and parallely. so, there can be chances where multiple users to login at the same time and fetch the query from XML file and get the records. This issue is occurring once for every 5 runs i.e,. occasionally occurring issue.

so is there anything that we are missing to do in this scenario? any ideas/suggestions will be very helpful and grateful to us asap, as this application is already in production environment.

 

Thanks

abivenkat

Hi all,

 

I am developing a .Net application, in which i have incorporated my developer editions enterprise WSDL. By that web reference, i am able to retrieve an objects data and rows in my .Net application (in salesforce object only). being the object belongs to the salesforce, i cant able to convert it to any other data sources such as, list or datatable or array. m requirement is to move the retrieved data to a datatable and write all the data to a text file.

 

I can able to do this. please suggest me an idea on this or give me any code example of writing the salesforce object data to a text file.

 

Thanks in advance

abivenkat

 

hi all,

 

How to avoid inline editing for particular fields in details page of a record? 

If i turn this feature in the UI settings, then what if i create a package and install in another organization and how to tackle this problem there??? is there any code to handle this problem??

 

 

thanks,

abivenkat,

SFDC Learner

 

hi all,

 

I have a requirement in which i am trying to show a table to the users. I need its format to be in different from the normal. For Example, below shown table is the normal format which we use to show values in table format.

 

S.No.First NameSecond NamePhoneCity
1ae123j
2bf456k
3cg789l
4dh987m
5ei654n

 

But i wann some format changes from the above shown table. i need the table formatted as table shown below.

 

S.No12345
FirstNameabcde
Second Namefghij
Phone132456798654312
Cityklmno

 

In which the column names should be formatted one by one (vertically) and its field values should be formatted in one after the other (horizantally). I wanna know how to format this and how to insert a radiobutton for the values inside the table..

 

i need suggestions and assistance to do this..

 

 

thanks,

abivenkat,

SFDC Learner

 

hi all,

 

In my visualforce page, i have a selectlist in which i am binding all the object names dynamically and based on the selection of the object, i am retrieving the field names for that object and binding it in another selectlist and allow users to save the record in the object. Until now, there are no problems arise.

If the user goes to a records detail page and clicks edit, the values in the selectlist is not retaining its values, instead it is restored to its default value (as --None--). What i have to do to fetch the value saved in the record and show them while editing the previous record.

Example: while creating a new record, user chooses, Account as object, Name as field and saves this record. now while editing this same record, both the selectlists are set to default values.

I need some assistance in doing this. please help.

 

thanks,

abivenkat,

SFDC Learner

 

hi all,

 

i have created a custom component to use it in the visualforce page. There is no problem for me until i use only one component in my VF page, but, when i use more than one custom component in my VF page, it is not recognizing which one is what and cant able to differentiate it. What is the solution to differentiate the components when used in more number. Is there any attribute can solve this problem.

 

I have tried using the default ID attribute, but, still i cant differentiate it.. please suggest me what i have to do to get rid of this..

 

thanks,

abivenkat,

SFDC Learner


I have 3 classes with me. my requirement is i have to access the base class via derived class

1st class is defined as virtual base class for inheritance as shown below  (IncomeTax)

 

public virtual class IncomeTax {
    
    public IncomeTax() {
    }
    
    public virtual string Tax() {
        return '3';
    }
}

2nd class is defined as normal derived class which extends the base class (GovernmentEmp)

 

public with sharing class GovernmentEmp Extends IncomeTax {
    
    public GovernmentEmp() {
    }
    
    public override string Tax() {
        return '5';
    }
}

3rd class is defined as normal derived class which extends the base class (CorporateEmp)

 

public with sharing class CorporateEmp Extends IncomeTax {
    
    public CorporateEmp() {
    }
    
    public override string Tax() {
        return '10';
    }
}

4th is my apex class controller called as ModelPageController. how can i call a method from base class (IncomeTax) in my class. what i have to do to call the method from the base class?  which class i should extend here? 

 

public with sharing class ModelPageController  {
    
    public string PercentVal { get; set; }
    
    public void Percentage() {
        
    }
}

 

does my inheritance method is right or what is mistake am i committing in the above process? please correct my code in which i can extend the classes and use the base class methods via derived class?? (i.e.,) have to access the "IncomeTax" via "GovernmentEmp" or "CorporateEmp" from my controller class called "ModelPageController".. please help me in my simple inheritance functionality..

 

thanks,

abivenkat,

SFDC Learner

 

hi all,

 

What is Virtual? Why we are using Virtual keyword in a class? what it will do? 

Un which cases Virtual keyword is used ? i need some business or normal examples to understand this Virtual concept... please help me.. 

 

 

Thanks,

abivenkat,

SFDC Learner

 

hi,

 

i have a List<sObject>, by looping this list, i wanna compare the values from this list to another string list, for doing this, i have to convert the values from this list to string, so how can i achieve this functionality...?

 

How to convert the sObject values to string???

 

 

Thanks,

abivenkat,

SFDC Learner

 

hi,

 

I am constructing and running a query during the run time in my application based on the user's input. Group By is also used in the query, so i am getting the values in the List<AggregateResult> list and i am converting that list to another list with the use of the wrapper class called List<ListConversion>. Now i am returning this List<ListConversion> List from the controller class and i wanna know how to display the values of the list in the UI using Datatable or pageBlockTable or some other VF components???

 

Note: The point is, while referencing the list values in the pageBlockTable or in DataTable, we should know the Column name to bind it, but, here in this scenario, the column names are dynamic (as shown in the example below). so how to bind the list to the DataTable or pageBlockTable?? 

 

<apex:pageBlockTable columns="2" value="{!ListOfVals}" var="item" id="Table">
<apex:column >
<apex:outputField value="{!item.Name of the first column}" />
<apex:facet name="header">{!Name of the first column}</apex:facet>
 </apex:column>
<apex:column >
<apex:outputField value="{!item.Name of the second column}" />
<apex:facet name="header">{!Name of the second column}</apex:facet>
 </apex:column>
</apex:pageBlockTable> <br />

 

how to bind the dynamic column names.. List is not the ordinary list, it is a list return by the wrapper class called as ListConversion (List<ListConversion>).. Please help me as this is my urgent requirement. Thanks in advance..

 

 

 

Thanks,

abivenkat,

SFDC Learner

 

hi all,

 

i have a pageBlockTable in my VF page. 1st Column is a checkbox column and 2nd column is a column which changes dynamically based on the user's selection, let's say for example, 2nd Column is a "Name" retrieved from the account object. Now if the user checks the checkbox, i have to read the value of the checkbox and if it is checked, then i have to retrieve the value associated with the checked checkbox.

 

what i should do to relate the Name column with the check box column?? please help me to achieve this functionality..

 

 

Thanks,

abivenkat,
SFDC Learner 

hi,

 

I have displayed all the object names in a select list and while an object is selected, i am retrieving the object name and i have to select the field names for it. For this i found that the syntax as given below,

 

Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields;

 

The Account object is hardcoded here, but, in my scenario, object name is dynamically changing, how to modify this syntax into dynamically changing one. any ideas or any other syntax's available to get field names?? 

Or is there any soql query to retrieve the field for the requested object? please provide any ideas or suggestions to retrieve the field names...

 

thanks,

abivenkat,

SFDC Learner

 

hi all,

 

i have a custom component in my visualforce page. There is a Textbox in my custom component where users enters some value. I have to pass that Textbox value to my Visualforce page. Now how to pass the textbox value from that custom component to visualforce page??? i thought it was easy, but, i cant get the textbox value from the custom component.

 

i wann that textbox value in my visualforce page or in my page's controller class at least.. please help me to achieve this functionality!!

 

thanks,

abivenkat,

SFDC Learner

 

hi,

 

i want to create a Value attribute for my custom component. "Value" attribute is the one which is used to get the value in the corresponding controller class in all the default visualforce components. how to create that "Value" attribute for my custom component? we use this "Value" attribute to pass our values to controller class, we retrieve this by putting get, set in controller class, now how can i do in this??

 

for example :

<apex:page controller="Sample">

<c:sampleComp Value="{!ControllerClass}" />

</apex:page>

 

i want to pass that value attribute to the controller class called "Sample". Then how should i code this attribute to work like above??

i need any code example to achieve this functionality.. please help me..

 

thanks,

abivenkat,

SFDC Learner

 

 

hi all,

 

i wanna retrieve all the objects' names (display that to the user) and fields from the object name (chosen by the user). To get the object name, i am tryin to use the describe methods like below:

 

1. describeGlobal()

2. describeDataCategoryGroups()

3. describeDataCategoryGroupStructures()

4. describeLayout()

5. describeSObject()

6. describeSObjects()

7. describeSoftphoneLayouts()

8. describeTabs()

 

i cant use these methods in salesforce Class page. if i use these methods, it is throwing me some error like  

 

Error: Compile Error: Method does not exist or incorrect signature: connection.describeGlobal()

 

and more errors similar to the above ones.. what i have to do to resolve this problem, how should i make use of these default methods provided for salesforce.? please help and guide me how to use these methods to retrieve the object names and its fields on the selection of the object?

 

is there any other syntax or method available for taking the object name and again taking the fieldname to show from the DataBase? help me in doing this

 

Thanks,

abivenkat,

SFDC Learner.

 

hi all,

 

i m working in a scenario, which is

 

i am creating a custom button and performing its functionalities in a visual force page in Account Object. Now i wanna know, whether the created visual force page can be also used for another custom button in another object, such as, in contact or opportunities???

 

is that possible to use the same visual force page for a different custom buttons in different objects?? please help me..

 

 

Thanks,

abivenkat,

SFDC Learner 

 

hi all,

 

i wanna create a custom button, this button should be available to add in all the objects' page layout. i wann this button this button in all the objects, users should go to their objects' page layout and add this button and perform the operation!. Is it possible to achieve this functionality? how to do it? Thanks in advance....

 

 

thanks,

abivenkat,

SFDC Learner.

 

hi all,

 

I need all the Fields (Column Names) and its Field Values of a record from an object. Is it possible to retrieve the column names and its corresponding values for multiple records and display it in a table in my visualforce page? 

 

i wanna display the column names on the first column of the table and 1st records values in 2nd column (values must be displayed to the corresponding to the column name in 2nd column) and 2nd records values in 3rd column and 3rd in 4th column. so totally four columns. how to do this, is this possible to do using visualforce page?? please help me as i am new to sfdc.. thanks in advance...

 

thanks,

abivenkat,

SFDC Learner

 

hi all,

 

i am using the <apex:pageMessages> tag in my VisualForce page to display the errors and warnings. my need is,

Is it possible to apply styling for the error messages populated by this tag?

 

how to apply style for the error messages, such as, my error message should be block letters and red in color. how to achieve this??? please help

 

thanks,

abivenkat,

SFDC Learner

 

hi all,

 

i have a custom object. while creating each and every new fields in that object, i have added some lines in the Help Text (to get displayed in the UI, detail page and in edit page as well). while creating or editing or viewing the details page, the question mark (?) near every field describes about it. (i.e,.) working as it is.

 

now, i have created a visualforce page and i have overridden the new record creation page and edit page of that object. In that VF page, i have referred the fields from the custom object only (using inputField component). My problem is, i am not getting that help text (?) in my VF page, while creating a new one and editing the existing one too. how to bring the help text (?) near every field in my VF page... please help me.. 

 

 

thanks, 

abivenkat,

SFDC Learner

 

hi all,

 

i have created a custom component to use it in the visualforce page. There is no problem for me until i use only one component in my VF page, but, when i use more than one custom component in my VF page, it is not recognizing which one is what and cant able to differentiate it. What is the solution to differentiate the components when used in more number. Is there any attribute can solve this problem.

 

I have tried using the default ID attribute, but, still i cant differentiate it.. please suggest me what i have to do to get rid of this..

 

thanks,

abivenkat,

SFDC Learner


I have 3 classes with me. my requirement is i have to access the base class via derived class

1st class is defined as virtual base class for inheritance as shown below  (IncomeTax)

 

public virtual class IncomeTax {
    
    public IncomeTax() {
    }
    
    public virtual string Tax() {
        return '3';
    }
}

2nd class is defined as normal derived class which extends the base class (GovernmentEmp)

 

public with sharing class GovernmentEmp Extends IncomeTax {
    
    public GovernmentEmp() {
    }
    
    public override string Tax() {
        return '5';
    }
}

3rd class is defined as normal derived class which extends the base class (CorporateEmp)

 

public with sharing class CorporateEmp Extends IncomeTax {
    
    public CorporateEmp() {
    }
    
    public override string Tax() {
        return '10';
    }
}

4th is my apex class controller called as ModelPageController. how can i call a method from base class (IncomeTax) in my class. what i have to do to call the method from the base class?  which class i should extend here? 

 

public with sharing class ModelPageController  {
    
    public string PercentVal { get; set; }
    
    public void Percentage() {
        
    }
}

 

does my inheritance method is right or what is mistake am i committing in the above process? please correct my code in which i can extend the classes and use the base class methods via derived class?? (i.e.,) have to access the "IncomeTax" via "GovernmentEmp" or "CorporateEmp" from my controller class called "ModelPageController".. please help me in my simple inheritance functionality..

 

thanks,

abivenkat,

SFDC Learner

 

hi all,

 

What is Virtual? Why we are using Virtual keyword in a class? what it will do? 

Un which cases Virtual keyword is used ? i need some business or normal examples to understand this Virtual concept... please help me.. 

 

 

Thanks,

abivenkat,

SFDC Learner

 

hi,

 

i have a List<sObject>, by looping this list, i wanna compare the values from this list to another string list, for doing this, i have to convert the values from this list to string, so how can i achieve this functionality...?

 

How to convert the sObject values to string???

 

 

Thanks,

abivenkat,

SFDC Learner

Hi All,


This is Ramana,we have an urgent requirement but unable to find the solution.

 

We need to place all sObjects on visualforce page dynamically along with checkboxes for each object.

 

Then after if we search for a record on the same page that should display the records in section wise.(for example if the record found in the account that should come under account section).

 

Any kind of help will be greatly appreciated.

 

Thanks in advance
Ramana

 

My query goes like this:

Select a.Name, a.Id From Account a WHERE OwnerId = 'xyz' AND (Name LIKE '0%' OR Name LIKE '1%' OR Name LIKE '2%' OR Name like '3%' ) order by Name asc

 

This query works well in my developer edition environment, but in enterprise environment it doesnt work (I cannot get any results). Can someone please point me in the right direction?

 

 

 

hi,

 

I am constructing and running a query during the run time in my application based on the user's input. Group By is also used in the query, so i am getting the values in the List<AggregateResult> list and i am converting that list to another list with the use of the wrapper class called List<ListConversion>. Now i am returning this List<ListConversion> List from the controller class and i wanna know how to display the values of the list in the UI using Datatable or pageBlockTable or some other VF components???

 

Note: The point is, while referencing the list values in the pageBlockTable or in DataTable, we should know the Column name to bind it, but, here in this scenario, the column names are dynamic (as shown in the example below). so how to bind the list to the DataTable or pageBlockTable?? 

 

<apex:pageBlockTable columns="2" value="{!ListOfVals}" var="item" id="Table">
<apex:column >
<apex:outputField value="{!item.Name of the first column}" />
<apex:facet name="header">{!Name of the first column}</apex:facet>
 </apex:column>
<apex:column >
<apex:outputField value="{!item.Name of the second column}" />
<apex:facet name="header">{!Name of the second column}</apex:facet>
 </apex:column>
</apex:pageBlockTable> <br />

 

how to bind the dynamic column names.. List is not the ordinary list, it is a list return by the wrapper class called as ListConversion (List<ListConversion>).. Please help me as this is my urgent requirement. Thanks in advance..

 

 

 

Thanks,

abivenkat,

SFDC Learner

hi,

 

I have displayed all the object names in a select list and while an object is selected, i am retrieving the object name and i have to select the field names for it. For this i found that the syntax as given below,

 

Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields;

 

The Account object is hardcoded here, but, in my scenario, object name is dynamically changing, how to modify this syntax into dynamically changing one. any ideas or any other syntax's available to get field names?? 

Or is there any soql query to retrieve the field for the requested object? please provide any ideas or suggestions to retrieve the field names...

 

thanks,

abivenkat,

SFDC Learner

Hi friend,

i have created an visualforce page where i have used <apex:inputFile /> to take any CSV file as input

then i am displaying that CSV file's data into the same vf page in tabular format...

 

but i want that selected CSV's data should be displayed in another vf page. (so by setting attribute renderas="pdf" i can view CSV's data in a PDF format)

 

 

how can i do this?

 

 

here is my code...

 

<apex:page controller="uploadCSVcontroller">
  <apex:form >
  <apex:pageMessages id="pm"/>
  <apex:inputFile value="{!contentFile}" filename="{!nameFile}"/>
  <apex:commandButton value="Display" id="theButton"/>  
  
  
  
  <apex:pageBlock >
  <apex:outputPanel id="results">
  <p>nameFile: {!nameFile}</p>
  <p>rowCount: {!rowCount}</p>
  <p>colCount: {!colCount}</p>
    <table title="CSV Output" border="1" width="100%">
       <apex:repeat value="{!results}" var="row">
           <tr>
               <apex:repeat value="{!row}" var="cell">
                   <td> {!cell} </td>
               </apex:repeat>
           </tr>
       </apex:repeat>
     </table>
  </apex:outputPanel>
  </apex:pageBlock>
  </apex:form>
</apex:page>







Controller


public class uploadCSVcontroller 
  {

    public Blob contentFile { get; set; }
    public String nameFile { get; set; }
    public Integer rowCount { get; set; }
    public Integer colCount { get; set; }
    
    public List<List<String>> getResults() 
    {
        List<List<String>> parsedCSV = new List<List<String>>();
        rowCount = 0;
        colCount = 0;
        if (contentFile != null)
        {
            String fileString = contentFile.toString();
            parsedCSV = parseCSV(fileString, False);
            rowCount = parsedCSV.size();
            for (List<String> row : parsedCSV)
            {
                if (row.size() > colCount)
                {
                    colCount = row.size();
                }
            }
        }
        return parsedCSV;
    }
    
    public Pagereference CreatePDF()
     {
      pagereference pr = new pagereference('/apex/FinalReport1');
      pr.setredirect(true);
      return pr;
     }
    
    public static List<List<String>> parseCSV(String contents,Boolean skipHeaders) 
     {
        List<List<String>> allFields = new List<List<String>>();
        contents = contents.replaceAll(',"""',',"DBLQT').replaceall('""",','DBLQT",');
        contents = contents.replaceAll('""','DBLQT');
        List<String> lines = new List<String>();
        try 
        {
          lines = contents.split('\r'); // using carriage return accomodates windows, unix, and mac files
        }
        catch (System.ListException e) 
        {
            System.debug('Limits exceeded?' + e.getMessage());
        }
        Integer num = 0;
        for(String line: lines) 
        {
           if (line.replaceAll(',','').trim().length() == 0) break;
            List<String> fields = line.split(',');  
            List<String> cleanFields = new List<String>();
            String compositeField;
            Boolean makeCompositeField = false;
            for(String field: fields) 
            {
                if (field.startsWith('"') && field.endsWith('"')) 
                {
                    cleanFields.add(field.replaceAll('DBLQT','"'));
                }
                else if (field.startsWith('"')) 
                {
                    makeCompositeField = true;
                    compositeField = field;
                }
                else if (field.endsWith('"')) 
                {
                    compositeField += ',' + field;
                    cleanFields.add(compositeField.replaceAll('DBLQT','"'));
                    makeCompositeField = false;
                }
                else if (makeCompositeField) 
                {
                    compositeField +=  ',' + field;
                }
                else
                {
                    cleanFields.add(field.replaceAll('DBLQT','"'));
                }
            }
            
            allFields.add(cleanFields);
        }
        if (skipHeaders) allFields.remove(0);
        return allFields;       
     }

}

 

 

 

Thanks,

Amit Singh

 

hi all,

 

i have a custom component in my visualforce page. There is a Textbox in my custom component where users enters some value. I have to pass that Textbox value to my Visualforce page. Now how to pass the textbox value from that custom component to visualforce page??? i thought it was easy, but, i cant get the textbox value from the custom component.

 

i wann that textbox value in my visualforce page or in my page's controller class at least.. please help me to achieve this functionality!!

 

thanks,

abivenkat,

SFDC Learner

 

hi,

 

i want to create a Value attribute for my custom component. "Value" attribute is the one which is used to get the value in the corresponding controller class in all the default visualforce components. how to create that "Value" attribute for my custom component? we use this "Value" attribute to pass our values to controller class, we retrieve this by putting get, set in controller class, now how can i do in this??

 

for example :

<apex:page controller="Sample">

<c:sampleComp Value="{!ControllerClass}" />

</apex:page>

 

i want to pass that value attribute to the controller class called "Sample". Then how should i code this attribute to work like above??

i need any code example to achieve this functionality.. please help me..

 

thanks,

abivenkat,

SFDC Learner

 

 

hi all,

 

i wanna retrieve all the objects' names (display that to the user) and fields from the object name (chosen by the user). To get the object name, i am tryin to use the describe methods like below:

 

1. describeGlobal()

2. describeDataCategoryGroups()

3. describeDataCategoryGroupStructures()

4. describeLayout()

5. describeSObject()

6. describeSObjects()

7. describeSoftphoneLayouts()

8. describeTabs()

 

i cant use these methods in salesforce Class page. if i use these methods, it is throwing me some error like  

 

Error: Compile Error: Method does not exist or incorrect signature: connection.describeGlobal()

 

and more errors similar to the above ones.. what i have to do to resolve this problem, how should i make use of these default methods provided for salesforce.? please help and guide me how to use these methods to retrieve the object names and its fields on the selection of the object?

 

is there any other syntax or method available for taking the object name and again taking the fieldname to show from the DataBase? help me in doing this

 

Thanks,

abivenkat,

SFDC Learner.

I wish to access a List ("alist" in the below attribute) that is passed in a custom component. I am having trouble accessing it. Here is my custom component:

<apex:component controller="testController" >
    <apex:attribute name="title" description="This is the title of the component" type="String" required="true"/>
    <apex:attribute name="count" description="This is the count of the component" type="String" required="true"/>
    <apex:attribute name="color" description="Color to set as background" type="String" required="true"/>
    <apex:attribute name="alist" description="A list of values" type="List" required="false"/>
</apex:component>

 

Here is my controller:

public with sharing class testController {

    public String title {get; set;}
    public List<String> alist {get; set;}
    public List<cValue> customWrap {get; set;}
    
    public testController() {
        System.debug('Title of ::'+title);
        System.debug('Entering custom controller.');
        customWrap = new List<cValue>();
        System.debug('alist in testcontroller::'+alist);
    }
    
    public class cValue {
        public String con {get; set;}
        public Integer value {get; set;}
    
        public cValue(String country, Integer val) {
            con = country;
            value = val;
        }
    }
}

And this is how I call my custom component in the VF page:

 

<c:TestSubPageBlock title="Test" count="3" color="#342145" alist="{!ListOfValues}"></c:TestSubPageBlock>

 

  • December 12, 2011
  • Like
  • 0