• vmanumachu1.393650924860069E12
  • NEWBIE
  • 299 Points
  • Member since 2014

  • Chatter
    Feed
  • 10
    Best Answers
  • 0
    Likes Received
  • 15
    Likes Given
  • 2
    Questions
  • 44
    Replies
Is there a way to remove the "Quote Acceptance Information" section on the pdf template on Quotes.  We need to be able to modify so that we can include multiple signers to the document.  Please advice. 
  • August 11, 2014
  • Like
  • 0
So the company has an ID that is being pushed from a third party to a contact record in SF. But we also need this info on the account the contact is associated with (mind you we have one contact to one account *it was already setup that way before i got the job*). So im trying to buidl a trigger that when a data is updated on the contact it will push that info onto the assoicated account. Below is what i have peiced together so far but i keep getting this 'missing EOF at (parentobjlist) error when i try to save it. Can anyone help...

 

trigger pushRevelID on Contact (after insert, after update) {

 

List<Account> parentObjList = new List<Account>();

List<Id> listIds = new List<Id>();

List<Contact> newRevel = new Contact[]{};

 

for (Contact childObj : Trigger.new {

listIds.add(childObj.Account);

newRevel.put(childObj.Account, Contact);

}

 

parentObjList = [SELECT id, Name FROM Account WHERE ID IN :listIds]; (ERROR HAPPENING ON THIS LINE)

 

for (Account acct : parentObjList){

acct.Revel_ID__c = newRevel.get(acct.Id).Revel_ID__c;

}

 

update parentObjectList;

 

}


Hi, I am looking for assistance to write an apex trigger to execute a cusom button on my custom object when I change the state of a check box (via apex loader) from false to true.

My custom field is First_Email_Sent__c and my custom button is Conga_First_Email My custom object is called Sabre_Hotels (Sabre_Hotels__c)

thanks you in advance for any assistance.

David
What is the most effective way to activate or inactivate the triggers or validation rules of an sObject programmatically ?
I am trying to create a custom delete button on an objectA which deletes the particular record only if the value in fieldA matches the Role of the logged in user. If it does not match it needs to throw an error. I was trying to use 'OnClick javascript". Can anyone help me wit the code? Thanks!
Public Class vfcontrol{
public List<selectoption> selectedObject {get; set;}
public vfcontrol()
{
selectedObject = new List<selectoption>();
}
Public void Objectnames()
{
for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()){
String name = objTyp.getDescribe().getName(); 
selectedObject.add(new SelectOption(name));
}
}
}
Error:Compile Error: Constructor not defined: [System.SelectOption].<Constructor>(String
I have placed a custom button on a Case List view.  The button, when clicked, needs to validate whether any case records were actually selected.  That part is done simply with a Javascript OnClick button with the following code:

{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")} 

var selected = {!GETRECORDIDS($ObjectType.Case)}; 

if (selected[0] == null) { 

    alert("Please select at least one Case.")
} 

else {

     window.location = 'apex/MyPage';
}

The problem is that when validation passes (i.e. it goes to the MyPage visualforce page) the selected records aren't passed along.  Here is my VF page thus far:

<apex:page standardController="Case" recordSetVar="cases">
   <apex:form >
       <apex:pageBlock title="MyPage" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="MyButton"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Information" columns="2">
                <apex:inputCheckBox value="{!case.test__c}" selected="true" required="true"/>
                <apex:pageBlockSectionItem />
                <apex:inputField value="{!case.test2__c}" showDatePicker="true" required="true"/>
                <apex:inputField value="{!case.test3__c}" showDatePicker="true" required="true"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Selected Cases">
                <apex:pageBlockTable value="{!selected}" var="case">
                    <apex:column value="{!case.casenumber}"/>
                    <apex:column value="{!case.subject}"/>
                    <apex:column value="{!case.status}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>   
</apex:page>
The goal is to have the custom button on the List view validate whether records are checked, then when validation passes have those records displayed in the block table on the VF page.  I can get one or the other to work, but not both at the same time.  If I change the button to go directly to the VF page, the selected records appear perfectly, but no validation occurs (i.e. it allows redirect when no records are selected).  If I have the button set to the Javascript code it validates the records but doesn't display the selected records on the VF page.

I have searched the internet for hours on everything I could think of and couldn't find anything to help me.  

Can anyone out there offer a solution?

THANKS!!
Hi,

Can anyone advise on how to do this via Apex and Visualforce?  Or other ways and means? 

Any help is greatly appreciated!

Thanks,
Shirley Maglio
Hi,

I have a cutom object named Custom__c. THis object consists almost 400 fields. This application is fully built on VF pages. During a record conversion process, based on certain conditions I want to create a Custom__c object record and this record should have field values copied from the existing Custom__c object record and this record should have a different record type values. 
Our Administrator should have the flexibility to be able to add and remove the fields the needs to be copied over. Hence, I am planning to use fieldsets instead of querying the existing fields. Can someone suggest a sample code that can fulfill this requirement.

Thank You In advance for the help!!
Hi 
help me out on yhis requirement little urgency.i got one requirement that on case obect hat we have to caliculate the time difference between when the status is changed from  "working"  to status="closed" not the immediate change like after working it can go to any other change also then closed.i have written trigger but it is not working properly.can anybosy look in to this and help me out .

Public Class DateTimeDifferenceTriggerHelperClass
{
     public static Datetime Date1;
    public static Datetime Date2;                             
    Public static String DateDiff;                        
    Public static boolean ETMcheck = false; 


    Public static boolean Closecheck = false;
   public static  string DateTimeDiffCalcMethod(Map<Id,Case> caseId)
    {
            
   
    list<CaseHistory> casHistList = new list<CaseHistory>();
        casHistList = [SELECT CaseId,NewValue,CreatedDate,case.testtextfield__c FROM CaseHistory WHERE CaseId =:caseId.KeySet() ORDER BY CreatedDate ASC NULLS LAST];
  
  
    if(casHistList.size() > 0)
    {
   // datetime Date1;
    //datetime Date2;
        for(CaseHistory ch : casHistList)
        {
            if(ch.NewValue == 'Working' && ETMcheck == false)
            {
                Date1 = ch.CreatedDate;
                ETMcheck = true;
            }
            if(ch.NewValue == 'closed' && Closecheck == false)
            {
                  Date2 = ch.CreatedDate;
                Closecheck = true;
            }
        }
    }
  
    if(Date1 != null && Date2 != null)
    {
 
  
        integer Days = math.round(math.floor(Double.valueOf((Date2.getTime() - Date1 .getTime())/(1000*60*60*24))));  
        integer Hours = math.mod(integer.valueOf((Date2 .getTime() - Date1 .getTime())/(1000*60*60)),24);                          
        integer Minutes = math.mod(Integer.valueOf((Date2 .getTime() - Date1 .getTime())/(1000*60)),60);                            
      
        system.debug(Days +'***Days*** ' + '***Hours*** ' + Hours + '***Minutes*** ' + Minutes);
      
        DateDiff = Days + ' Days  ' + Hours + ' Hours  ' + Minutes + ' Minutes';

}
    
      system.debug('DateDiff@@@'+DateDiff);
      return DateDiff ;
        }
      
        }

Trigger:

trigger DateTimeDifferenceTriggerHelperClasstrigger on Case (before update) {

  If(trigger.isbefore && trigger.isUpdate)
    {
trigger.new[0].difffield__c =DateTimeDifferenceTriggerHelperClass.DateTimeDiffCalcMethod(trigger.newmap);
  }                     
}

difffield__c field is not populating properly..


regards,
isha

I am new to salesforce and would like to know the ideal IDE for apex development. I tried Developer Console, but  for beginners its very difficult to code in that. What are IDE tools that are generally used in industry?
Is there a way to remove the standard clone button from a page layout in salesforce?
I have created the below Visualforce page which gets the data for the Opportunity object from the user. The Opportunity object has a field - Account name which contains a lookup to the Account object. But when I refer it through the Inputfield using {!opportunity.account.name}, it is displayed as a text box and not as a lookup field to Account object. Can someone please tell me how to modify the code? 

<apex:page controller="opptycontroller" tabStyle="Opportunity">
<apex:sectionHeader title="New Customer Opportunity" subtitle="Step 2 of 3"/>
    <apex:form >
        <apex:pageBlock title="Opportunity information" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!step3}" value="Next"/>
            </apex:pageBlockButtons>
        <apex:pageBlockSection title="Opportunity products">
            <apex:inputField id="opportunityType" value="{!opportunity.type}"/>
            <apex:inputField id="opportunityLeadSource" value="{!opportunity.LeadSource}"/>
            <apex:inputField id="opportunityProbability" value="{!opportunity.Probability}"/>
           <apex:inputField id="opportunityAccountName" value="{!opportunity.account.name}"/>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Is there a way to remove the "Quote Acceptance Information" section on the pdf template on Quotes.  We need to be able to modify so that we can include multiple signers to the document.  Please advice. 
  • August 11, 2014
  • Like
  • 0
So the company has an ID that is being pushed from a third party to a contact record in SF. But we also need this info on the account the contact is associated with (mind you we have one contact to one account *it was already setup that way before i got the job*). So im trying to buidl a trigger that when a data is updated on the contact it will push that info onto the assoicated account. Below is what i have peiced together so far but i keep getting this 'missing EOF at (parentobjlist) error when i try to save it. Can anyone help...

 

trigger pushRevelID on Contact (after insert, after update) {

 

List<Account> parentObjList = new List<Account>();

List<Id> listIds = new List<Id>();

List<Contact> newRevel = new Contact[]{};

 

for (Contact childObj : Trigger.new {

listIds.add(childObj.Account);

newRevel.put(childObj.Account, Contact);

}

 

parentObjList = [SELECT id, Name FROM Account WHERE ID IN :listIds]; (ERROR HAPPENING ON THIS LINE)

 

for (Account acct : parentObjList){

acct.Revel_ID__c = newRevel.get(acct.Id).Revel_ID__c;

}

 

update parentObjectList;

 

}


Hi i have a simple table need to add to Contact object which will show top 5 cases from that contact sort by case number.

i need to create a visualforce page table to display 4 columns:

1) Case Number
2) Case Subject
3) Origin
4) Status

I wanted the Case Number to be clickable meaning if i click on the case number it will direct me to the case details

any suggestion?
Hi Dears,

I want to enable Assign using active assignment rules via backend , not from pagelayout. please assist on this.

User-added image
Hi, I am looking for assistance to write an apex trigger to execute a cusom button on my custom object when I change the state of a check box (via apex loader) from false to true.

My custom field is First_Email_Sent__c and my custom button is Conga_First_Email My custom object is called Sabre_Hotels (Sabre_Hotels__c)

thanks you in advance for any assistance.

David
What is the most effective way to activate or inactivate the triggers or validation rules of an sObject programmatically ?
Hi
I have three fields that base on a picklist ‘postcode’ in my custom object ‘Address’.
I want write a code to auto fill fields (Country, State,... ) base on the “Post code”. So if a user change value on pick list it should directly populate value to others text fields.
I know that there are different ways to do it but there are not proper for this example.
• Write apex and use trigger, it is work but after saving the record.
• Workflow formula has limited length and in this case we have 290 “Post code” so formula becomes an out of size
• The last one is use VisualForce page with apex class. This one is work if I want create the page from scratch or override the page.

My question is how can I create a customize “Address” to modify the page?  Like add “event="onchange"” to pick list or send value to extension controller.
Or if there is another way to solve this problem.

Thanks in Advance.
I am trying to create a custom delete button on an objectA which deletes the particular record only if the value in fieldA matches the Role of the logged in user. If it does not match it needs to throw an error. I was trying to use 'OnClick javascript". Can anyone help me wit the code? Thanks!

I currently have numberous account record types.  For one specific record type "CSLS" we are using a tabbed Visualforce page that all users can see if they access this specific record type.  When viewed this record type has 7 tabs, based on the related list associated with it.     The current tabbed account VF page is redirecting the user to the page via the Button, Links and Actions override "View" section.
I would like to have another tabbed VF page for record type "AR" but exclude 3 of the seven tabs from view based on the users profile. 
I have created a new tabbed VF page for the "AR" record type that only displayes the 4 tabs needed but how do I incorporate the two pages so the correct tabs are viewed based on the record type and profile?   Thank you in advance for any insight or feedback you can provide.

I had tried three methods. When i write in the page like contentType="application/vnd.ms-excel#ConsignmentSearchData.csv" or contentType="application/octet-stream#record.csv" or contentType="text/csv#filename.csv" it is giing me the code of the page in the cvs file.
Public Class vfcontrol{
public List<selectoption> selectedObject {get; set;}
public vfcontrol()
{
selectedObject = new List<selectoption>();
}
Public void Objectnames()
{
for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()){
String name = objTyp.getDescribe().getName(); 
selectedObject.add(new SelectOption(name));
}
}
}
Error:Compile Error: Constructor not defined: [System.SelectOption].<Constructor>(String
We have 3 Lead Record Types: Interior Extended Conversion, Interior Quick Convert and Interior Trad Show Lead

If we create any of the mentioned leads and then convert them to an Account and Opportunity using the convert button, is there a way to specify which type of account and opportunity it will be saved as? 

For example:

If the lead record type is "Interior Quick Convert" it should map to:
1. Account Record Type: Interior Contractor
2. Opportunity Record Type: Interior Quick Convert Opportunity


Another example:

If the lead record type is "Interior Extended Conversion" it should map to:
1. Account Record Type: Interior Contractor
2. Opportunity Record Type: Interior Contractor

Any direction on how to accomplish this would be appreciated. 

Thanks!
JH
I have placed a custom button on a Case List view.  The button, when clicked, needs to validate whether any case records were actually selected.  That part is done simply with a Javascript OnClick button with the following code:

{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")} 

var selected = {!GETRECORDIDS($ObjectType.Case)}; 

if (selected[0] == null) { 

    alert("Please select at least one Case.")
} 

else {

     window.location = 'apex/MyPage';
}

The problem is that when validation passes (i.e. it goes to the MyPage visualforce page) the selected records aren't passed along.  Here is my VF page thus far:

<apex:page standardController="Case" recordSetVar="cases">
   <apex:form >
       <apex:pageBlock title="MyPage" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="MyButton"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Information" columns="2">
                <apex:inputCheckBox value="{!case.test__c}" selected="true" required="true"/>
                <apex:pageBlockSectionItem />
                <apex:inputField value="{!case.test2__c}" showDatePicker="true" required="true"/>
                <apex:inputField value="{!case.test3__c}" showDatePicker="true" required="true"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Selected Cases">
                <apex:pageBlockTable value="{!selected}" var="case">
                    <apex:column value="{!case.casenumber}"/>
                    <apex:column value="{!case.subject}"/>
                    <apex:column value="{!case.status}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>   
</apex:page>
The goal is to have the custom button on the List view validate whether records are checked, then when validation passes have those records displayed in the block table on the VF page.  I can get one or the other to work, but not both at the same time.  If I change the button to go directly to the VF page, the selected records appear perfectly, but no validation occurs (i.e. it allows redirect when no records are selected).  If I have the button set to the Javascript code it validates the records but doesn't display the selected records on the VF page.

I have searched the internet for hours on everything I could think of and couldn't find anything to help me.  

Can anyone out there offer a solution?

THANKS!!
Hello,

I am using query in Ajax to get records from Standard as well as Custom Objects. What is the maximum of records I can get through this.
I know that Apex Governor limits : 50000 rows at max .

But when  I am query through Ajax, i get more than 50,000 records (rows).
How is this possible.

My Code is as :
------------------------------------------------------------------------------------------------------------------

var exeQuery="Select id from Contact" ;

sforce.connection.query(exeQuery);

----------------------------------------------------------------------------------------------------------
I currently only have a standard developer edition for sanbox and not the developer pro. I would like to refresh the sandbox and import the data from production for testing purposes. What is the best way to do this? Should I use Talend? create the mapping and the rules. Can I potentially use the weekly scheduled and the current job I create and change the mapping to naother file later on and the file/folder with the cvs of Salesforce objects backup will be updated weekly? Or should I use Data loader ot do this? I know validations need to be turned off, is there a way this can be done without turning the validations off (perhaps through talend). 
Hi, I am looking for assistance to write an apex trigger to execute a cusom button on my custom object when I change the state of a check box (via apex loader) from false to true.

My custom field is First_Email_Sent__c and my custom button is Conga_First_Email My custom object is called Sabre_Hotels (Sabre_Hotels__c)

thanks you in advance for any assistance.

David
hi
what are types of testing in Salesforce by whom they are tested

Thanks & Regards
sandeep

Want to do pagination on Task object.So far i've implemented inline edit and search box in it.The doc says StandardsetController does not support Task,hence i'm trying to implement it by using Offset.Referring to http://cloudfollowsdotcom.wordpress.com/2012/12/27/soqloffset/ for pagination .How do implement it ? I'm stucked and really pissed off. Experts please help.



 <apex:page standardController="Task" recordSetVar="tasks" extensions="TaskSearchController">
   <apex:enhancedlist type="Activity" height="800" rowsPerPage="50" customizable="False"/>

   <apex:form id="searchForm">
   <apex:PageBlock mode="inlineEdit">      
   <apex:pageblockSection id="searchBlockSection">
      <apex:pageBlockSectionItem id="searchBlockSectionItem">
      <apex:outputLabel >Keyword</apex:outputLabel>
      <apex:panelGroup >
            <apex:inputtext id="searchTextBox" value="{!searchText}">
            </apex:inputtext>
            <apex:commandButton Id="btnSearch" action="{!Search}" rerender="renderBlock" status="status" title="Search" value="Search">                    </apex:commandButton>
        </apex:panelGroup>
    </apex:pageBlockSectionItem>
</apex:pageblockSection>
<apex:actionStatus id="status" startText="Searching... please wait..."/>      
<apex:pageBlocksection id="renderBlock" >
    <apex:pageblocktable value="{!SearchResults}" var="o" rendered="{!NOT(ISNULL(SearchResults))}">
        <apex:outputLink value="/{!o.Id}">{!o.Subject}</apex:outputLink>
        <apex:column value="{!o.Subject}"/>
    </apex:pageblocktable>     
</apex:pageBlocksection>


// apex

public class TaskSearchController
{
   public apexpages.standardController controller{get;set;}
   public Task l;
   public List<Task> searchResults {get; set; }

  public string searchText
  {
   get
   {
     if (searchText==null) searchText = '';
     return searchText;
   }
  set;
   }

public TaskSearchController(ApexPages.StandardController controller)
{
    this.controller = controller;
    this.l = (Task) controller.getRecord();
  }

public PageReference search()
{
  if(SearchResults == null)
  {
    SearchResults = new List<Task>();
  }
else
{
    SearchResults.Clear();
}

  String qry ='Select Id, Subject,Status from Task where Subject like \'%'+searchText+'%\' OR Status like \'%'+searchText+'%\' OR OwnerId like  \'%'+searchText+'%\' Order By Subject,Status';

  SearchResults = Database.query(qry);
  //System.debug(SearchResults);
  return null;
  }
}
Hi,
     Actually i displayed all fields dynamically in an visualforce page.I want In my fields Multipicklist fields are there .How to display Multipicklist fields as Checkboxes Dynamically?

help me.........
Hello smart people!

I am a real beginner at saleforce and just cannot seem to get a google map to appear on my custom object.  I cannot for the life of me figure out what I have done wrong.  Do I need a zip code field?

Here is what I have:

<apex:page standardController="Event_Manager__c">

<head>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {

  var myOptions = {
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    mapTypeControl: false
  }

  var map;
  var marker;

  var geocoder = new google.maps.Geocoder();
  var address = "{!Event_Manager__c.Street_Address__c}, " + "{!Event_Manager__c.City__c}";

  var infowindow = new google.maps.InfoWindow({
    content: "<b>{!Event_Manager__c.Name}</b><br>{!Event_Manager__c.Street_Address__c}<br>{!Event_Manager__c.City__c}<br>"
  });

  geocoder.geocode( { address: address}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK && results.length) {
      if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {

        //create map
        map = new google.maps.Map(document.getElementById("map"), myOptions);

        //center map
        map.setCenter(results[0].geometry.location);

        //create marker
        marker = new google.maps.Marker({
            position: results[0].geometry.location,
            map: map,
            title: "{!Event_Manager__c}"
        });

        //add listeners
        google.maps.event.addListener(marker, 'click', function() {
          infowindow.open(map,marker);
        });
        google.maps.event.addListener(infowindow, 'closeclick', function() {
          map.setCenter(marker.getPosition());
        });

      }

    } else {
      $('#map').css({'height' : '15px'});
      $('#map').html("Oops! {!Event_Manager__c.Name}'s billing address could not be found, please make sure the address is correct.");
      resizeIframe();
    }
  });

  function resizeIframe() {
    var me = window.name;
    if (me) {
      var iframes = parent.document.getElementsByName(me);
      if (iframes && iframes.length == 1) {
        height = document.body.offsetHeight;
        iframes[0].style.height = height + "px";
      }
    }
  }

});
</script>

<style>
#map {
  font-family: Arial;
  font-size:12px;
  line-height:normal !important;
  height:250px;
  background:transparent;
}
</style>

</head>

<body>
<div id="map"></div>
</body>
</apex:page>


Thank you in advance anyone who takes the time to look at this
Fellow Salesforce Developers- Sign up for [topcoder] to participate in challenges, learn new skills, and earn some extra money.  There's $79k worth of prizes up for grabs right now with projects across lots of different technologies. 

Help me reach my referral goal by signing up at this link and activating your account:
http://www.topcoder.com/?action=callback&utmSource=psappirio&utmCampaign=ReferralProgram&utmMedium=Appirio

Hello

I have been trying to work in Professional edition where apex classes are not supported. Here is a currency field in opportunities called "recent sale". So, here I need to create a visualforce page and use it to create a dashboard which should show the percentage of total of "recent value" field of all the opportunity records having status as "Closed Won" against the total of "recent value" field of all the opportunity records.

For example, if I am having 100 opportunity records, each having "recent value" as $10.0, and having 25 records among those with status as "Closed won", then the percentage needed here is (25*10)*100/100*10. i.e. the percentage of total "recent value" of "Closed Won" opportunities only.

So, I have been tryin to create a VF for this purpose. Following is the code I am using:

<apex:page showHeader="false" sidebar="false" standardStylesheets="true">


<script src="/soap/ajax/9.0/connection.js" type="text/javascript"></script>

<script type="text/javascript">
    function initPage() {
          sforce.connection.sessionId = '{!$Api.Session_ID}';
          var closedWonOpp = sforce.connection.query("SELECT StageName, Most_Recent_Value__c FROM Opportunity where StageName = 'Closed Won'");
          var Opp = sforce.connection.query("SELECT StageName, Most_Recent_Value__c FROM Opportunity");
  
          var msvcw=0;
          var msvopp=0;
          for (var i=0; i<closedWonOpp.records.length; i++){
                 msvcw=msvcw + parseInt(closedWonOpp.records[i].get("Recent_Value__c"));         
          }
   
         for (var i=0;i<Opp.records.length;i++){
                 msvopp=msvopp+ parseInt(Opp.records[i].get("Recent_Value__c"));
          }
  
         var p=0;
         var p=msvcw*100/msvopp;
         alert("Recent value ercentage of closed won records is :" +p+"%");

     }

  </script>
 
    <apex:form >
        <apex:commandButton value="click" onclick="initPage();"/>
    </apex:form>  
</apex:page>


On click of the button, I am able to get all the correct percentage value in the dialogue box. But not able to figure out how to put them into the visualforce page and create a dashboard.

NOTE: Apex classes can't be used.

I have placed a custom button on a Case List view.  The button, when clicked, needs to validate whether any case records were actually selected.  That part is done simply with a Javascript OnClick button with the following code:

{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")} 

var selected = {!GETRECORDIDS($ObjectType.Case)}; 

if (selected[0] == null) { 

    alert("Please select at least one Case.")
} 

else {

     window.location = 'apex/MyPage';
}

The problem is that when validation passes (i.e. it goes to the MyPage visualforce page) the selected records aren't passed along.  Here is my VF page thus far:

<apex:page standardController="Case" recordSetVar="cases">
   <apex:form >
       <apex:pageBlock title="MyPage" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="MyButton"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Information" columns="2">
                <apex:inputCheckBox value="{!case.test__c}" selected="true" required="true"/>
                <apex:pageBlockSectionItem />
                <apex:inputField value="{!case.test2__c}" showDatePicker="true" required="true"/>
                <apex:inputField value="{!case.test3__c}" showDatePicker="true" required="true"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Selected Cases">
                <apex:pageBlockTable value="{!selected}" var="case">
                    <apex:column value="{!case.casenumber}"/>
                    <apex:column value="{!case.subject}"/>
                    <apex:column value="{!case.status}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>   
</apex:page>
The goal is to have the custom button on the List view validate whether records are checked, then when validation passes have those records displayed in the block table on the VF page.  I can get one or the other to work, but not both at the same time.  If I change the button to go directly to the VF page, the selected records appear perfectly, but no validation occurs (i.e. it allows redirect when no records are selected).  If I have the button set to the Javascript code it validates the records but doesn't display the selected records on the VF page.

I have searched the internet for hours on everything I could think of and couldn't find anything to help me.  

Can anyone out there offer a solution?

THANKS!!
I'm trying to render a second pageblock table, when a user clicks on a row with an outputlink in the first page block... Any thoughts on how/if I can do this?  I wrote a custom controller, but I can't get anything to display in the second block and the debug log isn't showing any indication that I'm clicking on a row in the first block.  I'm new to VF and having a tough time getting past this.
HI,
i have created a custom field in account object called Prevoius Fiscal Year Revenue.
This field needs to be created and should allow for population via batch apex that can be run when the year ends.  Button to start batch should be available on the account Detail page.

Can some body give suggestion on how to create a button to achieve functinality.

Thanks in advance
Hi,

I want to create a visualforce page like Advanced filters in List View.

I will give the Rule Criteria like 1 OR (2 AND 3) and Apex should query the object accordingly. I have tried replacing the numbers with field names and generating a dynamic query but it's not helping.

Please help.
i have written one trigger for account which is firing when  Account has some child account... the parent account has one checkbox which is becoming true when it has child account in its hierarchy. after deploying it to production i am getting this error.

IsParentCheckboxTrig: System.LimitException: Too many SOQL queries: 101

kidly help me to resolve this error.

Thanks!!

Below is the Trigger:

trigger IsParentCheckboxTrig on Account ( after insert,after update) {

if(!RecursionControl.stoprecursion4)
{

set<Id> AccIds= new set<Id>();
set<Id> AccIds1 = new set<Id>();
Map<Id,Id> accmap = new Map<Id,Id>();

if (trigger.Isinsert){
    for(Account acc: Trigger.new){
        If (acc.ParentId!= null ){
           AccIds.add(acc.ParentId);        
        } 
    }
    }
if (trigger.IsUpdate){
 
    for(Account acc1 : Trigger.old){
           if(acc1.ParentId != null)
           {
              accmap.put(acc1.Id, acc1.ParentId);
              System.debug('Trigger.old operation : '+acc1.ParentId);
           }
          }
    for(Account acc: Trigger.new){
        If (acc.ParentId!= null ){
          AccIds.add(acc.ParentId);
          }
        else if(acc.ParentId == null || acc.ParentId == '')
          {
          System.debug('___________Parent Id is null');
              if(accmap.containsKey(acc.Id))
              {
                 AccIds1.add(accmap.get(acc.Id));
                 System.debug('Trigger.new Operation '+acc.ParentId);
              }
          }           
 
    }
 
    }
 
    if(accIds != null && accIds.size() > 0){
        List<Account> accParentList = [ Select IsParent1__c , ID from Account where IsParent1__c != true and ID IN : accIDs] ;
    
        For( Account acc : accParentList ){
            acc.IsParent1__c = true ;
        }
     
     
     
        if( accParentList != null && accPArentList.size() > 0 ){
            RecursionControl.stoprecursion4 = true;
            update accParentList ;
        }
     
    }
 
    if(AccIds1 != null && AccIds1.size() > 0){
        List<Account> accParentList1 = [ Select IsParent1__c , ID from Account where ID IN : accIDs1];
        List<Account> accParentList2 = [ Select IsParent1__c , ID, parentId from Account where parentId  IN : accIDs1];
        Map<string,string> AccIDMap=new Map<string,string>();
        for(Account e:accParentList2 ){
            AccIDMap.put(e.parentId,e.id);
        }
     
        For( Account acc : accParentList1 ){
            system.debug('@@@@@@@@@@@@@@@@@'+acc+'-'+AccIDMap.containsKey(acc.id));
            if(!AccIDMap.containsKey(acc.id)){
                system.debug('@@@@@@@@@@@@@@@@@inside');
                acc.IsParent1__c = false;
            }
        }
     
        if( accParentList1 != null && accPArentList1.size() > 0 ){
            RecursionControl.stoprecursion4 = true;
            update accParentList1 ;
        }
    }
 
}
    }

Hi, I need create in other object a button like create pdf in Quotes, So I have 2 templates and when click the button, show me a lookup to choose what template a want create. And choose if I want save or save and send.

I tried to do with visualforce page, but I don't know how I can associate each lookup field to each visualforce page.

Hi
I need to replicate data for specific user and found that AccountShare object doesnt support getDeleted method.

Is there a way to know to which accounts user lost access since some timestamp?