• Chandra Prakash Pandey
  • NEWBIE
  • 105 Points
  • Member since 2014
  • Metacube Software Pvt. Ltd.

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 16
    Replies
While visualforce page is loading, automatically 10 records have to insert into the particual object that you specify. How do I have to ahcieve this?
Hello, 

I am trying to group results in a list by a field value, and am getting stuck.   I am using this article as a model: http://blog.jeffdouglas.com/2011/03/02/dynamically-group-display-query-results/

Here is my controller: 
 
public with sharing class SpotController{

public List <Job_Number__c> SPOT {get;set;}
public String[] campaigns {get;set;}

public void load() {

  SPOT = [Select id, name, Thumbnail_URL__c, ISCI__c, Title__c, Project__c, Campaign__r.Name from Job_Number__c WHERE Currently_Airing__c = TRUE];
  
  Set<String> campaignSet = new Set<String>();
  for (Job_Number__c j : SPOT)
      campaignSet.add(j.Campaign__r.Name);
      
      campaigns = new String[campaignSet.size()];
      Integer i = 0;
      for (String campaign : campaignSet) {
      campaigns[i] = campaign;
      i++;
        }
    }
}
But 
and here is my vf page: 
 
<apex:page controller="SpotController" action="{!load}">
<html>

  <apex:repeat value="{!campaigns}" var="campaign">

    <apex:pageBlock title="{!campaign}">

      <apex:repeat value="{!SPOT}" var="spot">
      
          {!SPOT.name} 

        <apex:outputPanel >
      
        </apex:outputPanel>

      </apex:repeat>

    </apex:pageBlock>

  </apex:repeat>

</html>
</apex:page>


But I am getting an error when I try to pull in any fields from the Job_Number__c object.  Error: Unknown property 'VisualforceArrayList.name'

Can anyone help?  Thanks so much in advance!
I have an opprtunty plan page where i want to put a rectangle which is divided in four part under one section so I can put text in all four box. or another wat I want to create 4 text box with single name.
It's just like a single page divided in four equal part.
plz help!

 
I am trying to upload file attachment through javascript remoting. Code is working fine in Chrome/Mozilla/IE-10/IE-10+.
But code is not working in IE-9 Browser. I did little investigation and found IE9 doesn't support File Api.
In IE9 i get file undefined or null error.
My file upload code is:
function uploadFile() 
{
var file = document.getElementById('attachmentFile').files[0];
if(file != undefined)

if(file.size <= maxFileSize) 
{
attachmentName = file.name;
var fileReader = new FileReader();
fileReader.onloadend = function(e) {
var binary = "";
var bytes = new Uint8Array(e.target.result);
var length = bytes.byteLength; 
for (var i = 0; i < length; i++) 
{
binary += String.fromCharCode(bytes[i]);

attachment = (new sforce.Base64Binary(binary)).toString();  //Base 64 encode the file before sending it 
positionIndex = 0; 
fileSize = attachment.length; 
doneUploading = false; 
if(fileSize < maxStringSize) 
{
uploadAttachment(null);

else 
{
alert("Base 64 Encoded file is too large. Maximum size is " + maxStringSize + " your file is " + fileSize + ".");
}

fileReader.onerror = function(e) {
alert("There was an error reading the file. Please try again.");

fileReader.onabort = function(e) {
alert("There was an error reading the file. Please try again.");

fileReader.readAsArrayBuffer(file);

else 
{
alert("File must be under 4.3 MB in size. Your file is too large. Please try again.");
}

else 
{
alert("You must choose a file before trying to upload it");
}
}

I am heavily working on client side and i want to achieve this functionality by remote call.
any suggestions would be helpful.
Thanks in advance.
Hi All,


How to get value present in max index in List<String> using Map!!!!!!!.. Can anybody share some examples..

Regards
How can we display 70,000 records in vf page?

I hope its not possible becuase the limit for vf page is 10,000 records, Is there any other work around for it, If so please help me
Hi,
   I got a response this, here i want to read the data from the response.
can you please help me in this, can you give sample code for this.
How can we read the data from xml?

<?xml version="1.0" encoding="utf-16"?>
<Getmessage xms:xi="http://www.hello.com" xms:xd="http://www.hello.com">
<errorcode>2002</errorcode>
<errormessage>got error</errormessage>
</GetMessage>
While visualforce page is loading, automatically 10 records have to insert into the particual object that you specify. How do I have to ahcieve this?
Hi,

We have a VisualForce (VF) page that renders as a pdf. I have an automated email that is going to be trigger when criteria A, b, and C are met. 

How can i attach the pdf from the VF page as an email attachment in the automated email that is sent from an apex trigger or class?
  • October 25, 2015
  • Like
  • 1
Hello, 

I am trying to group results in a list by a field value, and am getting stuck.   I am using this article as a model: http://blog.jeffdouglas.com/2011/03/02/dynamically-group-display-query-results/

Here is my controller: 
 
public with sharing class SpotController{

public List <Job_Number__c> SPOT {get;set;}
public String[] campaigns {get;set;}

public void load() {

  SPOT = [Select id, name, Thumbnail_URL__c, ISCI__c, Title__c, Project__c, Campaign__r.Name from Job_Number__c WHERE Currently_Airing__c = TRUE];
  
  Set<String> campaignSet = new Set<String>();
  for (Job_Number__c j : SPOT)
      campaignSet.add(j.Campaign__r.Name);
      
      campaigns = new String[campaignSet.size()];
      Integer i = 0;
      for (String campaign : campaignSet) {
      campaigns[i] = campaign;
      i++;
        }
    }
}
But 
and here is my vf page: 
 
<apex:page controller="SpotController" action="{!load}">
<html>

  <apex:repeat value="{!campaigns}" var="campaign">

    <apex:pageBlock title="{!campaign}">

      <apex:repeat value="{!SPOT}" var="spot">
      
          {!SPOT.name} 

        <apex:outputPanel >
      
        </apex:outputPanel>

      </apex:repeat>

    </apex:pageBlock>

  </apex:repeat>

</html>
</apex:page>


But I am getting an error when I try to pull in any fields from the Job_Number__c object.  Error: Unknown property 'VisualforceArrayList.name'

Can anyone help?  Thanks so much in advance!
I have an opprtunty plan page where i want to put a rectangle which is divided in four part under one section so I can put text in all four box. or another wat I want to create 4 text box with single name.
It's just like a single page divided in four equal part.
plz help!

 
How to disable picklist value once it has been chosen in apex page block table.
give me  Replay for this Questions  
1.we can write Batch class schedule class  at a time in same class..? 
2. How many number of External Id records displaying for page?
​ 3.what is advantage of limitations,why we use?