• dev.shiv1.3478599680068948E12
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 17
    Replies
Hi friends,
I Had a controller for pagination with methods like PageSize,  PageSkipSize, DefaultSize, SkipToSize etc....
I am using this pagination controller in other controller for pagination.
In second class I am calling database.query('My Query here') in constructor by calling pagination controller like as follows...

public class PageToDisplayRecords implements ObjectPaginatorListener{
global ObjectPaginator paginator {get;private set;}
  public PageToDisplayRecords(ApexPages.StandardController stdController) {
     List<Employee__c> emp = new List<Employee__c>();
     emp = Database.query('SELECT Id, Name, Tax__c, PF__c,SL__c FROM Employee__c LIMIT 1000');
     List<EmpIdW> paginateIds = new List<EmpIdW>();     //wrapperclass list
         paginateIds = buildEmpIdList(emp);                             //buildEmpIdList is wrapperclassList method calling
         paginator.setRecords(paginateIds);
   }
}

The above constructor is my first priority such that whenever I come to page the default query will run here.

Here my requirement. When ever I click a page number in the pagination area for example say Page number 5and then I click on the record listed here will direct to ThirdPage(here I am passing a parameter to the newpage with the selected page number). In that page I am having a link(Back to results). If I click on this link it will redirect to previous page passing the pagenumber from the url.

Now with that page number from previous I need to construct the page to the selected page number.

For this I added the code as below
public class PageToDisplayRecords implements ObjectPaginatorListener {
public String pageNumber;
global ObjectPaginator paginator {get;private set;}

public PageToDisplayRecords(ApexPages.StandardController stdController) {
  pageNumber = ApexPages.currentPage().getParameters().get('pagenumber');
if(pageNumber != '0'){
    paginator = new ObjectPaginator(15,this);
   paginator.skipToPage(Integer.valueOf(pageNumber));        // Exception throwing here as "Script-thrown exception" 
}
     List<Employee__c> emp = new List<Employee__c>();
     emp = Database.query('SELECT Id, Name, Tax__c, PF__c,SL__c FROM Employee__c LIMIT 1000');
     List<EmpIdW> paginateIds = new List<EmpIdW>();     //wrapperclass list
         paginateIds = buildEmpIdList(emp);                             //buildEmpIdList is wrapperclassList method calling
         paginator.setRecords(paginateIds);
   }
}

Please help me how can I achieve this. (The above code is just to understand the way of code I have written. As original code is much larger I didnot post)
Hi friends,
I am having an issue with inputcheckbox/commandlink when rendering.
Below is my page code.

<apex:dataTable value="{!VenueList}" var="v" rowClasses="even,odd" cellpadding="5" styleClass="table_vl" id="table_List"  rendered="{!VenueList.size > 0}">
         <!-- Action Checkbox -->
         <apex:column headerValue="REFER">
    <apex:outputPanel id="recomendationNotcreated" rendered="{!IF((v.rec==null), 'true', 'false')}">
           <apex:inputCheckbox value="{!v.isSelected}" id="referLabel" styleClass="referLabel" style="margin-left: 15px;" rendered="{!IF((v.noOfServiceProviders == 1), 'true','false')}">
            <apex:actionSupport event="onclick" action="{!createRecomendation}" rerender="headerComponent,table_List" status="RecomendingStatus">
      <apex:param name="vid" value="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
                  <apex:param name="venueRefd" value="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
                  <apex:param name="locationRefd" value="{!v.vpi.MD_Locations_Serviced__c}" assignTo="{!locationServicedRefId}"/>
     </apex:actionSupport>
     </apex:inputCheckbox>
    </apex:outputPanel>
     <apex:actionStatus id="RecomendingStatus">
     <apex:facet name="start">
         <!-- <div class="vd-processing">&nbsp;&nbsp;<apex:outputLabel value="Processing..." for="referLabel"/></div> -->
         <div class="loading_Text"></div>
      <div class="innerBlock_Text">
             <img  src="{!URLFOR($Resource.VenueSearch,'images/130.gif')}" width="16px" height="16px" title="Please Wait..." />
         </div>
        </apex:facet>
    </apex:actionStatus>
   <apex:outputPanel id="recomendationcreated" rendered="{!IF((v.rec!=null), 'true', 'false')}">
           <apex:commandLink styleClass="clearRefer Remove" value="Remove" action="{!updateRecomendation}" rerender="headerComponent,table_List" status="loadingStatus" >
                  <apex:param name="dvid" value="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
                  <apex:param name="recommendId" value="{!v.rec.Id}" assignTo="{!recomendUpdateId}"/>
                  <apex:param name="vid" value="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
              </apex:commandLink>
           </apex:outputPanel>
              <apex:actionStatus id="loadingStatus">
               <apex:facet name="start">
               <!-- <div class="vd-place">&nbsp;&nbsp;Please wait...</div> -->
                 <div class="loading-Txt"></div>
                 <div class="innerBlocktxt">
                  <img  src="{!URLFOR($Resource.VenueSearch,'images/130.gif')}" width="16px" height="16px" title="Please Wait..." />
                 </div>
              </apex:facet>
              </apex:actionStatus>
        </apex:column>
</apex:datatable>

Here I am rendering commandlink when I click on checkbox and when I click on command link I am rendering checkbox. Here it is working only when the page get refreshed manually. I need to render those without loading the page. Please post your comments if I have made any mistake in the page...
I want to diaplay the description field as readable where I am inserting the description field using an email template. Here description field is displaying in html code. I want to display the html code as readble for task object. Please help me in acheiving this.

I didn't find site.com in both sandbox and production. I want to customize my login, home pages for the community site. To implement this I can use site.com to design/develope pages for the community. But site.com is not available in my sanbox/production environment.

 

As per the implementation guide from winter 14 release site.com is avilable in sanbox also. Please post your suggestions/comments

Hi friends,

I created a remote application in my developer edition from "Canvas App Previewer" using heroku credentials.

After performing all the operations required to this app is done.

 

But now to test this app in other organizations I need to package this connected app, but unfortunately the option is not available to add the remote applications...

 

Does any one know a way how to add the remote/connected apps to a package? Please post your answers...

Hi,

I wrote a visualforce page using a standard controller. In the page it displaying a date field with displaying weekdays(sun mon tue wed ...... sat). I don't know why this date field is displaying with calling in the controller and visualforce page. Please help me on this.

Hi,

I tried validating the <apex:selectRadio> component. But I am unable to validate the field. Please help me how to achieve this either from javascript or jquery. The error should display on the top of the page. Any ideas/hints can appreciate.

 

 

 

 

 

 

Thanks.

 

 

 

-Shiva Kumar

Hi friends,

I need to override visualforce standard controller detail page. The detail page has inlineEdit. When we edit we need to save which is required to override the standard button(own functionality). Please any hints or ideas could be appreciated....

Thanks......

-Shiva

Hi,

I have a parent object and a child. If I delete a record from the related list, those should delete from the related list only not from the child object... Please any Ideas or solutions could be helpful and appreciated.....

Thanks.

-Shiva

Hi buddies,

Does any one knows how to enable work.com in salesforce org? If so please let me know how to achieve this.....

 

 

Thanks,

 

-Shiva

Hi,

How can we write javascript on attachment object? Is there any way to write javascript on this object. Any hints appreciated........

 

 

 

 

Thanks

-Shiva

Hi,

I enabled delegated authentication in my salesforce administrator account. I just enabled delegated authentication in single sign on settings and for the system admin profile and did not follow the procedure for the delegated authentication.

While logging into my account next dat its showing an error as "Your company's Single Sign-On configuration is invalid. Please contact the administrator at your company for more information."  How could I log back into my salesforce???

Even if I try to reset my password its showing a message as "can not reset password for single sign on users". 

Please any solutions could be appreciated..

 

 

 

Thanks

 

 

 

-

shiva

Hi, I am getting an error while converting lead when I uncheck the box "do not create Opportunity upon convertion".

The following is the page displaying error while converting the lead.

Please help me out regarding this.

 

 

 

The following is the page i am directing to while creating an article....

*************

An internal server error has occurred

An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 1351944428-7330 (1047217740)




Click here to return to the previous page. 

******************

Can anyone explain why I am unable to create a new article.

Hi, I created a Visualforce page for a List button to the related list object to add the child records into parent related list.

The controller I've written for that is shown below. Its adding duplicate records and as well as creating the same records again and again when ever i add the records. Will you please tell me the logic how to add the records and does not allow duplicates or create new records for  the child object....

 

public with sharing class ProgramController {
public Program__c Program ;
public List<Wrapper> wraplist{get;set;}
public ProgramController(ApexPages.StandardController controller) {
program = (Program__c) Controller.getRecord();
wraplist = new List<Wrapper>();
List<Title__c> t = [SELECT id,name,Program__c FROM Title__c LIMIT 20];

for(title__c t1:t){
wrapList.add( new wrapper(t1));
}
}
public class Wrapper{
public Boolean Selected{get;set;}
public title__c title{get;set;}
public wrapper(Title__c ti){
title = ti;
}
}
public PageReference addTitle(){
List<Title__c> newTitle = new List<Title__c>();
for(Wrapper wrap :WrapList){

if(Wrap.Selected== true)
{

title__c newtitle1 = new Title__c(Name=wrap.title.name,Program__c=program.id);

newTitle.add(newtitle1);
}
upsert newtitle;
}
return (new ApexPages.StandardController(Program)).view();
}
}

How to retrieve the account fields from the query [SELECT Accoun.Id,Account.Name FROM Contact Limit 5] in a class.

The code is shown below...

public class Retrieving_Fields {
public List<Contact> con{set;get;}
public void RetrievingFields(){
con=[SELECT Account.Id,Account.Name,Account.Phone FROM Contact LIMIT 5];
System.debug(con);
}
}

please hlelp me out how to retrieve those fields from the above class

Hi friends,
I Had a controller for pagination with methods like PageSize,  PageSkipSize, DefaultSize, SkipToSize etc....
I am using this pagination controller in other controller for pagination.
In second class I am calling database.query('My Query here') in constructor by calling pagination controller like as follows...

public class PageToDisplayRecords implements ObjectPaginatorListener{
global ObjectPaginator paginator {get;private set;}
  public PageToDisplayRecords(ApexPages.StandardController stdController) {
     List<Employee__c> emp = new List<Employee__c>();
     emp = Database.query('SELECT Id, Name, Tax__c, PF__c,SL__c FROM Employee__c LIMIT 1000');
     List<EmpIdW> paginateIds = new List<EmpIdW>();     //wrapperclass list
         paginateIds = buildEmpIdList(emp);                             //buildEmpIdList is wrapperclassList method calling
         paginator.setRecords(paginateIds);
   }
}

The above constructor is my first priority such that whenever I come to page the default query will run here.

Here my requirement. When ever I click a page number in the pagination area for example say Page number 5and then I click on the record listed here will direct to ThirdPage(here I am passing a parameter to the newpage with the selected page number). In that page I am having a link(Back to results). If I click on this link it will redirect to previous page passing the pagenumber from the url.

Now with that page number from previous I need to construct the page to the selected page number.

For this I added the code as below
public class PageToDisplayRecords implements ObjectPaginatorListener {
public String pageNumber;
global ObjectPaginator paginator {get;private set;}

public PageToDisplayRecords(ApexPages.StandardController stdController) {
  pageNumber = ApexPages.currentPage().getParameters().get('pagenumber');
if(pageNumber != '0'){
    paginator = new ObjectPaginator(15,this);
   paginator.skipToPage(Integer.valueOf(pageNumber));        // Exception throwing here as "Script-thrown exception" 
}
     List<Employee__c> emp = new List<Employee__c>();
     emp = Database.query('SELECT Id, Name, Tax__c, PF__c,SL__c FROM Employee__c LIMIT 1000');
     List<EmpIdW> paginateIds = new List<EmpIdW>();     //wrapperclass list
         paginateIds = buildEmpIdList(emp);                             //buildEmpIdList is wrapperclassList method calling
         paginator.setRecords(paginateIds);
   }
}

Please help me how can I achieve this. (The above code is just to understand the way of code I have written. As original code is much larger I didnot post)

Hi, I created a Visualforce page for a List button to the related list object to add the child records into parent related list.

The controller I've written for that is shown below. Its adding duplicate records and as well as creating the same records again and again when ever i add the records. Will you please tell me the logic how to add the records and does not allow duplicates or create new records for  the child object....

 

public with sharing class ProgramController {
public Program__c Program ;
public List<Wrapper> wraplist{get;set;}
public ProgramController(ApexPages.StandardController controller) {
program = (Program__c) Controller.getRecord();
wraplist = new List<Wrapper>();
List<Title__c> t = [SELECT id,name,Program__c FROM Title__c LIMIT 20];

for(title__c t1:t){
wrapList.add( new wrapper(t1));
}
}
public class Wrapper{
public Boolean Selected{get;set;}
public title__c title{get;set;}
public wrapper(Title__c ti){
title = ti;
}
}
public PageReference addTitle(){
List<Title__c> newTitle = new List<Title__c>();
for(Wrapper wrap :WrapList){

if(Wrap.Selected== true)
{

title__c newtitle1 = new Title__c(Name=wrap.title.name,Program__c=program.id);

newTitle.add(newtitle1);
}
upsert newtitle;
}
return (new ApexPages.StandardController(Program)).view();
}
}

Hi friends,
I am having an issue with inputcheckbox/commandlink when rendering.
Below is my page code.

<apex:dataTable value="{!VenueList}" var="v" rowClasses="even,odd" cellpadding="5" styleClass="table_vl" id="table_List"  rendered="{!VenueList.size > 0}">
         <!-- Action Checkbox -->
         <apex:column headerValue="REFER">
    <apex:outputPanel id="recomendationNotcreated" rendered="{!IF((v.rec==null), 'true', 'false')}">
           <apex:inputCheckbox value="{!v.isSelected}" id="referLabel" styleClass="referLabel" style="margin-left: 15px;" rendered="{!IF((v.noOfServiceProviders == 1), 'true','false')}">
            <apex:actionSupport event="onclick" action="{!createRecomendation}" rerender="headerComponent,table_List" status="RecomendingStatus">
      <apex:param name="vid" value="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
                  <apex:param name="venueRefd" value="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
                  <apex:param name="locationRefd" value="{!v.vpi.MD_Locations_Serviced__c}" assignTo="{!locationServicedRefId}"/>
     </apex:actionSupport>
     </apex:inputCheckbox>
    </apex:outputPanel>
     <apex:actionStatus id="RecomendingStatus">
     <apex:facet name="start">
         <!-- <div class="vd-processing">&nbsp;&nbsp;<apex:outputLabel value="Processing..." for="referLabel"/></div> -->
         <div class="loading_Text"></div>
      <div class="innerBlock_Text">
             <img  src="{!URLFOR($Resource.VenueSearch,'images/130.gif')}" width="16px" height="16px" title="Please Wait..." />
         </div>
        </apex:facet>
    </apex:actionStatus>
   <apex:outputPanel id="recomendationcreated" rendered="{!IF((v.rec!=null), 'true', 'false')}">
           <apex:commandLink styleClass="clearRefer Remove" value="Remove" action="{!updateRecomendation}" rerender="headerComponent,table_List" status="loadingStatus" >
                  <apex:param name="dvid" value="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
                  <apex:param name="recommendId" value="{!v.rec.Id}" assignTo="{!recomendUpdateId}"/>
                  <apex:param name="vid" value="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
              </apex:commandLink>
           </apex:outputPanel>
              <apex:actionStatus id="loadingStatus">
               <apex:facet name="start">
               <!-- <div class="vd-place">&nbsp;&nbsp;Please wait...</div> -->
                 <div class="loading-Txt"></div>
                 <div class="innerBlocktxt">
                  <img  src="{!URLFOR($Resource.VenueSearch,'images/130.gif')}" width="16px" height="16px" title="Please Wait..." />
                 </div>
              </apex:facet>
              </apex:actionStatus>
        </apex:column>
</apex:datatable>

Here I am rendering commandlink when I click on checkbox and when I click on command link I am rendering checkbox. Here it is working only when the page get refreshed manually. I need to render those without loading the page. Please post your comments if I have made any mistake in the page...

Hi friends,

I need to override visualforce standard controller detail page. The detail page has inlineEdit. When we edit we need to save which is required to override the standard button(own functionality). Please any hints or ideas could be appreciated....

Thanks......

-Shiva

Hi,

I have a parent object and a child. If I delete a record from the related list, those should delete from the related list only not from the child object... Please any Ideas or solutions could be helpful and appreciated.....

Thanks.

-Shiva

Hi,

How can we write javascript on attachment object? Is there any way to write javascript on this object. Any hints appreciated........

 

 

 

 

Thanks

-Shiva

Hi,

I enabled delegated authentication in my salesforce administrator account. I just enabled delegated authentication in single sign on settings and for the system admin profile and did not follow the procedure for the delegated authentication.

While logging into my account next dat its showing an error as "Your company's Single Sign-On configuration is invalid. Please contact the administrator at your company for more information."  How could I log back into my salesforce???

Even if I try to reset my password its showing a message as "can not reset password for single sign on users". 

Please any solutions could be appreciated..

 

 

 

Thanks

 

 

 

-

shiva

Hi,

 

I have set up Live Agent in my sandbox using this link.

 

http://login.salesforce.com/help/doc/en/live_agent_setting_up.htm

 

But when i open my Service Console App, I can see the Live agent chat window but no buttons are available.

I have done all the set up, chat buttons, agent configurations, deployments and live agent users.

 

Please suggest.

Hi, I created a Visualforce page for a List button to the related list object to add the child records into parent related list.

The controller I've written for that is shown below. Its adding duplicate records and as well as creating the same records again and again when ever i add the records. Will you please tell me the logic how to add the records and does not allow duplicates or create new records for  the child object....

 

public with sharing class ProgramController {
public Program__c Program ;
public List<Wrapper> wraplist{get;set;}
public ProgramController(ApexPages.StandardController controller) {
program = (Program__c) Controller.getRecord();
wraplist = new List<Wrapper>();
List<Title__c> t = [SELECT id,name,Program__c FROM Title__c LIMIT 20];

for(title__c t1:t){
wrapList.add( new wrapper(t1));
}
}
public class Wrapper{
public Boolean Selected{get;set;}
public title__c title{get;set;}
public wrapper(Title__c ti){
title = ti;
}
}
public PageReference addTitle(){
List<Title__c> newTitle = new List<Title__c>();
for(Wrapper wrap :WrapList){

if(Wrap.Selected== true)
{

title__c newtitle1 = new Title__c(Name=wrap.title.name,Program__c=program.id);

newTitle.add(newtitle1);
}
upsert newtitle;
}
return (new ApexPages.StandardController(Program)).view();
}
}

How to retrieve the account fields from the query [SELECT Accoun.Id,Account.Name FROM Contact Limit 5] in a class.

The code is shown below...

public class Retrieving_Fields {
public List<Contact> con{set;get;}
public void RetrievingFields(){
con=[SELECT Account.Id,Account.Name,Account.Phone FROM Contact LIMIT 5];
System.debug(con);
}
}

please hlelp me out how to retrieve those fields from the above class

Hi,

 

I need to change the url of an salesforce instance to anything of my choice.

 

Ex: https://cs7.salesforce.com/_ui/core/chatter/ui/ChatterPage (Change from)

 

      https://mycompany.force.com/_ui/core/chatter/ui/ChatterPage (Change to)

 

Is this possible? If yes how do we achieve this? If no, why cant we do this? 

 

NOTE: Will package this as a managed package.

 

I tried to changed the URL through sites. Even this didnt help me.

 

Pls suggest.

 

Thanks,

Neha G Patel 

Trying to login through Force.com IDE.  Creating a new project yet I get invalid login no matter what I do.

 

Used security token and get "Unable to connect o hostname 'www.salesforce.com' with given login credentials'.


Didn't use security token and get the same.

 

But able to log into salesforce.com with the same username and password I am trying in the IDE.

 

I look at the login history and it says "Invalid Password" but again..using the same password in the IDE that I use to login.

 

I have tried my regular production account and my developer account.  Same thing.

 

Maybe something in my companies firewall is blocking a port?  Does the IDE use different ports than 80 and 443?  But if it was a Port issue why would the login history say "Invalid Password"?


Thanks for any help.

My goal is to create a new user then associate this new user with the Authenticated Website user license.

 

I go Setup > Users > Create New User > and user license field is read only. I can't change it to Authenticated Website license type.

 

I am using developer edition.

 

Can anyone advise on what I am doing wrong?

 

Thanks

 

Chris

 

 

Message Edited by Chris4727 on 01-23-2010 10:12 AM
Hi all - I am completely new to the custom controllers and cannot figure out how to perform a save on the page if I am using a custom list controller. Basically I needed to create a custom list controller so that I can define the record set that will be returned in the VF Page. Some of the fields on the page are editable and so I want to have a Save button on the page that will save all of the updated records. Here is the code below for my vf page

<apex:page controller="opportunityList2Con"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> </apex:pageBlockButtons> <apex:pageMessages /> <apex:pageBlockTable value="{!opportunities}" var="opp"> <apex:column headerValue="Managers Feel"> <apex:inputField value="{!opp.Manager_Feel__c}"/> </apex:column> <apex:column value="{!opp.StageName}"/> <apex:column value="{!opp.CloseDate}"/> <apex:column > <apex:facet name="header" ><b>Name</b></apex:facet> <apex:outputLink value="/{!opp.id}" > {!opp.name} </apex:outputLink> </apex:column> <apex:column value="{!opp.Owner.Name}"/> <apex:column value="{!opp.Account.Name}"/> <apex:column value="{!opp.Amount}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>

and here is the controller. I am not sure how the save should be coded...

 

 

public class opportunityList2Con { public PageReference save() { return null; } public ApexPages.StandardSetController setCon { get { if(setCon == null) { setCon = new ApexPages.StandardSetController(Database.getQueryLocator([select id, name, account.name, stagename, Manager_Feel__c, closedate, amount, owner.name from Opportunity where ownerid = '00530000000jMqE'])); } return setCon; } set; } public List<Opportunity> getOpportunities() { return (List<Opportunity>) setCon.getRecords(); } }