• Anand@SAAS
  • SMARTIE
  • 1034 Points
  • Member since 2008

  • Chatter
    Feed
  • 40
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 243
    Replies

 

Page size is 10, Total records = 17.code that is being called:

 

 

this.setCtlr.next();
//populateData iterates using getRecords()
populateData();

 

 

Debug Log is below:

 

18:51:36.359|USER_DEBUG|[4]|DEBUG|>>>>>>>>>>>>>>>> MyMarketController>>>>>>>>>>>setCtlr.TotalSize=17
18:51:36.359|METHOD_EXIT|[4]|System.debug(ANY)
18:51:36.359|METHOD_EXIT|[202]|ALMLogUtils.log(String, String)
18:51:36.359|METHOD_ENTRY|[203]|01pQ00000004ZfQ|ALMLogUtils.log(String, String)
18:51:36.359|METHOD_ENTRY|[203]|ApexPages.StandardSetController.getHasNext()
18:51:36.359|METHOD_EXIT|[203]|ApexPages.StandardSetController.getHasNext()
18:51:36.359|METHOD_ENTRY|[4]|System.debug(ANY)
18:51:36.359|USER_DEBUG|[4]|DEBUG|>>>>>>>>>>>>>>>> MyMarketController>>>>>>>>>>>setCtlr.HasNext=true
18:51:36.359|METHOD_EXIT|[4]|System.debug(ANY)
18:51:36.359|METHOD_EXIT|[203]|ALMLogUtils.log(String, String)
18:51:36.359|METHOD_ENTRY|[204]|ApexPages.StandardSetController.next()
18:51:36.359|EXCEPTION_THROWN|[EXTERNAL]|System.VisualforceException: Modified rows exist in the records collection!
18:51:36.360|METHOD_EXIT|[204]|ApexPages.StandardSetController.next()
18:51:36.360|CODE_UNIT_FINISHED|MyMarketController invoke(next)

Hi,

 

I am trying to expand and collapse a list upon clicking a link. The expanded list is a list of links that display some information. Everything is working as expected but, when I expand the list and  click on any link the list get collapsed (My JQuery code displays the collapsed list on page load). What I want to do is even after the refresh I do not want the list to Collapse unless I click on it to collapse. I wonder is this possible. My Jquery is as follows:

 

<script type="text/JavaScript" src="{!URLFOR($Resource.jQuery)}"></script>
       <script type="text/JavaScript">
           jQuery.noConflict();
           
           jQuery(document).ready(function($) {
           
               $("#ProductPanel").hide();
     
               $("#HorBulb").hide();
         
           
               $('#ProductDetails').click(function() {
                   if($("#ProductPanel").is(":hidden")) {
                       $("#ProductPanel").slideDown("slow");
                       $("#HorBulb").show();
                       $("#VerBulb").hide();
                       return false;
                   }
                   else{
                      $("#ProductPanel").hide("slow");
                       $("#HorBulb").hide();
                        $("#VerBulb").show();
                      return false;
                   }
               });
                         
           
       </script>  

 

When the list expands, I am displaying an horizontal bulb and when the list collapses i am displaying vertical bulb.

 

Thanks in advance

Hi guys,

 

I've got a new VF page that is using a customer controller (VF controller extension).   All's well.   The VF page has an autorun event defined as its action that is invoked via a custom button on a Task sObj.  

 

I can run this little "app" from within SF just fine and preview the SF Debug Logs looking for output from my System.debug statements.   However, this is pretty clumsy and I'm thinking there's got to be a better way to run this little VF applet from the Force.com Debug perspective under Eclipse.  

 

Right now all I have in my Eclipse project is my src->pages-> myPage and src->classes->myClass.   Can I add the stock SF Task sObj to my project and somehow run my tests from Eclipse where I can set breakpoints, etc??   Please, there's got to be a way and I'm just missing some area of the documentation that might explain how to set this up.

 

Thanks very much in advance for any direction one of you might be able to extend.

 

Best regards,

Paul 

This might be a silly question but i am unable to fix it.

I have an custom object created in sfdc which has more than 1000 records say 10000 records. But i am able to retrieve only 1000 records above that it is throwing an error , so how to  retrieve the 10000 records using soql query.

 

 Note: i dont want to apply limit here. I want to retrieve all the records.

 

Please let me know if any soln for this...

thanks

shaan

       

Hi,

 

I want to login to other salesforce organization and check wheather particular vf page exist or not on that org.

If present i want to redirect to that page on that org. Else want to show error page on my org.

I want to write the code in my Apex class.

For login I have used REST call. Configured https://login.salesforce.com in remote site settings.

Following is my code for login.

 

        HttpRequest req = new HttpRequest();
        req.setMethod('POST');
        req.setEndpoint('https://login.salesforce.com/?un='+userName+'&pw='+password+'&startURL=/apex/ABCPage');
       
        Http http = new Http();
        PageReference p;       
   
        try {
            HTTPResponse res = http.send(req);   
            showError = true;

            if(res.getStatusCode()== 302)
            {
                p = new PageReference('https://login.salesforce.com/?un='+userName+'&pw='+password+'&startURL=/apex/ABCPage');           
                showError = false;
            }

        } catch(System.CalloutException e) {
            //Exception handling goes here....
             System.debug('In catch '+e);           
        }

I don't know is it a right way? Please let me know if any other alternative possible? i am able to login and show that page using this code.

 

Same way is it possible to call Metadata API? Is there any endpoint available?

Or is there any other way to check if particular vf page i.e 'ABCPage' exist or not on other org through Apex code in my org?

 

i can get list of page in my org using

List<ApexPage> lstPages = [Select id, name from ApexPage];

Is there any way to get this list for other org?

 

Thanks..

 

Could someone point me towards any documentation on how to access a custom object's History tracking information through APEX?  I looked through the APEX reference but I may have missed it - if it's in there can you cite a page #?

Hey all, I am ramping up to start my first big visualforce project. I think it's not terribly complicated, but I could still use some design tips. Basically what we are trying to build is simple survey tool. I have 3 objects involved.

 

1) Contact

2) Question__c

3) Question_Answer__c

 

Question has 6 fields:

Active(checkbox)

Linked_field (text field)

Picklist_Values (text area)

Question_Name (text field)

Question_text (text area)

Question_Type (pickilist)

 

Question Answer has 3 fields:

Contact (Lookup to contact)

Question(Lookup to question)

Answer (text field)

 

What I want to happen is to host a visualforce page through Salesforce sites. The page invokes a controller that finds some random questionthis contact has not yet answered (defined as: no Question_answer__c record exists for this contact for this question__c), and presents them the question_text, and a fitting method of answering the question based on the question_type found in the related Question__C object. Once the question is answered, a Question_answer__c record is created and saved with the provided information. Then another question is picked at random that the user has not answered and the cycle repeats until all questions are answered, or the user stops.

 

So my questions are

1) Should I write a custom controller, or just extend one? Mostly this revolves around a Question__c object, because that contains all the information required for creating the question. Not sure exactly though, this being my first one and all.

2) How can I pick a record at random, that the user has NOT answered before? I imagine some kind of SOQL outer join type deal but the exact method for doing this escapes me.

3) Any clever ideas how I can create my dynamic answer__c field? This will probably be the hardest part. For example, if the qustion is a picklist (as specified in the question_type__c field on the question__c object), it needs create a piclist field, and populate it with the picklist_values field from the question__c object. If it is specified as a text field, it needs to render as a text field, etc.

 

4) Ideally the visualforce page could take the ID of a specific question to answer and it will grab that question instead of grabbing a random one. That should be pretty easy, just making note of it here so I remember :P

 

5) Kind of a side bar thing that will probably be handled later, but worth asking. Does anyone know if Salesforce sites offers the equivilent of session variables? I am going to need to write a login system eventually, so a contact can login with their username and password, and then begin answering questions. For now I'll probably just pass the contactId around in the URL so I know which contact to create the question_answer__c objects for, but eventually I'd like to move to something more secure.

 

Thanks for any insight. I really appreciate it!

I have a page template that has some JQuery code to display a tooltip (uses the SimpleTip jquery plugin). When I render the page template directly i see no javascript errors. When I call a page that uses the template and adds content to the template, I am seeing the below error:

 

 

Any idea what might be wrong ? The Javascript error prevents me from using an actionFunction that I have defined in the template. The action function works fine in Firefox and mozilla.

How to pass values to the show method on MRUHover.getHover({!cc1.Id}.show()...So,that when i move a mouse on to the item it should display some text  on Hover.

 

 

 

<div class="" onblur="MRUHoverDetail.getHover('{!cc1.Id}').hide();"
                                       onfocus="MRUHoverDetail.getHover('{!cc1.Id}').show();"
                                       onmouseout="MRUHoverDetail.getHover('{!cc1.Id}').hide();"
                                       onmouseover="MRUHoverDetail.getHover('{!cc1.Id}').show();">

Hey all,

I'm still getting the hang of object oriented programming, and I'm not sure how to solve this problem without "global variables".

 

Basically I have a large testing class. There is a seperate sub class for each trigger, page, and class that need to be tested. A lot of these tests though need the same type of data (contacts, accounts, leads, etc). How can I create one contact, one account, one lead, and let all the sub classes read from it and write to it? These being test classes, I cannot control what data is passed to them. So for example I have something like.

 

 

public static contact createTestContact()
{
    Contact testContact = new Contact(Firstname='Frank', Lastname='Jones');

       insert testContact;
       return testContact;
}

public testMethod void testContactTrigger1()
{
       Contact myContact = createTestContact();
       //Do some stuff
}

public testMethod void testContactOtherTrigger()
{
       Contact myContact = createTestContact();
       //Do some different stuff
}

 

How can I let testContactTrigger and testContactOtherTrigger share the same contact? I don't need two copies of the same contact, or the additional overhead that comes from instantiating it twice. Just once would be fine. Can I modify the createTestContact method to know when it has already created a contact once, and just return the same contact next time it is called?

 

While doing a mass insert using a batch process. If I get an error on a record , would it not insert the other records.

 

For example:

 

If I have to insert a list of Leads and a couple of leads in the list throw some errors , would it stop the operation for the whole list or just those records.

 

Hi Guys,

 

I have written a batch apex controller for my vf page.

In execute method of batch apex controller, i have a string variable "sample" and it is defined as

public String sample {get; set;} in that class.

 

but when i pass this variable to my page, it gives me null value.

i have used system.debug to check its value in my class and its showing the required value inside execute method.

 

So please help me on how this value can be passed to page correctly.Thanks

Hi,

since yesterday the code work properly and I saw the popup of url, but now it doesn't show me any popup

I want open popup with url every time if the stagename of opportunity is closed/won.

I have active the popup on chrome, ie , firefox.

What kind of problem is it ?

thank

 

 

<apex:page standardController="opportunity" >
    
  <script src="/soap/ajax/10.0/connection.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/functions.js"></script>
<script>

if ('{!Opportunity.StageName}' == 'closed/won') {
var url1= 'http://www.mysite.com/'
window.open(url1)
}
</script>

 

 

I need to find out listview for a specific user. How can I do that using Metadata API?

 

Any help?

 

Thanks.

could someone tell me (in English :) ) what the functional difference is between these two access modifiers?  from what I see, they both prevent access from outside classes, but what else?  what are the benefits of one vs. the other?

Is it possible to update the ID in a custom object in a managed package?  I want to be able to update the ID (which is an Autonumber with string) to add another string value such as:

 

From:

Intake-{0000001}

 

To:

Intake-{0000001} - Doe, Jane

 

This is because all the emails and tasks associated with the Intake only show the ID and it would be convenient to show the name of the person without needing to click into the record.  I was thinking an after update trigger could update the ID.

 

Thanks for any advice.

Hello,

Has anyone developed any multiple choice or survey applications in Salesforce.com out there? I have a similar project to develop multiple choices test in Salesforce.com but don't know how. Please advice. Please also send me some sample codes if available.

 

thanks

Paul