• viswada
  • NEWBIE
  • 50 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 54
    Questions
  • 26
    Replies

Hi  all,

 

                   I have been    involved in  salesforce development  from last one year  onwords.   Now every  one asking  about integration  like have you done any integrations. plz le me know   what is the procedure  to learn  integation  with other application,   what is minimum knowledge to  learn that, Please guide me the  right way to learn integrations.

HI all,

 

                 Can  any body Give  the breif idea about  robots.txt  file  in site, How it  is working  in sites,  in which scenarios  it would help  us in sites.

Hi,

 

              I have a little problem with "In line Editing".

In My Visualforce Page I displayed Records in Page Block Table Using Wrapper class and placed In Line Editing to the Fields.

While I am editing and click on "SaveAll" Button. Its saving.working fine.

 

But the First Record in the Table Is not Upadating to Database.It is Showing the Previous values.

In that first row, I have one Pick list field, When i changed that pick list value That row is Saved withat pick list.But the Remaining Fields<which are present in First row is not Updating.

 

Can anyone Suggest me How to Achieve this........

HI All,

 

 

                HI ,   I have One internal user "Analyst" , He has all pwrmission on case object. but when   he opening the case record  getting  Error  Like  

 

 

URL No Longer Exists
You have attempted to reach a URL that no longer exists on salesforce.com.

You may have reached this page after clicking on a direct link into the application. This direct link might be:
• A bookmark to a particular page, such as a report or view
• A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link
• A link to a particular page in your email templates

If you reached this page through a bookmark, you are probably trying to access something that has moved. Please update your bookmark.

If you reached this page through any of the other direct links listed above, please notify your administrator to update the link.

If you reached this page through a link on our site, please report the broken link directly to our Support Team and we will fix it promptly. Please indicate the page you were on when you clicked the link 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!

 

 

 Can  any one  give the solutions  why it is coming

HI All,

 

 

I am New to configuration , I have configured MyOutlook(2007) with " Internet email settings(not with microsoft exchage server) on "WIndows 7 "and then I configured outlook with salesforce developer account using "salesforce for Outlook" . I am able to Sync contacts ,events and tasks.. But i am not able to visible "ADD Email" in the Outlook tool bar , I have read all the documents regarding "Add email button" and every thing configured Perfectly . But I couldn't find the Solutions .Please giude me to resolve this issue. Is Imap/pop3 is not supported to "Add email"?

 

HI All,

 

I  am New to configuration ,  I  have configured  MyOutlook(2007)    with  " Internet  email settings(not with microsoft exchage server) on "WIndows 7 "and then    I configured  outlook with salesforce  developer account  using  "salesforce for Outlook" . I am  able to Sync  contacts  ,events and  tasks..  But  i am not  able   to  visible "ADD Email"  in the Outlook  tool bar , I have read all the documents  regarding "Add email button" and every thing configured  Perfectly . But  I couldn't find the Solutions  .Please   giude me to resolve this issue. Is  Imap/pop3 is not supported to "Add email"?

Hiii ALL,

 

                    I  am  new  to Visual flow  design   I have  designed a flow  which is related to general survey (about which satate is best Tourism state  in india) , In the first screen I  provided with participantname  and the second Screen I  provided  the Question( which Satate is best  tourismn state with list of choices states in dropdown List , and   also provide the "Others" choice option . what my requiremnet is if end  user  select the "other" option  a new  text box should be  displayed .  how can  we implement this  using  Visual flow. 

 

 

Thanks

HI all, 

 

          I have  implemented   Live agent with my developer account and i am using customer portal not using sites .   I have setup live agent  through implementation guide   and developer's guide ,   I  am able  to chat  without   pre -chat form with my visitors. For gertting  customer details   before chat initate. i would like to Display  Pre-chart form   for visitors, i have been setup pre chart form    through developer guide ,  but it's not appering  to my visitors . I went through   some documents . For submitting Pre- chat form to visitors, we have to go through Account dash board settings in salesforce live agent  operate consoler. is it ?  How  would I submit pre-chat form  through my developer account ,?

 

 

Thanks 

HI All,

I am new to costomization , i connfigured my developer account with live agent, I have used " customer portal " for Deployment . I have succes with configuration. The problem is "Auto -Qurey" and 1-Click Fast Fill is not working , I have used Auto query for getting customer details with help of developerguide as shown in below.

// An auto query that searches contacts whose email field matches "sridhar@advanz.com"
liveagent.addCustomDetail('Contact E-mail', 'sridhar@advanz.com').map('Contact', 'Email', false,
true);
// A fast-fill to populate a contact’s name with "Sridhar Reddy"
liveagent.addCustomDetail('Contact Name', 'Sridhar Reddy').map('Contact', 'Name', true, false);
// Saves the custom detail to a custom field on LiveChatTranscript at the end of a chat
liveagent.addCustomDetail('Company', 'advanz').saveToTranscript('Company__c');
// Overrides the display name of the visitor in the agent console when engaged in a chat
liveagent.setName('Sridhar Reddy');
liveagent.init('https://d.la1t1.salesforceliveagent.com/chat', '57290000000L29N', '00D90000000i9CQ');
</script>

 

when customer intiate chat I am not getting any customer name("Sridhar Reddy) , i am gettig "visitor" and the contact is not auto- populated . i am not using " any pre-chat form" any one can help me how they works?

HI  All,

 

          I am new to costomization , i  connfigured my developer account   with live agent, I  have used " customer portal " for Deployment . I have succes with configuration. The  problem  is  "Auto -Qurey"  and  1-Click Fast Fill  is not working ,  I have used Auto query  for getting customer details  with help of developerguide as shown in below.

 

// An auto query that searches contacts whose email field matches "sridhar@advanz.com"
liveagent.addCustomDetail('Contact E-mail', 'sridhar@advanz.com').map('Contact', 'Email', false,
true);
// A fast-fill to populate a contact’s name with "Sridhar Reddy"
liveagent.addCustomDetail('Contact Name', 'Sridhar Reddy').map('Contact', 'Name', true, false);
// Saves the custom detail to a custom field on LiveChatTranscript at the end of a chat
liveagent.addCustomDetail('Company', 'advanz').saveToTranscript('Company__c');
// Overrides the display name of the visitor in the agent console when engaged in a chat
liveagent.setName('Sridhar Reddy');
liveagent.init('https://d.la1t1.salesforceliveagent.com/chat', '57290000000L29N', '00D90000000i9CQ');
</script>

 

 

 

  when  customer intiate chat    I am not getting  any  customer name("Sridhar Reddy) , i am gettig "visitor"   and  the  contact is not auto- populated   .   i am not  using " any pre-chat form"  any one can  help me how they works?

 

 

 

HI  ALL,

    

                    I  have configred  live agent  in my developer account ,   I am not using  force.com sites.,   I am getting problem with  chat button . I have taken  chat button  Name as  "start"  . it will generate   javascript code,   that is shown  in below

 

<a id="liveagent_button_online_57390000000L2Hd" href="javascript&colon;//Chat" style="display: none;" onclick="liveagent.startChat('57390000000L2Hd')"><!-- Online Chat Content --></a><div id="liveagent_button_offline_57390000000L2Hd" style="display: none;"><!-- Offline Chat Content --></div><script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('57390000000L2Hd', document.getElementById('liveagent_button_online_57390000000L2Hd'));
liveagent.showWhenOffline('57390000000L2Hd', document.getElementById('liveagent_button_offline_57390000000L2Hd'));
});</script>  

 

  IN the  live agent implementation guide  we will provide images or text  code to  online chat  content and offline chat content .   i.provide strat and end   in that place , as shown below.

 

<a href="javascript&colon;//Chat"   id="liveagent_button_online_57390000000L2Hd" onclick="liveagent.startChat('57390000000L2Hd')"><!-- Online Chat Content -->Start
</a><div id="liveagent_button_offline_57390000000L2Hd" style="display: none;">END<!-- Offline Chat Content --></div><script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('57390000000L2Hd', document.getElementById('liveagent_button_online_57390000000L2Hd'));
liveagent.showWhenOffline('57390000000L2Hd', document.getElementById('liveagent_button_offline_57390000000L2Hd'));
});</script>

 

   when i run apex page   iam getting  END Text instead of Start .,  can  any one guide me  how to initiate  chat from  chat buttons

 

 

 

Thanks

 

HI all,

       

                    I  am new to development  , what are  the  concepts  undercomes to saleforce  configuration ,  I would to like to  configuration side rather than  developement . plz  give any information about configuration.  

Hi All,

I am new to "entitle management ". I have configured the Entitle management through its implementation guide, I am struck at Milestone success actions.,How do milestone initial response get success state , can any one provide information to get initial response status is successfully , Please provide with some examples

 

 

Thanks for advance

Hi All,

 

  I am new to "entitle management ". I have configured  the Entitle management   through  its implementation guide, I am struck at Milestone success actions.,How do  milestone initial response  get success state , can any one provide information to get initial response status is successful , Please  provide with some examples

 

Thanks for advance

HI all,

      

         I am new to development . I am working  with  idea and vote , In my oraganizartion  2 users are there. the 1st user created  10 ideas and second user also created 10 ideas . now the  1st user  voted of second  user  ideas,  how can i find whether  1st user voted of second user ideas through  apex,  i want display the the total count  for howmany 2nd users ideas he voted , plz suggest me

 

thanks

Hi ,

 

   I came with one issue . I have a vf with Css and also used static resources in  the css. now this  css  is  using in other vf pages. I am calling css  in other vf pages with attribute  styleclass="----", but  css is  not  calling, How

 

 sample Example  is  in the first vf page:  

 

 

<apex:page cache="true" showHeader="false" contentType="text/css">

 

ibtLargeContentContainer h2, .ibtContentSplitPrimary h2, .ibtContentSplitSecondary h2 {
width: 100%;
border-bottom: 1px dotted #999999;
padding-bottom: 10px;
margin-bottom: 14px;
}

/***** home *****/

.ibtHomeContainer .ibtContentSplitPrimary, .ibtHomeContainer .ibtContentSplitSecondary {
margin-bottom: 20px;
}

.ibtHomeContainer {
font-size: 13px;
}

.ibtHomeContainer .ibtHomeIdeaList {
background: transparent url( {!$Resource.image_sectionMediumPlain} ) no-repeat scroll left bottom;
}

.ibtHomeContainer .ibtHomeIdeaList .ibtHomeIdeaListTop {
background: transparent url( {!$Resource.image_sectionMediumPlain} ) no-repeat scroll left top;
}  

 

Like that i have around 1500 line of css code  is there.

 

 

and this  css code in another vf pages with style class directly like

 

 

<apex:page controller="IdeaController" showHeader="false">
<apex:composition template="ideaLayoutWrapper">-->
<apex:define name="content">
<apex:outputPanel styleClass="ibtAboutContainer" layout="block">
<apex:image value="{!aboutBannerImageUrl}" rendered="{!!ISNULL(aboutBannerImageUrl)}" styleClass="ibtAboutBanner" />
<apex:outputPanel styleClass="ibtLargeContentContainer" layout="block">
<apex:outputPanel styleClass="ibtLargeContentTop" layout="block" />

----------

 

when run this  page  css is not applied , when   i place whole  css code in other page it's working  fine,  what is the problem , can any oe help me to solve this  issue

 

Thanks

Hi ,

 

   I came with one issue . I have a vf with Css and alsi used static resources alo used in  the css. now this  css  is  using in all toher vf pages. i am calling css  in other vf pages with attribute  styleclass="----", but  css is  not  calling, How

 

 sample Example  is  in the first vf page:  

 

 

<apex:page cache="true" showHeader="false" contentType="text/css">

 

ibtLargeContentContainer h2, .ibtContentSplitPrimary h2, .ibtContentSplitSecondary h2 {
width: 100%;
border-bottom: 1px dotted #999999;
padding-bottom: 10px;
margin-bottom: 14px;
}

/***** home *****/

.ibtHomeContainer .ibtContentSplitPrimary, .ibtHomeContainer .ibtContentSplitSecondary {
margin-bottom: 20px;
}

.ibtHomeContainer {
font-size: 13px;
}

.ibtHomeContainer .ibtHomeIdeaList {
background: transparent url( {!$Resource.image_sectionMediumPlain} ) no-repeat scroll left bottom;
}

.ibtHomeContainer .ibtHomeIdeaList .ibtHomeIdeaListTop {
background: transparent url( {!$Resource.image_sectionMediumPlain} ) no-repeat scroll left top;
}  

 

Like that i have around 1500 line of css code  is there.

 

 

and this  css code in another vf pages with style class directly like

<apex:page controller="IdeaController" showHeader="false">

<apex:composition template="ideaLayoutWrapper">-->
<apex:define name="content">
<apex:outputPanel styleClass="ibtAboutContainer" layout="block">
<apex:image value="{!aboutBannerImageUrl}" rendered="{!!ISNULL(aboutBannerImageUrl)}" styleClass="ibtAboutBanner" />
<apex:outputPanel styleClass="ibtLargeContentContainer" layout="block">
<apex:outputPanel styleClass="ibtLargeContentTop" layout="block" />

----------

 

when run this  page  css is not calling, , when  when  i place whole  css code in other page it's working  fine,  what is the proble , can any oe help me to solve this  issue

 

Thanks

 

 

Hi all,

 

          I came with one issue  that is, I have 20 visualforca pages  .  I nedd to assign css tabs for that visulaforce pages inorder to publidh them using force.site, how can we developed using css tabs,

Hi all,

 

        I have requirement on  sites,  I have 20 vf pages and theit classes,  I would like to publish all the 20 pages and  these vf pages are indual pages.  there  is  no  navigate link between them ,  How can we  publih all the cllasses and  vf pages , plz hint me 

 

 

Thanks.....................

HI all,

 

     I have a issue with  ideastandardsetController and IdeaStandardController .in  my calss  i am  using ideaStandardController and IdaestandardController  ,  while writting test coverage for  these a classes  i am getting error like " Consructed not defined "   i  have activatevated these classes from salesforce, evethough    i am gettin error. how can we resove this issue.

 .

HI All,

 

 

                HI ,   I have One internal user "Analyst" , He has all pwrmission on case object. but when   he opening the case record  getting  Error  Like  

 

 

URL No Longer Exists
You have attempted to reach a URL that no longer exists on salesforce.com.

You may have reached this page after clicking on a direct link into the application. This direct link might be:
• A bookmark to a particular page, such as a report or view
• A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link
• A link to a particular page in your email templates

If you reached this page through a bookmark, you are probably trying to access something that has moved. Please update your bookmark.

If you reached this page through any of the other direct links listed above, please notify your administrator to update the link.

If you reached this page through a link on our site, please report the broken link directly to our Support Team and we will fix it promptly. Please indicate the page you were on when you clicked the link 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!

 

 

 Can  any one  give the solutions  why it is coming

HI all,

 

     I have a issue with  ideastandardsetController and IdeaStandardController .in  my calss  i am  using ideaStandardController and IdaestandardController  ,  while writting test coverage for  these a classes  i am getting error like " Consructed not defined "   i  have activatevated these classes from salesforce, evethough    i am gettin error. how can we resove this issue.

 .

HI all ,

 

            I  have class with standardset controller   and written test class for that Class , I am getting erroe like"  if I pass sc1  i am getting error like   Compile Error: Constructor not defined: [IdeaListController].<Constructor>(ApexPages.StandardSetController) at line 27 column 33 amd  code Coverage 44% .  the standardsetcontroller is not covering , any one would help me

 

public class IdeaListController extends IdeaController {

Integer IdeaCountWhenMerged = 0;
public Idea[] mergeList {
get {
if (mergeList == null){
mergeList = [select Id from Idea where ParentIdeaId!=null];
}
return mergeList;
}
set;
}
public Idea[] ideas;
private static final Integer MAX_NUMBER_OF_IDEAS_PER_PAGE = 20;

public ApexPages.IdeaStandardSetController controller;
public Integer total {get;set;}
public String catName {get;set;}

// Page number variables
public Integer totalNumPages{get;set;}
public Integer numPages { get; set; }

public Boolean View {get;set;}
public Boolean ArcView {get;set;}
public Boolean ProView {get;set;}

public String reqWorkspaceBtnList {get;set;}
public String accessWorkspaceBtnList {get;set;}
public String hasAccesstoWorkspace {get;set;}
public Map<String,Integer> participantsList {get;set;}


public List<Id> accessWorkspaceList {get;set;}

public IdeaListController() {

}

public IdeaListController(ApexPages.IdeaStandardSetController controller) {
this.controller = controller;
accessWorkspaceBtnList = '';
reqWorkspaceBtnList = '';
hasAccesstoWorkspace ='';
accessWorkspaceList = new List<Id>();
participantsList = new Map<String, Integer>();
List<SObject> sobj = [SELECT Id,Status, (SELECT Id FROM Votes WHERE Type = 'Up' LIMIT 51),(SELECT Id,Number_Of_Participants__c from WorkspaceList__r)
FROM Idea WHERE Id IN :controller.getIdeaList() AND Categories != 'DevSummit 2012'];
List<Idea> tempIdeaList = (List<Idea>)sobj;
for(Idea obj: tempIdeaList) {
String mapId = obj.Id;
mapId = mapId.substring(0,15);
if (obj.Votes.size() > 50 && obj.Status == NULL) {
if(obj.WorkspaceList__r.size()==0){
reqWorkspaceBtnList += obj.Id + ',';
}
else{
accessWorkspaceBtnList += obj.Id + ',';
accessWorkspaceList.add(obj.Id);
participantsList.put(mapId,Integer.valueOf(obj.WorkspaceList__r[0].Number_Of_Participants__c));
}
}
else{
if(obj.WorkspaceList__r.size()>0){
accessWorkspaceBtnList += obj.Id + ',';
accessWorkspaceList.add(obj.Id);
participantsList.put(mapId,Integer.valueOf(obj.WorkspaceList__r[0].Number_Of_Participants__c));
}
}
}
List<WorkspaceUser__c> workspaceUserList = [Select WorkspaceList__c, WorkspaceList__r.Idea__c, UserName__c From WorkspaceUser__c where UserName__c = :userinfo.getUserId() and WorkspaceList__r.Idea__c IN :accessWorkspaceList];
for(WorkspaceUser__c wu : workspaceUserList){
hasAccesstoWorkspace += wu.WorkspaceList__r.Idea__c +',';
}

}

public String feedName {
get {
if (feedName == null) {
if (IdeaController.SORT_POPULAR.equals(sortParam)) {
feedName = IdeaFeedController.TYPE_POPULAR;

} else if (IdeaController.SORT_RECENT.equals(sortParam)) {
feedName = IdeaFeedController.TYPE_RECENT;

} else if (IdeaController.SORT_TOP.equals(sortParam)) {
feedName = IdeaFeedController.TYPE_TOP;

} else if (IdeaController.SORT_COMMENTS.equals(sortParam)) {
feedName = IdeaFeedController.TYPE_RECENT_COMMENTS;

} else {
feedName = IdeaFeedController.TYPE_POPULAR;

}
}
return feedName;
}
set;
}

public IdeaWithVote[] ideasWithVotes {
get {
if (ideasWithVotes == null) {
ideasWithVotes = IdeaWithVote.getIdeasWithVotes(getIdeas());


}
return ideasWithVotes;
}
set;
}

public String cat {get;set;}
public Integer catSize {get;set;}

public Idea[] getIdeas() {
if (ideas == null) {
if (controller != null) {
ideas = controller.getIdeaList();

}
}
return ideas;
}


public String getPageName() {
return PAGE_LIST;
}

public Boolean getHasPreviousPage() {
return getPageParamInt() > 1;

}

public Boolean getHasNextPage() {
return (ideas.size() == MAX_NUMBER_OF_IDEAS_PER_PAGE);
}

public Integer getPageNumber(){
return getPageParamInt();
}



//Caluculate total number of pages
public Integer gettotalpages(){
Integer tot;

for(Idea I : mergeList){
IdeaCountWhenMerged++;
}

//counting ideas for each category
if(categoryParam=='ArcGIS Server')
{
tot = getServerIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Desktop')
{
tot = getDesktopIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Desktop Extensions')
{
tot = getArcGISDesktopExtensions();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Engine')
{
tot = getEngineIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Explorer')
{
tot = getExplorerIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}

else if(categoryParam=='ArcGIS Online')
{
tot = getOnlineIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcLogistics')
{
tot = getArcLogistics();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}

else if(categoryParam=='Geodatabase')
{
tot = getGeoDatabase();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Imagery')
{
tot = getImagery();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Maps and Content')
{
tot = getMaps();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Mobile GIS')
{
tot = getMobilegis();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}

else if(categoryParam=='Business Analyst')
{
tot = getBusinessAnalyst();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Esri CityEngine')
{
tot = getCityEngine();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Other Products')
{
tot = getOtherProducts ();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Web Apps and APIs')
{
tot =getWebApps();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Production Mapping (PLTS)')
{
tot = getProdMap();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Service Ideas')
{
tot = getServiceIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Defense and Intelligence')
{
tot = getDefenseandIntelligence();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Education')
{
tot = getEducation();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Local Government')
{
tot = getLocalGovernment();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Mining')
{
tot = getMining();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Federal Government')
{
tot = getFederalGovernment();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Natural Resources')
{
tot = getNaturalResources();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Petroleum')
{
tot = getPetroleum();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}

else if(categoryParam=='Public Safety')
{
tot = getPublicSafety();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Utilities')
{
tot = getUtilities();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Telecommunications')
{
tot = getTelecommunications();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Transportation')
{
tot = getTransportation();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Other Industries')
{
tot = getOtherIndustries();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Water and Wastewater')
{
tot = getWaterandWastewater();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
/*else if(categoryParam=='EGUG 2010')
{
tot=getEGUG2010();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='DevSummit 2012')
{
tot=getDevSummit();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}*/
else if(categoryParam=='Training Ideas')
{
tot=getTrainingIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Runtime')
{
tot=getArcGISRuntime();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Oceans and Maritime')
{
tot=getOceansMaritime();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else
{
totalNumPages = Math.round(Math.ceil((this.controller.getResultSize()-IdeaCountWhenMerged) / ( 1.0 * this.controller.getPageSize())));
//this.controller.getResultSize()
}
return totalNumPages;
}
public String getSort(){
return sortParam;
}

//Do not display the page numbers for comments

public Boolean getcheckSort(){
if(sortParam=='Comments'||statusParam=='Under Consideration'||statusParam=='Implemented'||statusParam=='Deferred')
return false;
else
return true;
}

/* public integer getTest(){
integer intTotal ;

return intTotal;
} */

/*
public string pNUM {get;set;}
public String fullURL;
public String getURL(){
return ApexPages.CurrentPage().getURL();
}
public PageReference goToPage(){
PageReference pageRef = new PageReference(ApexPages.CurrentPage().getURL());
pageRef.getParameters().clear();
pageRef.getParameters().put('p',pNUM);
// pageRef.setRedirect(true);
return pageRef+;
} */

}

 this code not covering ...... How to cover this code  , My  test class is

 

static testMethod void testidealist controller()
{

IdeaTestUtil.setupTest();
TestIdeaController controller = new TestIdeaController();
Community cm=[select id from community];
idea Testideas=new idea(Tags__c='aaaaa',Status_Changed_By__c='bbbb',CommunityId=Cm.id,title='hii');
insert Testideas;
List<Idea> ideas= new List<Idea>();
ideas.add(Testideas);
//IdeaListController Ilc1=New IdeaListController();

ApexPages.StandardsetController sc1= new ApexPages.StandardsetController(Ideas);


IdeaListController Ilc=New IdeaListController() if I pass sc1  i am getting error like   Compile Error: Constructor not defined: [IdeaListController].<Constructor>(ApexPages.StandardSetController) at line 27 column 33

checkFeedName(IdeaController.SORT_POPULAR, IdeaFeedController.TYPE_POPULAR);
checkFeedName(IdeaController.SORT_RECENT, IdeaFeedController.TYPE_RECENT);
checkFeedName(IdeaController.SORT_TOP, IdeaFeedController.TYPE_TOP);
checkFeedName(IdeaController.SORT_COMMENTS, IdeaFeedController.TYPE_RECENT_COMMENTS);
checkFeedName('foo', IdeaFeedController.TYPE_POPULAR);

Ilc.getIdeas();
ILC.getPageNumber();
integer i=integer.valueof(ILC.gettotalpages());
string s= Ilc.getSort();
Boolean b=ILc.getcheckSort();


}

 

any one help tp reslove this proble,

Hi  All,

 

  I have  a class , I have written Test class for that . I am Getting only 54%.   any one help to get &5 %

 

Class

-----------------

public class ideauser {

public list<AggregateResult> lstAr = new list<AggregateResult>();
public list<AggregateResult> lstAr1 = new list<AggregateResult>();
public list<Profile> pid = new list<Profile>();
public List<User> uid = new List<User>();

public ideauser()
{
pid = [select Id from Profile where name = 'Customer Portal Ideas User'];
//pid = [select Id from Profile where name = 'Themes Ideas Portal User'];
uid=[select Id from User where ProfileId IN :pid and LastLoginDate=this_week];
lstAr = [select CreatedBy.CommunityNickname Name, count(Id) Total from idea where CreatedDate=This_Week and CreatedById IN :uid group by CreatedBy.CommunityNickname order by count(Id) DESC limit 3];
lstAr1 = [select CreatedBy.CommunityNickname Name, count(Id) Total from IdeaComment where CreatedDate=This_Week and CreatedById IN :uid group by CreatedBy.CommunityNickname order by Count(Id) DESC limit 3];
}
public list<Ideaclass1> getResultsVotes()
{
list<Ideaclass1> lstResult1 = new list<Ideaclass1>();
for(AggregateResult ar1 : lstAr1)
{
Ideaclass1 objIdeaclass1 = new Ideaclass1(ar1);
lstResult1.add(objIdeaclass1);
}
return lstResult1;
}
public list<Ideaclass> getResults()
{
list<Ideaclass> lstResult = new list<Ideaclass>();
for(AggregateResult ar : lstAr)
{
Ideaclass objIdeaclass = new Ideaclass(ar);
lstResult.add(objIdeaclass);
}
return lstResult;
}

class Ideaclass
{
public Integer Total
{get;set;}
public String Name
{get;set;}

public Ideaclass(AggregateResult ar)
{
Total = (Integer) ar.get('Total');
Name = (String)ar.get('Name');
}
}
class Ideaclass1{
public Integer Total
{get;set;}
public String Name
{get;set;}

public Ideaclass1(AggregateResult ar1)
{
Total = (Integer) ar1.get('Total');
Name = (String)ar1.get('Name');
}

}

}

 

 

test class:

-----------------------

 

@istest

Private class Testideauser{
Private static testMethod void testideauser(){

idea id1=new idea(Tags__c='aaaaa',Status_Changed_By__c='3333',title='hiidea',CommunityId='09aE00000007RhMIAU');
insert id1;
idea id2=new idea(Tags__c='bbbbb',Status_Changed_By__c='aaaa',title='hiidea',CommunityId='09aE00000007RhMIAU');
insert id2;
idea id3=new idea(Tags__c='ccccc',Status_Changed_By__c='bbbb',title='hiidea',CommunityId='09aE00000007RhMIAU');
insert id3;
idea id4=new idea(Tags__c='adddddd',Status_Changed_By__c='rrrrrr',title='hiidea',CommunityId='09aE00000007RhMIAU');
insert id4;
idea id5=new idea(Tags__c='ssss',Status_Changed_By__c='zzzzz',title='hiidea',CommunityId='09aE00000007RhMIAU');
insert id5;
idea id6=new idea(Tags__c='yyyyy',Status_Changed_By__c='xxxx',title='hiidea',CommunityId='09aE00000007RhMIAU');
insert id6;
idea id7=new idea(Tags__c='zzzzzz',Status_Changed_By__c='yyyyy',title='hiidea',CommunityId='09aE00000007RhMIAU');
insert id7;

list<AggregateResult> lstAr = new list<AggregateResult>();
list<AggregateResult> lstAr1 = new list<AggregateResult>();
String Uid =UserInfo.getUserId() ;
lstAr = [select CreatedBy.CommunityNickname Name, count(Id) Total from idea where CreatedDate=This_Week and CreatedById =:uid group by CreatedBy.CommunityNickname order by count(Id) DESC limit 3];
lstAr1 = [select CreatedBy.CommunityNickname Name, count(Id) Total from IdeaComment where CreatedDate=This_Week and CreatedById =:uid group by CreatedBy.CommunityNickname order by Count(Id) DESC limit 3];
ideauser u = new ideauser();
u.getResultsVotes();
u.getResults();


}
}

 

The Red color code is not coveing , please help me

Hi all ,

      

 I  have a class   On User object  , I  have Written Test class for that that class   , I am Gettin  only 51% ,  How can i   improve that above 75%.  Plaease help  me , My  

 

Apex calss:

 

public class IdeaForgotPasswordController extends IdeaController {
public String email {get; set;}

public IdeaForgotPasswordController() {
}

public PageReference forgotPassword() {
if (!isValid()) {
return null;
}

String username = null;
if (email != null && email != '') {
List<User> users = [select username from user where username = :email];
if (users.size() == 1) {
// exact match on username
username = users.get(0).username;
}
else {
users = [select username from user where email = :email];
if (users.size() == 1) {
// exact match on email address
username = users.get(0).username;
}
}
}

if (username == null) {
addErrorMessage('User not found');
return null;
}

boolean success = Site.forgotPassword(username);
if (success) {
PageReference pr = new PageReference(URL_FORGOT_PASSWORD_CONFIRM);
pr.setRedirect(true);
return pr;
}
return null;
}

public boolean isValid() {
boolean valid = true;

if (email == '') {
addErrorMessage('Email address is required.');
valid = false;
}

return valid;
}

private void addErrorMessage(String message) {
ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, message);
ApexPages.addMessage(msg);
}

}

 

 

Test  class Fort that Class

------------------------------------

 

@isTest
private clAss IdeaForgotPasswordControllerTest
{
static TestMethod Void TestIdeaForgetpassword()
{

Profile p = [SELECT Id FROM Profile WHERE Name='Standard User'];
User u = new User(Alias = 'eerer',
EmailEncodingKey='UTF-8', LastName='bbbbb', LanguageLocaleKey='en_US',
LocaleSidKey='en_US', ProfileId = p.Id, Email='adityavyas.sf@gmail.com',
TimeZoneSidKey='America/Los_Angeles', UserName='adityavyas.sf@gmail.com');
List<User> users = [select username from user where username = :U.email];

System.runAs(u) {
// The following code runs as user 'u'

System.debug('Current User: ' + UserInfo.getUserName());
System.debug('Current Profile: ' + UserInfo.getProfileId()); }

IdeaForgotPasswordController ideaforget= New IdeaForgotPasswordController();
Pagereference page=ideaforget.forgotPassword();

}
}

Hi All

 

    I am Getting problem with  Apex.pages StandardsetController My apex class is 

public class IdeaListController extends IdeaController {

    Integer IdeaCountWhenMerged = 0;
    public Idea[] mergeList {
        get {
            if (mergeList == null){
                mergeList = [select Id from Idea where ParentIdeaId!=null]; 
            }
        return mergeList; 
        }
        set;
    }
    public Idea[] ideas;  
    private static final Integer MAX_NUMBER_OF_IDEAS_PER_PAGE = 20; 

    public ApexPages.IdeaStandardSetController controller;
    public Integer total {get;set;}
    public String catName {get;set;}

    // Page number variables
    public Integer totalNumPages{get;set;}
    public Integer numPages { get; set; }

    public Boolean View {get;set;}
    public Boolean ArcView {get;set;}
    public Boolean ProView {get;set;}

    public String reqWorkspaceBtnList {get;set;}
    public String accessWorkspaceBtnList {get;set;}
    public String hasAccesstoWorkspace {get;set;}
    public Map<String,Integer> participantsList {get;set;}
    
    
    public List<Id> accessWorkspaceList {get;set;}
    
    public IdeaListController() {
        
    }

    public IdeaListController(ApexPages.IdeaStandardSetController controller) {        
        this.controller = controller; 
        accessWorkspaceBtnList = '';
        reqWorkspaceBtnList = '';
        hasAccesstoWorkspace ='';
        accessWorkspaceList = new List<Id>(); 
        participantsList = new Map<String, Integer>();    
        List<SObject> sobj = [SELECT Id,Status, (SELECT Id FROM Votes WHERE Type = 'Up' LIMIT 51),(SELECT Id,Number_Of_Participants__c  from WorkspaceList__r) 
                              FROM Idea WHERE Id IN :controller.getIdeaList() AND Categories != 'DevSummit 2012'];
        List<Idea> tempIdeaList = (List<Idea>)sobj;
        for(Idea obj: tempIdeaList) {
            String mapId = obj.Id;
            mapId = mapId.substring(0,15);              
            if (obj.Votes.size() > 50 && obj.Status == NULL) {                 
                if(obj.WorkspaceList__r.size()==0){
                    reqWorkspaceBtnList += obj.Id + ',';
                }
                else{
                    accessWorkspaceBtnList += obj.Id + ',';
                    accessWorkspaceList.add(obj.Id);                                      
                    participantsList.put(mapId,Integer.valueOf(obj.WorkspaceList__r[0].Number_Of_Participants__c));
                }
            }
            else{
                if(obj.WorkspaceList__r.size()>0){
                    accessWorkspaceBtnList += obj.Id + ',';
                    accessWorkspaceList.add(obj.Id);
                    participantsList.put(mapId,Integer.valueOf(obj.WorkspaceList__r[0].Number_Of_Participants__c));
                }
            }
        }
        List<WorkspaceUser__c> workspaceUserList = [Select WorkspaceList__c, WorkspaceList__r.Idea__c, UserName__c From WorkspaceUser__c where UserName__c = :userinfo.getUserId() and WorkspaceList__r.Idea__c IN :accessWorkspaceList];
        for(WorkspaceUser__c wu : workspaceUserList){
            hasAccesstoWorkspace += wu.WorkspaceList__r.Idea__c +',';
        }
        
    }

    public String feedName {
        get {
            if (feedName == null) {
                if (IdeaController.SORT_POPULAR.equals(sortParam)) {
                    feedName = IdeaFeedController.TYPE_POPULAR;
                    

                } else if (IdeaController.SORT_RECENT.equals(sortParam)) {
                    feedName = IdeaFeedController.TYPE_RECENT;
                  
                } else if (IdeaController.SORT_TOP.equals(sortParam)) {
                    feedName = IdeaFeedController.TYPE_TOP;
                   
                } else if (IdeaController.SORT_COMMENTS.equals(sortParam)) {
                    feedName = IdeaFeedController.TYPE_RECENT_COMMENTS;
                  
                } else {
                    feedName = IdeaFeedController.TYPE_POPULAR;
                 
                }               
            }
            return feedName;
        }
        set;
    }
   /* 
    public IdeaWithVote[] ideasWithVotes {
        get {
            if (ideasWithVotes == null) {
                ideasWithVotes = IdeaWithVote.getIdeasWithVotes(getIdeas());
                
         
            }
            return ideasWithVotes;
        }
        set;
    }
    */
    public String cat {get;set;}
    public Integer catSize {get;set;}
    
    public Idea[] getIdeas() {
        if (ideas == null) { 
            if (controller != null) {
                ideas = controller.getIdeaList();
         
            } 
           }   
        return ideas;
    }
   
      
    public String getPageName() {
        return PAGE_LIST;
    }

   public Boolean getHasPreviousPage() {
        return getPageParamInt() > 1;
       
    }

    public Boolean getHasNextPage() {
       return (ideas.size() == MAX_NUMBER_OF_IDEAS_PER_PAGE);        
    }     
     
     public Integer getPageNumber(){
       return getPageParamInt();
     }
     
   
     
     //Caluculate total number of pages
     public Integer gettotalpages(){
         Integer tot;
         
         for(Idea I : mergeList){
             IdeaCountWhenMerged++;
         }
     
         //counting ideas for each category
          if(categoryParam=='ArcGIS Server')
         {                       
                tot =  getServerIdeas();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
         else if(categoryParam=='ArcGIS Desktop')
         {                       
                tot = getDesktopIdeas();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='ArcGIS Desktop Extensions')
         {                       
                tot = getArcGISDesktopExtensions();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='ArcGIS Engine')
         {                       
                tot = getEngineIdeas();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='ArcGIS Explorer')
         {                       
                tot = getExplorerIdeas();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          
          else if(categoryParam=='ArcGIS Online')
         {                       
                tot = getOnlineIdeas();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='ArcLogistics')
         {                       
                tot = getArcLogistics();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          
          else if(categoryParam=='Geodatabase')
         {                       
                tot = getGeoDatabase();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Imagery')
         {                       
                tot = getImagery();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Maps and Content')
         {                       
                tot = getMaps();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Mobile GIS')
         {                       
                tot = getMobilegis();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }

          else if(categoryParam=='Business Analyst')
         {                       
                tot = getBusinessAnalyst();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
         else if(categoryParam=='Esri CityEngine')
         {                       
                tot = getCityEngine();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Other Products')
         {                       
                tot = getOtherProducts ();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Web Apps and APIs')
         {                       
                tot =getWebApps();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Production Mapping (PLTS)')
         {                       
                tot = getProdMap();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Service Ideas')
         {                       
                tot = getServiceIdeas();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Defense and Intelligence')
         {                       
                tot = getDefenseandIntelligence();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Education')
         {                       
                tot =  getEducation();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Local Government')
         {                       
                tot = getLocalGovernment();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Mining')
         {                       
                tot = getMining();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Federal Government')
         {                       
                tot = getFederalGovernment();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Natural Resources')
         {                       
                tot = getNaturalResources();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
         else if(categoryParam=='Petroleum')
         {                       
                tot = getPetroleum();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }

          else if(categoryParam=='Public Safety')
         {                       
                tot = getPublicSafety();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Utilities')
         {                       
                tot = getUtilities();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
         else if(categoryParam=='Telecommunications')
         {                       
                tot = getTelecommunications();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Transportation')
         {                       
                tot = getTransportation();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Other Industries')
         {                       
                tot = getOtherIndustries();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
          else if(categoryParam=='Water and Wastewater')
         {                       
                tot = getWaterandWastewater();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize()))); 
         }
         /*else if(categoryParam=='EGUG 2010')
         {
                tot=getEGUG2010();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
         }
         else if(categoryParam=='DevSummit 2012')
         {
                tot=getDevSummit();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
         }*/
        else if(categoryParam=='Training Ideas')
         {
                tot=getTrainingIdeas();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
         }
         else if(categoryParam=='ArcGIS Runtime')
         {
                tot=getArcGISRuntime();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
         }
         else if(categoryParam=='Oceans and Maritime')
         {
                tot=getOceansMaritime();
                totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
         }
         else
         {
                totalNumPages = Math.round(Math.ceil((this.controller.getResultSize()-IdeaCountWhenMerged) / ( 1.0 * this.controller.getPageSize())));    
                 //this.controller.getResultSize() 
         }
         return totalNumPages;
     }
     public String getSort(){
         return sortParam;
     }
     
     //Do not display the page numbers for comments
     
     public Boolean getcheckSort(){
         if(sortParam=='Comments'||statusParam=='Under Consideration'||statusParam=='Implemented'||statusParam=='Deferred')
             return false;
         else
             return true;
     }
      
 /*    public integer getTest(){        
         integer intTotal ;
   
        return intTotal;
     } */
   
   /*     
     public string pNUM {get;set;}
     public String fullURL;
     public String getURL(){
         return ApexPages.CurrentPage().getURL();
     }
     public PageReference goToPage(){
         PageReference pageRef = new PageReference(ApexPages.CurrentPage().getURL());
         pageRef.getParameters().clear();
         pageRef.getParameters().put('p',pNUM);
       //  pageRef.setRedirect(true);
         return pageRef+;     
    }  */
    
}

 

 I ahve written  test class Fo that class 

 

private class IdeaListControllerTest {
static testMethod void testFeedName()
{
Idea Testidea= new idea(Status_Changed_By__c='yyyy',Tags__c='xxxx' );
ApexPages.StandardController sc = new ApexPages.StandardController(Testidea);
IdeaListController Ilc=New IdeaListController();
IdeaListController Ilc1=New IdeaListController(sc);
checkFeedName(IdeaController.SORT_POPULAR, IdeaFeedController.TYPE_POPULAR);
checkFeedName(IdeaController.SORT_RECENT, IdeaFeedController.TYPE_RECENT);
checkFeedName(IdeaController.SORT_TOP, IdeaFeedController.TYPE_TOP);
checkFeedName(IdeaController.SORT_COMMENTS, IdeaFeedController.TYPE_RECENT_COMMENTS);
checkFeedName('foo', IdeaFeedController.TYPE_POPULAR);

Ilc.getIdeas();
ILC.getPageNumber();
ILC.gettotalpages();
Ilc.getSort();
ILc.getcheckSort();
}

 

 

 .   

HI,

 

 Hi have a requirement lilke Convertinh EMail Template Into  XMl File , how to do  it, Can any one send the sample Code

 

 

Thanks

  • September 11, 2012
  • Like
  • 0

HI all,

 

 

                    I wnat to send private chatter meassge from apex code , pla any one provide sample  apex code  to send private chatter Messages.

  • September 10, 2012
  • Like
  • 0

HI all,

 

          I am  using  actionPollar tag   , and i set the time inteval  5 secs, so that means for every 5 secs the page is refreshed. 

How can i stop refreshing  after 5 refreshes,  iam using  action pollar in  my vf page

 

vf page:

-------------

<apex:page controller="Records20" sidebar="false" >
<apex:form >
<apex:outputpanel rendered="{!displayRecords}" >

<apex:pageblock Title="Answers the Questions">

<b><apex:outputText value="Your Time Starts Now: {!Timer}:00 Min" id="counter"/></b>
<apex:actionPoller action="{!incrementCounter}" rerender="counter " interval="15"/>
<br/>
<br/>

<apex:pageBlockButtons location="bottom">

<apex:commandButton value="Submit" action="{!saveAnswer}" id="button"/><br/>
</apex:pageBlockButtons>
<apex:repeat value="{!items1}" var="it">
<apex:outputText value="{!it.intSerial}"> </apex:outputText>).&nbsp;<apex:outputText value="{!it.strQuestion}"></apex:outputText>
<apex:SelectRadio value="{!it.answer12}">
<apex:selectoptions value="{!it.itemsWrap}"/>
</apex:SelectRadio><br/>
</apex:repeat>
</apex:pageblock>
</apex:outputpanel>
YOUR RESULT IS:&nbsp;&nbsp;<apex:outputText value="{!intCount}"></apex:outputText>
</apex:form>
</apex:page>

__________

controlle---

 

 

public class Records20{

public Integer Timer;
public boolean displayRecords{set;get;}
public string answer1{set;get;}
public List<selectOption> selItems {get;set;}
public integer intCount{get;set;}
list<wrapperQuestions> objwraplst = new list<wrapperQuestions>();
list<Questiuons__c> ques=new list<Questiuons__c>();


public Records20()
{
Timer=0;
displayRecords=true;
list <Questiuons__c> ret=[SELECT id,Question__c,Answers__c,Correctanswer__c FROM Questiuons__c LIMIT 20 ];
ret = ObjectRandomizer.randomizeList (ret);
integer serial=0;
for(Questiuons__c a :ret )
{
System.debug('aaa'+a);
String s = a.Answers__c;
list<string> st =s.split(',');
wrapperQuestions objWrap = new wrapperQuestions();
objWrap.strQuestion = a.Question__c;
objWrap.correctAnswer=a.Correctanswer__c;
serial=serial+1;
objWrap.intSerial=serial;
selItems = new List<selectOption>();
for(String str:st)
{
selItems.add(new SelectOption(str,str));

objWrap.itemsWrap=selItems;

}

objwraplst.add(objWrap);

}
}

public void saveAnswer()
{
intCount=0;
for(wrapperQuestions objwrap:objwraplst)
{
system.debug('::::::::::::'+objwrap.answer12);
if(objwrap.answer12==objwrap.correctAnswer)
{
//intCount = intCount+1;
intCount++;
displayRecords=false;

}else
displayRecords=false;
}

}

public PageReference incrementCounter() {
if(Timer<=5)
Timer++;
system.debug('@@@@@@@@@@@'+timer);
return null;
}

public Integer getTimer() {
system.debug('!!!!!!!!!!!!!!'+timer);
return Timer;
}
public list<wrapperQuestions> getitems1()
{
return objwraplst;
}


public class wrapperQuestions
{
public string strQuestion{get;set;}
public integer intSerial{get;set;}
public List<selectOption> itemsWrap {get;set;}
public string answer12{set;get;}
public string correctAnswer{set;get;}

}

}

  Any one can help me

  • September 03, 2012
  • Like
  • 0

Hi all,

 

  my senario is like online exam.   I developed one   vf page for displaying  20 questions(records) from question obeject .  i need to   set  timer  for vf page ,  suppose  i am having   20 questions in vf page . i nedd to set 20 min . after twenty 20 min that visual force page  should not appeared  , i can only show the result. How to set the timer for visual force page  ,plz  any on help me

  • September 02, 2012
  • Like
  • 0

HI ,

 

        I have  written     apex page  for dispalying     questions random ly   form my custom object  ,   while   runing  iam getting System.NullPointerException: Attempt to de-reference a null object  Class.Records20.: line 20, column 1,  , i check ed with console iam getting values ,  i don't know y it is coming ,  i wll show my apex class and   vf and random number gentation calss.

 

Vf page
--------------------------------
<apex:page controller="Records20" sidebar="false" >
<apex:form >
<apex:pageblock Title="Answers the Questions">
<apex:pageBlockButtons location="bottom">

<apex:commandButton value="Submit" action="{!saveAnswer}"/><br/>
</apex:pageBlockButtons>
<apex:repeat value="{!items1}" var="it">
<apex:outputText value="{!it.intSerial}"> </apex:outputText>).&nbsp;<apex:outputText value="{!it.strQuestion}"></apex:outputText>



<apex:SelectRadio value="{!it.answer12}">
<apex:selectoptions value="{!it.itemsWrap}"/>
</apex:SelectRadio><br/>
</apex:repeat>



</apex:pageblock>
YOUR RESULT IS:&nbsp;&nbsp;<apex:outputText value="{!intCount}"></apex:outputText>
</apex:form>
</apex:page>
--------------------------------------
vf page Controller

public class Records20{

public string answer1{set;get;}
public List<selectOption> selItems {get;set;}
public integer intCount{get;set;}
list<wrapperQuestions> objwraplst = new list<wrapperQuestions>();
list<Questiuons__c> ques=new list<Questiuons__c>();


public Records20()
{
list <Questiuons__c> ret=[SELECT id,Question__c,Answers__c,Correctanswer__c FROM Questiuons__c ];
ret = ObjectRandomizer.randomizeList (ret);
integer serial=0;
for(Questiuons__c a :ret )
{
System.debug('aaa'+a);
String s = a.Answers__c;
list<string> st =s.split(',');-----------  i am gettin  that error here
wrapperQuestions objWrap = new wrapperQuestions();
objWrap.strQuestion = a.Question__c;
objWrap.correctAnswer=a.Correctanswer__c;
serial=serial+1;
objWrap.intSerial=serial;
selItems = new List<selectOption>();
for(String str:st)
{
selItems.add(new SelectOption(str,str));

objWrap.itemsWrap=selItems;

}

objwraplst.add(objWrap);

}
}

public void saveAnswer()
{
intCount=0;
for(wrapperQuestions objwrap:objwraplst)
{
system.debug('::::::::::::'+objwrap.answer12);
if(objwrap.answer12==objwrap.correctAnswer)
{
//intCount = intCount+1;
intCount++;
}
}

}
public list<wrapperQuestions> getitems1()
{
return objwraplst;
}


public class wrapperQuestions
{
public string strQuestion{get;set;}
public integer intSerial{get;set;}
public List<selectOption> itemsWrap {get;set;}
public string answer12{set;get;}
public string correctAnswer{set;get;}

}

}
-------------------------------------------------------------
// Random Number generation
public class ObjectRandomizer {

public static list<Questiuons__c> randomizeList (list<Questiuons__c> Records){

list <Questiuons__c> retList = new list <Questiuons__c>();

while (records.size()>0){
system.debug('++++++' + records.size());
retList.add(records.remove(getRandomInt(records.size())));
}

return retList;
}

public static Integer getRandomInt (Integer num){
Double d = math.random() * num;
return d.intValue();
}

}

  when i  check console iam getting values , console is

3:53:29.055 (55560000)|SYSTEM_METHOD_EXIT|[21]|String.valueOf(Object)
23:53:29.055 (55568000)|HEAP_ALLOCATE|[21]|Bytes:95
23:53:29.055 (55578000)|SYSTEM_METHOD_ENTRY|[21]|System.debug(ANY)
23:53:29.055 (55583000)|USER_DEBUG|[21]|DEBUG|&&&&&&&&&&&&&&(Visible light, Infrared radiation, X-rays and gamma rays, Ultraviolet radiation)
23:53:29.055 (55589000)|SYSTEM_METHOD_EXIT|[21]|System.debug(ANY)
23:53:29.055 (55594000)|STATEMENT_EXECUTE|[23]
23:53:29.060 (60731000)|SYSTEM_METHOD_ENTRY|[19]|System.debug(ANY)
23:53:29.060 (60737000)|USER_DEBUG|[19]|DEBUG|$$$$$$$$$$$Repo rate ,Reverse repo rate,Cash Reserve ratio,base rate
23:53:29.060 (60743000)|SYSTEM_METHOD_EXIT|[19]|System.debug(ANY)
23:53:29.060 (60747000)|STATEMENT_EXECUTE|[20]

  what is the problem , can any one help me

  • September 01, 2012
  • Like
  • 0

Hi all,

 

     I am  moving  one  apex class from sandbox to production.   it is uploaded succesfully  in sandbox,  when i am  validating   that class in production ,  i  am getting  "system.assertEquals   error", becuase of two test classes in procution, ,I don't have t two test classes in my sandbox to put comments  that lines, what can i do  to resolve this prob, I am using changesets  for deploying , any one can help me 

Hello,
I've configured Live Agent to Work with the Custom Portal without using Sites, but the pre-chat form functionality is not working.  
Problem
The actual behavior is, when the customer clicks on the link to chat with a live agent and the live agent accepts, the customer is immediately able to chat with the live agent. 
Desired Behavior
The expected behavior is, when a customer clicks on a link to chat with a live agent and the live agent accepts the chat, the customer should complete a pre-chat form before proceeding to chat with the live agent. 
Resources
The pre chat form is created using examples provided by salesforce (I used the code in the example verbatim and I also tried using code from Pre-Chat form with some CSS.pdf). The visualforce page renders standalone, but it does not appear when the user clicks on a button.  The visualforce pages are associated with the customer portal user's profile.  I've used the example attached as well as the example in the official live chat developer's guide.  http://www.salesforce.com/us/developer/docs/live_agent_dev/index.htm.  The documentation does not provide enough information to implement the pre-chat form successfully.  
Another member from our team reviewed this issue and did not see where the javascript references the button and also believed the documentation is light.
Does the visualforce page only work with sites?  Is there an existing environment setup where this feature is working?  Do you have any sample pre-chat forms that use html/javascript instead of visualforce pages?
Thank you in advance for your help.  I have a video demonstrating the problem, if that will help  http://www.screencast.com/t/Xgv8EQDb4.
  • March 02, 2012
  • Like
  • 0

Does anybody know how to test an Idea Extension controller?

 

Salesforce have activated for me the IdeaStandardSetController and IdeaStandardController classes.

 

My code is as follows. The commented out text at the bottom of the test method are the options I have tried.

 

I have reviewed the documentation on Ideas controllers and I see the following;

Instantiation

An IdeaStandardController object cannot be instantiated. An instance can be obtained through a constructor of a custom extension controller when using the standard ideas controller.

 

As you can see from the below, I am using the IdeaStandardController and with that logic based on the above instantiation note I would have presumed my option two (in test method below) would be working.

 

The error message I get is as follow;

Compile Error: Constructor not defined: [ideaExtension].<Constructor>(ApexPages.StandardController) at line 51 column 29 

 

This corresponds to the first line in option 2.

 

public class ideaExtension{

    private final ApexPages.IdeaStandardController ideaController;
    public Idea idea {get;set;}
    public String commentBody{get;set;}
    public Boolean msgCommentPostingSuccess {get;set;}
    public Boolean msgCommentPostingError {get;set;}
    public String msgCommentPostingErrorSummary {get;set;}
    
    public ideaExtension(ApexPages.IdeaStandardController controller) {
        ideaController = (ApexPages.IdeaStandardController)controller;
        idea = (Idea)ideaController.getRecord();
        msgCommentPostingSuccess = false;
        msgCommentPostingError = false;
    }

    public PageReference insertComment(){
        IdeaComment comment = new IdeaComment();
        comment.CommentBody = commentBody;
        comment.IdeaId = idea.Id;
        try {  
            insert comment;
            msgCommentPostingSuccess = true;
        }
        catch(Exception ex) {
            // handle exception code here;
        }
        return null;  
     }
 
     /* TEST DATA METHODS */
     public static Idea createIdea(){
         Idea i = new Idea();
         i.Title = 'New Idea';
         i.body = 'My idea description';
         insert i;
         return i;
     }    
    static testMethod void testNewComment(){
        /* Create the test data */
        Idea testIdea = createIdea();
        
        /* Instatiate controller */

        // not working - Option 1
        //ApexPages.IdeaStandardController stdController = new ApexPages.IdeaStandardController(testIdea);
        //ideaExtension ext = new ideaExtension(stdController);
        
        // not working - Option 2
        //ApexPages.StandardController stdController = new ApexPages.StandardController(testIdea);
        //ideaExtension ext = new ideaExtension(stdController);

        // not working - Option 3
        //ideaExtension ext = new ideaExtension();
        
        /* Make assertions to validate logic */
        
    }   
}