• Abhi__SFDC
  • NEWBIE
  • 105 Points
  • Member since 2014

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 29
    Replies
Hi there,
i am wroking with the javascript detail page button.

My question here is we have a Detail page button on the Work stage tasks  which when clicked should pick the Project reference from the Work stage task record and it should update with the custom filed "Project Reference" on the Task.
Any help would be much appreciated.

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/22.0/apex.js" )}
var Wid="{!Work_Stage_Tasks__c.Id}";
alert('First HI'+Wid);

var query="Select id,Project_Reference__c from Task where WhatId='{!Work_Stage_Tasks__c.Id}'";
var records=sforce.connection.query(query);
var records1=records.getArray("records");
alert(records1);
var UpdateRecords=[];

for(var i=0;i<records1.length;i++)
{
var NewTask=new sforce.SObject("Task");
NewTask.Project_Reference__c='{!Work_Stage_Tasks__c.Project_Reference__c}';
UpdateRecords.push(NewTask);
}
result=sforce.connection.update([UpdateRecords]);


Many Thanks inadvance!!
I have a button that needs to take certain fields from an existing case, create a new case with a different record type and those certain fields .  I also want a pop-up to require 5 fields to be re-filled in with different information.  I have this half way working, but I don't quite know how to make the existing case information be put into the new case.  Any help would be greatly appreciated!

Class
public class CW_recurringIncident
{
public Boolean isDisplayPopUp {get; set;}
public CW_recurringIncident(ApexPages.StandardController controller)
{
isDisplayPopUp = true;
{Case c = (Case) controller.getRecord(); c.Status = 'New'; c.RecordTypeId = '012e00000004RxS';}

}
}

Page
<apex:page standardController="Case" extensions="CW_recurringIncident">
<apex:form id="frm">
<apex:detail subject="{!Case.Id}" relatedList="false" title="false"/>
<apex:outputPanel id="tstpopup" rendered="{!IF(isDisplayPopUp ==true,true,false)}" >
<apex:outputPanel styleClass="popupBackground" layout="block" />
<apex:outputPanel styleClass="custPopup" layout="block">
<apex:pageMessages >
</apex:pageMessages>
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField label="Incident First Response" value="{!Case.Incident_First_Response__c}"  required="true"/>
<apex:inputField label="Incident Start" value="{!Case.Incident_Start__c}" onclick="" required="true"/>
<apex:inputField label="Service Restored" value="{!Case.Incident_Resolved__c}" onclick="" required="true"/>
<apex:inputField label="Defect Type" value="{!Case.Defect_Type_Multi__c}" required="true"/>
<apex:inputField label="Service Restoration Description" value="{!Case.Service_Restoration__c}" onclick="" required="true"/>

<apex:outputPanel >
<apex:CommandButton action="{!save}" value="Save"/>
<apex:CommandButton action="{!cancel}" value="Cancel"/>
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:outputPanel>
</apex:outputPanel>





</apex:form>



<style type="text/css"> .errorMsg{ width:159px; }
.custPopup{ background-color: white; border-width: 3px;
border-style: solid;
z-index: 9999;
left: 25%;
padding:10px;
position: absolute;
width: 1000px;
//margin-left: -80px; top:100px; margin-left: -170px;
//top:305px;
border-radius: 5px;
}

.datePicker{z-index:10000}



.popupBackground{ background-color:black; opacity: 0.20; filter: alpha(opacity = 20);
position: absolute; width: 100%; height: 100%; top: 0; left: 0;
z-index: 997 } a.actionlink:hover{ text-decoration:underline; }
.customactionLink { color: #015BA7; font-weight: normal; text-decoration: none; } </style>

<script>
      function setFocusOnLoad() { }
</script>
</apex:page>
  • April 16, 2014
  • Like
  • 0

I have a  FTP site. I wanted to load its file names and download links on a HTML/Visualforce page, so that I can access in Salesforce through a custom tab.

Is it possible with Visualforce page? Any help and guidance would be greatly appreciated.

Thank you.
Leanne Zhang

 I would like to add a button in the Address section of the standard Account page that would call the smartyStreet app update the address. We already use SmartyStreet software for Address Verification. It is currently called only inside our account trigger handler when a new account is added or an address is modified. The problem is we have thousands of records that were not verified during initial Data Load. The current work around is to make an non address change change for example change address from 123 N 1st St to 123 N 1st Street and press Update. Hoping to do this with just a simple button press.
HI All,
I am getting this message
"Your company currently has exceeded its data storage limits including an extra overflow buffer. Per our terms and conditions, we cannot permit additional data creation within our system until your company first reduces its current data storage. Please contact your company's salesforce.com administrator to resolve this. We apologize for any inconvenience this may cause".

As i can see in my org i am using very minimal amount of data but i am still getting error can any one tell me how do i resolve this?
Hi there,
i have a java script button on the Opportunity Deatil page  which which  clicked it should create a new Project Manager and
2. it should get the list of Quote Items  from the opportunity and then it has to  take the id created from the Project Manger  then finally it has to create project Summary records from QuoteLineItems
Here is the code that i worked with:

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/22.0/apex.js" )}
var connection = sforce.connection;
var oid="{!Opportunity.Id}";
var pm = new sforce.SObject("Project_Manager__c");
alert('Opportunity ID'+oid);
pm.Opportunity__c='{!Opportunity.Id}';
var result=sforce.connection.create([pm]);
alert('Project Manager Insert successful'+pm);

var result = sforce.connection.query("Select PricebookEntry.Product2Id,UnitPrice,Quantity,Description From OpportunityLineItem Where OpportunityId = '{!Opportunity.Id}'");
var records = result.getArray("records");
alert(records);
var CreateRecords=[];

if(records[0]==null)
alert('no records to insert');
for(var i=0;i<records.length;i++)
{
   var PS=new sforce.SObject("RTC__Project_Summary__c");
   PS.Ordered__c=records[i].Quantity;
   PS.Project_ID__c='pm.id';         // i think Not getting the Project Manager Id from the above step
   PS.Generic_Product_Name__c=records[i].PricebookEntry.Product2Id;
   PS.Line_Description__c=records[i].Description;
   PS.Total_Sales_Price__c=records[i].UnitPrice;
   UpdateRecords.push(PS);
  
}
sforce.connection.create([CreateRecords]);

problem: Project manager is inserted but the project summary records are not created when clicked on the button.

Any help would be much appreciated.

Many Thanks
Hi there,
i am wroking with the javascript detail page button.

My question here is we have a Detail page button on the Work stage tasks  which when clicked should pick the Project reference from the Work stage task record and it should update with the custom filed "Project Reference" on the Task.
Any help would be much appreciated.

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/22.0/apex.js" )}
var Wid="{!Work_Stage_Tasks__c.Id}";
alert('First HI'+Wid);

var query="Select id,Project_Reference__c from Task where WhatId='{!Work_Stage_Tasks__c.Id}'";
var records=sforce.connection.query(query);
var records1=records.getArray("records");
alert(records1);
var UpdateRecords=[];

for(var i=0;i<records1.length;i++)
{
var NewTask=new sforce.SObject("Task");
NewTask.Project_Reference__c='{!Work_Stage_Tasks__c.Project_Reference__c}';
UpdateRecords.push(NewTask);
}
result=sforce.connection.update([UpdateRecords]);


Many Thanks inadvance!!
I have a commandbutton within a VF page that invokes a controller method.  When I load the VF page in a subtab, the method gets called.  But when I load the VF page in a primary tab, the method is not getting called. 

Here is the code snippet in my Launcher VF Page that decides whether to open a Primary Tab or a Subtab in the Service Console:
       
        ...........

        var tabId;
        var resultId;
       
        //Callback function of getFocusedPrimaryTabId
        var showTabId = function showTabId(result) {
            tabId = result.id;
            //Open Search page as SUBTAB
            sforce.console.openSubtab(tabId, '/apex/ServiceRequestSearch?id=' + resultId, true, 'Service Request Search', null);
        };
       
        //Callback function of getFocusedPrimaryTabObjectId
        var getObjId = function getObjId(result) {
if(result.id != 'null'){
      resultId = result.id;
      sforce.console.getFocusedPrimaryTabId(showTabId);
               }
               else{
                    //Open Search page as PRIMARY TAB
                    sforce.console.openPrimaryTab(null, '/apex/ServiceRequestSearch?id=', true, 'Service Request Search')
            }
        };

Here is the command button that I have in the Search VF Page:

<apex:commandButton value="Search" action="{!doSearch}" rerender="resultBlock" status="searchStatus"/> 

And here's the doSearch method in the controller:

    public PageReference doSearch() {

     System.debug('METHOD START:  doSearch');
     List<String> caseIDList = new List<String>();
    
     //Compose dynamic SOSL query
     FindQuery =  'FIND\'' + SearchText + '\'IN ALL FIELDS RETURNING Case(Id, CaseNumber, ' +
         'Origin, Status, Priority, Subject, CreatedDate, Owner.Name, Division__c, Account.Name WHERE ';
               
        //Add Case Status in filter if a Status has been selected
        if (selectedStatus <> '--All--') {          
         FindQuery = FindQuery + ' and Status = \'' + selectedStatus + '\'';       
        } 
       
        //Add Case Priority in filter if a Priority has been selected
        if (selectedPriority <> '--All--'){          
         FindQuery = FindQuery + ' and Priority = \'' + selectedPriority + '\'';       
        }
       
        //Add Case Origin in filter if an Origin has been selected
        if (selectedOrigin <> '--All--'){          
         FindQuery = FindQuery + ' and Origin = \'' + selectedOrigin + '\'';       
        }
       
        //Search Results sorting logic
        //Sort by Created Date Descending
        if(selectedSorting == 'createDesc'){
         FindQuery = FindQuery + ' ORDER BY CreatedDate DESC)';
        }
        //Sort by Created Date Ascending
        else if(selectedSorting == 'createAsc'){
         FindQuery = FindQuery + ' ORDER BY CreatedDate ASC)';
        }
       
        try { 
            //Run SOSL Query
         List<List<SObject>> searchResultList = Search.query(FindQuery);
         caseList = ((List<Case>)searchResultList[0]);
        }
        catch(Exception ex) {
         System.debug('ERROR:' + ex);
        }
       
        return null;
    }
hai in my visual force page three buttons are there pdf,word,excel.when ever click on pdf the page is render as pdf,click on word that same page will be download as word file,click on excel excel file will be downloaded for that i wrote a code like this 


<apex:page standardController="account" recordSetVar="account" renderAs="{!if($CurrentPage.parameters.isPdf == null, null, 'pdf')}" contentType="{!if($CurrentPage.parameters.isWord== null, null,'application/x-excel#FileName.doc')}" extensions="pwe">
<apex:form >
<apex:pageBlock >
<apex:pageblockButtons >
<apex:commandButton value="pdf" action="/apex/automatic_insert?isPdf=true"/>
<apex:commandButton value="word" action="/apex/automatic_insert?isWord=ture"/>
<apex:commandButton value="excel" action="{/apex/automatic_insert?isExcel=ture"/>
</apex:pageblockbuttons>
<apex:pageBlockTable value="{!account}" var="a">
  <apex:column value="{!a.name}"/>
  <apex:commandButton action="{!save}" value="save"/>
  </apex:pageBlockTable>
  </apex:pageBlock>
</apex:form>
</apex:page>
 

but i am getting confusion with contentType.in <apex:page> we can place any one contentType.when how can i get excel with this code please help me ony one
I have a button that needs to take certain fields from an existing case, create a new case with a different record type and those certain fields .  I also want a pop-up to require 5 fields to be re-filled in with different information.  I have this half way working, but I don't quite know how to make the existing case information be put into the new case.  Any help would be greatly appreciated!

Class
public class CW_recurringIncident
{
public Boolean isDisplayPopUp {get; set;}
public CW_recurringIncident(ApexPages.StandardController controller)
{
isDisplayPopUp = true;
{Case c = (Case) controller.getRecord(); c.Status = 'New'; c.RecordTypeId = '012e00000004RxS';}

}
}

Page
<apex:page standardController="Case" extensions="CW_recurringIncident">
<apex:form id="frm">
<apex:detail subject="{!Case.Id}" relatedList="false" title="false"/>
<apex:outputPanel id="tstpopup" rendered="{!IF(isDisplayPopUp ==true,true,false)}" >
<apex:outputPanel styleClass="popupBackground" layout="block" />
<apex:outputPanel styleClass="custPopup" layout="block">
<apex:pageMessages >
</apex:pageMessages>
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField label="Incident First Response" value="{!Case.Incident_First_Response__c}"  required="true"/>
<apex:inputField label="Incident Start" value="{!Case.Incident_Start__c}" onclick="" required="true"/>
<apex:inputField label="Service Restored" value="{!Case.Incident_Resolved__c}" onclick="" required="true"/>
<apex:inputField label="Defect Type" value="{!Case.Defect_Type_Multi__c}" required="true"/>
<apex:inputField label="Service Restoration Description" value="{!Case.Service_Restoration__c}" onclick="" required="true"/>

<apex:outputPanel >
<apex:CommandButton action="{!save}" value="Save"/>
<apex:CommandButton action="{!cancel}" value="Cancel"/>
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:outputPanel>
</apex:outputPanel>





</apex:form>



<style type="text/css"> .errorMsg{ width:159px; }
.custPopup{ background-color: white; border-width: 3px;
border-style: solid;
z-index: 9999;
left: 25%;
padding:10px;
position: absolute;
width: 1000px;
//margin-left: -80px; top:100px; margin-left: -170px;
//top:305px;
border-radius: 5px;
}

.datePicker{z-index:10000}



.popupBackground{ background-color:black; opacity: 0.20; filter: alpha(opacity = 20);
position: absolute; width: 100%; height: 100%; top: 0; left: 0;
z-index: 997 } a.actionlink:hover{ text-decoration:underline; }
.customactionLink { color: #015BA7; font-weight: normal; text-decoration: none; } </style>

<script>
      function setFocusOnLoad() { }
</script>
</apex:page>
  • April 16, 2014
  • Like
  • 0
I'm trying to build a VF page that will display and allow editing of existing quote line items.  So far I have this:
<apex:page standardController="Quote" showHeader="true" sidebar="false" >
<apex:form >
<apex:pageBlock title="Quote Line Items">
<apex:pageBlockTable value="{!Quote.QuoteLineItems}" var="item">
<apex:column value="{! item.part__c}"/>
<apex:inputField value="{!item.Proposed_Direct_Customer_Price__c}"/>
<apex:commandButton action="{!save}" value="Save!"/>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>

- The save button and proposed direct customer price do not appear on the page but the part__c read only field does appear for each line item. What am I doing wrong?
I'm trying to display the record 'name' field (auto-numbered field) on a visualforce page after insert

How can I do that?  Do I really need to re-query for it to display it after insert?

Here's my page & controller class :
--------------------------------------------------------
<apex:page standardController="MyCustomObject__c" extensions="MyCustomObjectExt">

    <apex:form >
        <apex:outputPanel id="all">
            <apex:sectionHeader title="My Custom Object" subtitle="{!MyCustomObject__c.Name}"/>  <!-- 'Name' is always null :(  -->
            <apex:outputPanel >
                <apex:commandButton action="{!SaveButton}" value="Save Me!" status="SaveButtonStatus" rerender="all"/>
            </apex:outputPanel>
        </apex:outputpanel>
    </apex:form>
</apex:page>

--------------------------------------------------------
public class MyCustomObjectExt {

    private MyCustomObject__c thisRecord;
    private ApexPages.StandardController sc = null;

    public MyCustomObjectExt(ApexPages.StandardController sc) {
        this.sc=sc;
        thisRecord = (MyCustomObject__c) sc.getRecord();
    }

    public PageReference saveButton() {
        try {
            Upsert thisRecord;
            string s = '/' + ('' + thisRecord.get('Id'));
        } catch (Exception e){
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Whoops !'));
        }
        return null;
    }
}

Thank you!
Hi i am trying to build a trigger when mass import is done using a data loader the trigger should save the file in specific formats. For Example IF Job__c is the master object and jobApplicant__c is the child object when doing bulk imports the files should get saved in the following format
JA-0001.0002
JA-0001.0003
JA-0001.0004
 where '0001' comes from the master record name and 0002 is the indvidual child records related to the master.
below is the sample code please help me with the working code
trigger updateAppplicantName on Job_Applicants__c (before insert, before update) {
set<id> vacSet = new set<id>();
for(Job_Applicants__c ja:trigger.new){
vacSet.add(ja.Job_Name__c);
}           
  System.debug('***vacSet***'+vacSet); 
  list<Job_Applicants__c >japp=[select id,name,Job_Name__r.name from Job_Applicants__c where Job_Name__c IN:vacSet order by createddate desc limit 1 ];
String vName='' ;
  string jobname;
  integer num;
  jobname=japp[0].Job_Name__r.name ;
  String jobApplicant=japp[0].name;
  String jobApplicant1=jobApplicant.substring(8,12);
  num=integer.valueof(jobApplicant1);
string AppName=japp[0].name;
String Jobname1=jobname.substring(3,7);
  for(Job_Applicants__c jaa:trigger.new){
  jaa.name='JA-'+Jobname1+num+1;
 
    }
}

Thanks in Advance.
I have a VF page..I have a button open pop up..on click of that button i am opening a pop up using output panel and css...using the code something like this..

LINK http://www.salesforcegeneral.com/salesforce-modal-dialog-box/

On that pop up i am using autocomplete using VF remoting and a confirm button on that popup..My problem is i am using blur event whenever i type some thing in that autocomplete text box i am selecting a autocomplete record and on onblur event calling a method but the curser remains in that text box.So when i click a confirm button onblur event is again called calling the controller method.

I want the curser to move out of the textbox after onblur event ..?? I need some jquery/javascript code...

close: function(){
      j$(esc('{!autocomplete_textbox}')).blur();
   }
Please help i am stuck with this issue...for 3 days...

Thanks
Hi All,

I am get getting list of accounts as command links in visual force page once i click a particualr account releated contact details record names are 

displayed as command links again if i click on particular contact i need to redirect  contact record detail page instead of it i am redirecting to home

page i guess i am getting home page ID instead of Contact ID  and help me how to get record ID on CommandLink Click 

<apex:page controller="MyController">
    <apex:form >
     <apex:pageBlock title="Accounts Info">
     <apex:pageBlockSection title="Accouns">
     <apex:dataList value="{!myaccounts}" var="acct">
       <apex:commandlink action="{! accountClicked}" rerender="ContactDetail">
    <apex:outputText value="{! acct.name}"/>
    <apex:param name="id" value="{! acct.Id}" assignTo="{!selectedAccount}"/>
    </apex:commandLink>
     </apex:dataList>
    </apex:pageBlockSection>
   
    <apex:pageBlockSection title="Contact Records">
   
    <apex:outputPanel id="ContactDetail">
    <apex:repeat value="{! contactsInformation}" var="contact">
     <p><apex:commandLink action="{!contactClicked}">
      <apex:outputText value="{! contact.Name}"/>
     <apex:param name="id1" value="{!contact.id}" assignTo="{!selectedContact}"/>
     </apex:commandLink></p>
    </apex:repeat>
   
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

---contrlooer code---

public class MyController {

  
    public Id selectedAccount { get; set; } 
    public List<Contact> contactsInformation { get; set; }
    public Id selectedContact { get; set; } 
  
    public PageReference contactClicked() {
   
    List<Contact> id = [select id from contact where id =:selectedContact];
     
      PageReference nextpage = new PageReference('https://na15.salesforce.com/?id='+id);
                return nextpage;
    }


   



    public List<Account> getMyaccounts() {
       
        return [SELECT Id, Name, AccountNumber FROM Account ORDER BY
           LastModifiedDate DESC LIMIT 10];
    }


    public void accountClicked() {
    contactsInformation = [SELECT Name,id FROM Contact
            WHERE AccountID = :selectedAccount];
}




}

Hi,

I have stuck in a more complex situation for the simple thing.

I have a component to construct the pageblock table , That component is called by command button in visualforce page my code is as below ....
Sorry in advance to show this big code...

VF Code :
========================

<apex:page controller="RetrieveArchivedRecords" sidebar="False">
   
    <apex:form id="theForm">   
        <apex:commandButton value="displayTable" rerender="callComponent,thePgBlock" action="{!fetchData}" id="displayData"/>
    </apex:form>   
   
    <apex:outputPanel id="callComponent">
   
        <c:DynamicObjectTable ObjectName="Case" rendered="{!showResults}"
            FieldsetName="Test" DetailFields="DetailFieldsSet"
            JSONData="{!GetJsonData}"
            Title="Archived Cases"
            TablePageSize="6"
        />
       
    </apex:outputPanel>
   
   
</apex:page>

Apex Code:
===============
From class i m sending the json data


My Component
==================

<apex:component controller="DynamicObjectTableController">

    <apex:attribute name="FieldsetName"  assignTo="{!strFieldSetName}" type="String" required="true" Description="Fieldset name"/>
    <apex:attribute name="DetailFields"  assignTo="{!innerFieldSet}" type="String" required="true" Description="Fieldset name"/>
    <apex:attribute name="ObjectName"  assignTo="{!strObjectName}" type="String"  required="true" description="Object name"/>
    <apex:attribute name="TablepageSize"  assignTo="{!Pagesize}" type="Integer"  required="true" description="Object name" default="10"/> 
    <apex:attribute name="JSONData"  assignTo="{!strObjectJSON}"  type="String" required="true"  description="data list"/>
    <apex:attribute name="Title"   type="String" required="true" description="Title of the pageblock table"/>

<!----    <apex:attribute name="Reload"  assignTo="{!isControllerInitialized}" type="Boolean" required="false" description="test" default="false" /> --->
// If I remoce the above line the pagination is working good, but command button of visualforce is not taking the recent value (command button not working properly) and if I add the aboce code , the paginatin buttons are not working but the command button in VF page is working .
        <apex:form >
            <apex:pageBlock title="{!Title}" id="thePgBlock">
           
                    <apex:pageblocktable value="{!DisplayedObjects}" var="r" id="ArchivedTableID">
                        <apex:column headerValue="Show">
                            <apex:commandbutton image="/img/func_icons/cal/rightArrow.gif" action="{!showSelectedRecord}" rerender="ArchivedTableID,ArchivedDetailId">
                                <apex:param name="rowid" value="{!r.Id}" assignTo="{!selectedRecordId}"/>
                            </apex:commandbutton>
                        </apex:column>
                        <apex:repeat value="{!fieldSetMembers}" var="f">
                            <apex:column value="{!r[f]}"/>
                        </apex:repeat>

                   
                   
                    <apex:facet name="header" >
                            <apex:outputpanel layout="block" >
                                <apex:commandButton value="First"  title="First Page" reRender="ArchivedTableID" action="{!First}" status="FetchStatus"  disabled="{!hasNoPrevious}"/>
                                <apex:commandButton value="Previous"  title="Previous Page" reRender="ArchivedTableID" action="{!Previous}" status="FetchStatus"   disabled="{!hasNoPrevious}"/>
                                <apex:outputText >{!(pageNumber * pagesize)+1-pagesize}-{!IF((pageNumber * pagesize)>noOfRecords, noOfRecords,(pageNumber * pagesize))} of {!noOfRecords}</apex:outputText>
                                <apex:commandButton value="Next"  title="Next Page" reRender="ArchivedTableID" action="{!Next}" status="FetchStatus" disabled="{!hasNoNext}"/>
                                <apex:commandButton value="Last"  title="Last Page" reRender="ArchivedTableID" action="{!Last}" status="FetchStatus" disabled="{!hasNoNext}"/>
                            </apex:outputpanel>
                    </apex:facet>
                   
                    <apex:facet name="footer" >
                            <apex:outputpanel layout="block" >
                                <apex:commandButton value="First"  title="First Page" reRender="ArchivedTableID" action="{!First}" status="FetchStatus"  disabled="{!hasNoPrevious}"/>
                                <apex:commandButton value="Previous"  title="Previous Page" reRender="ArchivedTableID" action="{!Previous}" status="FetchStatus"   disabled="{!hasNoPrevious}"/>
                                <apex:outputText >{!(pageNumber * pagesize)+1-pagesize}-{!IF((pageNumber * pagesize)>noOfRecords, noOfRecords,(pageNumber * pagesize))} of {!noOfRecords}</apex:outputText>                       
                                <apex:commandButton value="Next"  title="Next Page" reRender="ArchivedTableID" action="{!Next}" status="FetchStatus" disabled="{!hasNoNext}"/>
                                <apex:commandButton value="Last"  title="Last Page" reRender="ArchivedTableID" action="{!Last}" status="FetchStatus" disabled="{!hasNoNext}"/>
                            </apex:outputpanel>
                    </apex:facet>  
                   
                 </apex:pageblocktable> 
                
            </apex:pageBlock>    

    </apex:form>

            <apex:pageblock title="Details" id="ArchivedDetailId" rendered="{!showSelectedDetailRecord}">
                <apex:pageblocksection >
                    <apex:repeat value="{!InnerFieldSetMembers}" var="f">
                        <apex:outputField value="{!selectedRecord[f]}"/>
                    </apex:repeat>
                </apex:pageblocksection>

                   
            </apex:pageblock>     


<!--------------------------------------------------------------------->
   
</apex:component>


Controller for above component
==================================
public with sharing class DynamicObjectTableController
{

   


    //=========component attributes =====

    public String   strObjectJSON{get;set;}
    public String strobjectName{get;set;}
    public String strfieldSetName{get;set;}
    public String innerFieldSet{get;set;}
    transient public Schema.FieldSet  fieldSetDetails{get;set;}
    public Integer pagesize {get;set;}
   
    private Schema.SObjectType   objType;
   
    //=====var declaration
   
        public ApexPages.StandardSetController  scon{get;set;}
        public boolean isControllerInitialized {get;set;}
        public SObject selectedObject {get;set;}
        public List<SObject> displayedObjectList {get;set;}
       
        Public Integer NoOfRecords{get; set;}
   
    //========================

    public DynamicObjectTableController ()
    {
        System.debug('**** Entered inside the Controller construction ****');
        isControllerInitialized=false;
        showSelectedDetailRecord =false;
        System.debug('**** Done with controller construction ****');
    }
   
    public void initTestData()
    {
        System.debug('**** Inside initTestData ****');
        strobjectName = 'Case';
        strfieldSetname = 'Test';
        innerFieldSet = 'DetailFieldsSet';
        System.debug('**** Finished  initTestData method ****');
    }
   
   
      
    public List<Schema.FieldSetMember> getFieldSetMembers()
    {
        System.debug('**** Entered getFieldSetMembers Method ****');
        objType = (Schema.SObjectType) Schema.getGlobalDescribe().get(strobjectName);
        Schema.DescribeSObjectResult d = objType.getDescribe();
        fieldSetDetails = d.fieldSets.getMap().get(strfieldSetName);
        System.debug('**** Finished getFieldSetMembers Method ****' +fieldsetDetails.getFields());
        System.debug('**** fieldsetDetails.getFields() : ' +fieldsetDetails.getFields());
        return  fieldsetDetails.getFields();
       
       
    }
   
    public List<Schema.FieldSetMember> getInnerFieldSetMembers()
    {
        System.debug('**** Entered getInnerFieldSetMembers ****');
        objType = (Schema.SObjectType) Schema.getGlobalDescribe().get(strobjectName);
        Schema.DescribeSObjectResult d = objType.getDescribe();
        fieldSetDetails = d.fieldSets.getMap().get(innerFieldSet);
        System.debug('**** Finished getInnerFieldSetMembers  fieldsetDetails.getFields() : ' + fieldsetDetails.getFields());
       
        return  fieldsetDetails.getFields();
       
       
    }
   

   
    public Map<String,SObject>  recMap {get;set;}
    public String selectedRecordId {get;set;}
   
    public List<SObject> getDisplayedObjects()
    {
        System.debug('**** Entered getDisplayedObjects ****');
       
        if(isControllerInitialized == false)
        {
               System.debug('**** Inside getDisplayedObjects -- if statemnet : value of isControllerInitialized :' + isControllerInitialized);
                scon = new ApexPages.StandardSetController(getAllObjects());
                NoOfRecords=scon.getResultSize();
                scon.setPageSize(pageSize);               
                System.debug('**** NoOfRecords : ' + NoOfRecords);              
               isControllerInitialized =true;
        }
        System.debug('**** Came out of if stmt. ****');
        displayedObjectList = scon.getRecords()  ;       

        recmap = new Map<String,SObject>();
       
        for( SObject rec : scon.getRecords())
        {
            recmap .put(rec.Id, rec);
        }
       
        //show the first record by default
        if(displayedObjectList.size() >0)
        {
            showSelectedDetailRecord = true;
            selectedRecordId = displayedObjectList[0].Id;
            showSelectedDetailRecord =true;
        }

        return scon.getRecords();
       
    }
   
    public Case selectedRecord {get;set;}
    public boolean showSelectedDetailRecord {get;set;}
   
   
    /* public String[] getFieldNames ()
    {
        return new string[] {'CaseNumber', 'ClosedDate'};
    }*/
   
    public void showSelectedRecord()
    {
        System.debug('**** Entered showSelectedRecord Method ***** ');
        selectedRecord = (Case) recmap.get(selectedRecordId);
       
        if(selectedRecord !=null)
            showSelectedDetailRecord =true;
        else
            showSelectedDetailRecord  = false;
        System.debug('**** Finished showSelectedRecord method , showSelectedDetailRecord : ' +showSelectedDetailRecord);   
      
           
    }
 
     Type objListdatatype;
   
    public List<SObject>  getAllObjects()
    {
        System.debug('**** Entered getAllObjects method ***' );
        objListdatatype = Type.forName('List<'+strobjectName+'>');

        List<Sobject> Allcaselist;
          
        try{
                System.debug('**** Entered getAllObjects method try stmt .***' ); 
              /*   String casestr= '[';
                 for(integer i=0;i<10;i++)
                 {
                     casestr += '{"CaseNumber":"111-'+i+'", "Origin":"Email", "ClosedDate":"2012-02-15T19:03:32-08:00", "Reason":"Feedback"}';
                     if(i<9) casestr+=',';
                 }
                 casestr+=']'; */
                 AllcaseList =  (List<SObject>) (List<SObject>) JSON.deserializeStrict(strObjectJSON, objListdatatype);          
                

        }
        catch(Exception e)
        {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, e.getMessage()));
        }
        System.debug('**** Finished getAllObjects method try stmt , allcaselist : ' +allcaselist );
        return allcaselist;
       
      
    }
   
    public void showSelectedObject()
    {
        if( displayedObjectList .size() >0)
        {
            selectedObject = displayedObjectList[0];
            showSelectedDetailRecord  = true;
           
        }
    }
   

//=====================Navigation Methods ==============
  
public Boolean hasNoNext {      
     get {
       System.debug('**** Has no Next??? ****' + ! sCon.getHasNext());         
     return ! sCon.getHasNext();   
     }     
     set;
    } 
     public Boolean hasNoPrevious {    
         get { 
             System.debug('**** Has no Previous??? ****' + ! sCon.getHasPrevious());      
         return ! sCon.getHasPrevious();   
         }       
         set;  
     }   
     public Integer pageNumber {      
         get {   
             System.debug('**** pg # ****' + sCon.getPageNumber());
             return sCon.getPageNumber();    
            
         }     
         set;  
     }    
     public void first() {
            
        sCon.first();  
     }
    
     public void last() { 
     System.debug('***** Clicked on Last button *****');  
        sCon.last();  
     }  
     public void previous() {     
        sCon.previous();  
     }    
     public void next() {  
         System.debug('***** Clicked on next button , Number of records ' +noofrecords + ' pagesize' +pagesize);
         System.debug('***** number of records : ' +noofrecords);
        
        sCon.next();
     }  
  }

Please help me to get all the buttons working . i.e pagination buttons(First,Previous,next,last ) and VF Command button should work
Hey all,
This is probably really simple, but I've spent all morning and don't have it working.  I have a .NET webservice that my APEX code calls which returns back a list of orders.  It sends an http request to get the service to get the data.  The request being made is getOrders, but the result that comes back is "getOrdersResult", like this:

{"GetOrdersResult":[{"ActualBudget":"0.00","ActualCompletionDate":null,"ActualStartDate":null,"CustomerNo":"SS124","CustomerOrderNo":"","Directive":"New Test WO","EntryDate":"03\/12\/2014","PlannedBudget":"0.00","PlannedCompletionDate":"03\/13\/2014","PlannedStartDate":"03\/12\/2014","WorkOrderNo":"185815","WorkOrderStatus":"WORKREQUEST"},{"ActualBudget":"0.00","ActualCompletionDate":null,"ActualStartDate":null,"CustomerNo":"19231","CustomerOrderNo":"54749","Directive":"Two tower GARP inspection in San Antonio, TX","EntryDate":"01\/16\/2014","PlannedBudget":"0.00","PlannedCompletionDate":"","PlannedStartDate":"","WorkOrderNo":"179316","WorkOrderStatus":"RELEASED"}]}

In my apex I have a public class "myOrder" that contains all the values above.  My problem is deserializing this data into a list when it has a "parent", GetOrderResult. Currently I have this:
List<myOrder> myOrderList = ((GetOrders)System.JSON.deserializeStrict(res.getBody(), GetOrders.class)).GetOrdersResult;

Obviously this is an illegal assignment because "GetOrdersResult" is not viewed as a list.  How do I deserialize into a list of myOrder objects?
Any help is much appreciated!

I am creating a tabular report.I need to display the total values at the bottom of specific column.I used <apex:facet  name="footer">Total</apex:facet> tag within <apex:column> tag.It results properly at vf page but when i generate an xls file , the footer is not displaying in the file.

I also used <apex:outputpanel> like

<apex:column headerValue="Amount">
  <apex:outputField value="{!value.TotalTransactionAmount__c}"/>
    <apex:facet name="footer">
        <apex:outputPanel>
              TotalAmount:{!amountMap[i]}
        </apex:outputPanel>
        </apex:facet>
  </apex:column>


Kindly help me ,if anybody have any idea about this.

Hi

 

ie. how can I pass a parameter to a "page" component's "action" method? 

 

I have a simple Visualforce page 

 

<apex:page controller="JoinController" action="{!go}"/>

 

 with a simple controller

 

public class JoinController {

public PageReference go() {
PageReference regPage = new PageReference('http://wiki.developerforce.com/events/regular/registration.php');

regPage.getParameters().putAll(ApexPages.currentPage().getParameters());
return regPage;
}
}

 

 

(It redirects, copying the HTML params)

 

What I'd prefer to do is parameterize go().   Can you recommend how I do that?  ie. I want to write this

 

 

<apex:page controller="JoinController" action="{!go}">
<apex:param assignTo="{!website}" value="http://wiki.developerforce.com/events/regular/registration.php"/>
</apex:page>

 

 But param doesn't appear to be supported for a page component.  

 

Any ideas how I can solve this?

 

Thanks,

Jon