• d3developer
  • NEWBIE
  • 447 Points
  • Member since 2009

  • Chatter
    Feed
  • 18
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 59
    Questions
  • 277
    Replies

Does anyone have the complete Chatter Bubbles sample code, including the css/jquery?  It's not in chatter commons...


Thanks,

Jon

I have a method in my controller that is not being sween by the page, even though the names are identical

 

I am using a commandLink in a pageblocktable for each line. the action for the link goes to a method that requries a class object for its argument. Whereas each of the lines on the page are made up of these class objects, I apparently have to associate the line object with a property in the controller. So, the line object code is:

 

 

public LineQuote generateLQ;
    
    public LineQuote getGenerateLQ()
    {
        return generateLQ;
    }
    
    public void setGenerateLQ(id lqID)
    {
        system.debug('Set LQ LineQuote from apex:param');
        generateLQ = null;
        for (LineQuote GL :Ws_QOALQs)
        {
            if (lqID == GL.OppItem.ID)
            {
                generateLQ = GL;
                system.debug('Found CreateLineItem assigned to LQ');
            }
        }
    }

 

 

So the page code for the link in the line is:

 

 

<apex:pageBlockTable id="ProductsTable" style="text-align: center" value="{!Ws_QOALQs}"  var="LQ" columns="10" align="center" >
    <apex:column headerValue="Click to Generate RequestID" width="10%">
         <apex:CommandLink value="Generate RequestID" action="{!GenerateRequestID}" reRender="theMessages">
              <apex:param name="LQ" value="{!LQ.OppItem.ID}" assignTo="{!generateLQ}" />
         </apex:CommandLink>
    </apex:column>
</apex:pageBlockTable>

 

 

So, the CommandLink calls the GenerateRequestID method in the controller (shown below), and uses the parameter tag to assign the line's Id to the setGenerateLQ method where it is used by the controller in this method:

 

 

 public PageReference GenerateRequestId(LineQuote LQ)
    {
        PageReference returnPage;
        returnPage = new PageReference(Ws_QOA.QOA_DetailedQuote_Create(LQ)).setRedirect(true);
        return returnPage;
    }

 

 

So, currently the page doesn't recognize this method. However, if I remove the LineQuote LQ argument, it sees the method, for example

 

 

public PageReference GenerateRequestId(){return null;}

 

 

So, I don't know if I'm using the param tag incorrectly, or if I'm calling the method incorrectly, or if I even need to send the LQ object to the method at all. I believe I do as an almost exact copy of the process is working for another page on another controller, but I can't identify the significant difference.

 

Any ideas on why my page recognizes one version of the method, but not the other, and is it the way I'm using the param tag or something else??

 

 

Hey all,

 

So I am using some command buttons to execute some page redirects via page references, but I was wondering how I could specify the target for the new window. I know that outputLink has the target attribute, but I would like to stick with the default Salesforce style on the buttons and not have to recreate it myself. Right now I have resorted to using javascript because I can specify "_parent", but does anyone know how to accomplish this with a PageReference?

 

Thanks!

Hi everyone.

 

I have a bit of a problem that I have been trying to get around for quite awhile now. I wrote a previous post (http://community.salesforce.com/t5/Visualforce-Development/Problem-with-Component-in-javascript/m-p/190323#M25337) about a problem I had where I was trying to get around issues with one type of workaround I tried, but have been unable to resolve that.

 

Rather than focus on my current failed attempt at getting around this I am now presenting my problem as it is, in hope that someone out there might see this from another perspective and offer some insights.

 

What I have is a visualforce page with a controller extension that runs within an iframe in a custom object's page layout (see screenshot below). What this does is allow users to edit certain properties of a related object in-line on the current page layout, without having to open each line up. This is done by the user by clicking the "QuickEdit" link for each line, and then either "Save" or "Cancel".

 

visualforce page layout component

 

When the Save link is clicked (#3 on screenshot) I always want the controller to fire up, do some logic, including saving the record obviously, but then, based on the selection in one of the picklists (#4 on screenshot) I want the return to either just refresh the list (#2 on screenshot), or redirect the parent page (#1 on screenshot) to a different location.

 

I am able to easily hardcode this to always do one of the two by setting the "rerender" or "target" properties of the commandLink (#3), but I want this to change dynamically based on the selection in (#4).

 

Now the render properties are set in the attributes of the commandLink (#2) element and are thus already set when the controller receives the request making it impossible (I think) for me to manipulate the return target from the controller, so I have been trying to use javascript to do this, without much success. I have been trying to call a javascript function on the "onChange" event of the controlling element (#4), but the javascript can only access DOM elements and thus can only change the commandLink's "target" attribute, not it's VF-specific "rerender" property.

 

I hope I managed to describe what I am dealing with, and hopefully someone has a suggestion for me that might work.

 

Best regards,

Ivar

  • June 28, 2010
  • Like
  • 0

Hello,

 

I have to develope a trigger that creates a User when a contact is inserted or when a contact is updated (and insertion or update match certain criteria).

I've already done, but I have no idea how to test it.

 

I explain the problem.

 

In order to create that trigger I had to use a @future method, which executes asynchornous(due to DML on Setup sObjects limitation).

In order to test that trigger I had to insert several contacts and check if result is right according to it was expected, but if I want user to be created as the time I checked the result, those sentences must be between Test.startTest() and Test.stopTest(). No problem so far, I could check insert.

 

The problem is checking update.

In order to update data, I need data to be inserted so I have to put insert between startTest and stopTest.

But in order to check User creation on contact update, I need to put updates sentences between startTest and stopTest.....but, and here is the problem, in a test only one startTest can be used.

 

How can I solve it?

 

Thans very much.

 

Hello everyone!

 

Does anyone know If there is any free APP available to have a live chat in Salesforce? A real chat, not something like a Wall with posts....

 

Thanks in advance!

While trying to browse data in FeedComment, FeedPost and FeedTrackedChange via SELECT from Eclipse I get the following error:

 

 

Anyone have the same experience?  I'm thinking it's me at this point and not a bug.

 

Thanks!

Adam

I'm new to the Data Loader, so I'm testing the batch / command line capabilities.  In doing so, I got the batch api enabled and working within my sandbox, but my test insert job failed after 15,000 records.  I checked the space and that's not the issue.
 
The only thing I can see is the "unable to find end tag" error and I can't find any documentation on what this means.  Any help would be great.  Thanks!
 

 
 
2010-03-25 10:45:52,973 INFO  [deleteAccounts] action.ActionFactory getActionInstance (ActionFactory.java:64) - Instantiating operation: delete
2010-03-25 10:45:53,254 INFO  [deleteAccounts] controller.Controller executeAction (Controller.java:114) - executing operation: delete
2010-03-25 10:45:53,254 INFO  [deleteAccounts] action.AbstractLoadAction execute (AbstractLoadAction.java:130) - Loading Using Bulk API: delete
2010-03-25 10:45:53,426 INFO  [deleteAccounts] visitor.BulkLoadVisitor createJobInfo (BulkLoadVisitor.java:207) - Created Bulk API Job: 750Q00000008TqMIAU
2010-03-25 10:45:53,738 INFO  [deleteAccounts] progress.NihilistProgressAdapter setSubTask (NihilistProgressAdapter.java:68) - Aborting job
2010-03-25 10:45:54,082 FATAL [deleteAccounts] action.AbstractLoadAction execute (AbstractLoadAction.java:172) - Exception occured during loading
com.salesforce.dataloader.exception.LoadException: Failed to create batch
at com.salesforce.dataloader.action.visitor.DAOLoadVisitor.handleException(DAOLoadVisitor.java:165)
at com.salesforce.dataloader.action.visitor.DAOLoadVisitor.handleException(DAOLoadVisitor.java:169)
at com.salesforce.dataloader.action.visitor.BulkLoadVisitor.handleException(BulkLoadVisitor.java:107)
at com.salesforce.dataloader.action.visitor.BulkLoadVisitor.loadBatch(BulkLoadVisitor.java:91)
at com.salesforce.dataloader.action.visitor.DAOLoadVisitor.visit(DAOLoadVisitor.java:125)
at com.salesforce.dataloader.action.AbstractLoadAction.visitRowList(AbstractLoadAction.java:202)
at com.salesforce.dataloader.action.AbstractLoadAction.execute(AbstractLoadAction.java:148)
at com.salesforce.dataloader.controller.Controller.executeAction(Controller.java:115)
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:130)
at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:222)
Caused by: [AsyncApiException  exceptionCode='ClientInputError'
 exceptionMessage='Failed to create batch'
]

at com.sforce.async.RestConnection.createBatchFromStream(RestConnection.java:148)
at com.salesforce.dataloader.action.visitor.BulkLoadVisitor.createBatch(BulkLoadVisitor.java:217)
at com.salesforce.dataloader.action.visitor.BulkLoadVisitor.doOneBatch(BulkLoadVisitor.java:133)
at com.salesforce.dataloader.action.visitor.BulkLoadVisitor.createBatches(BulkLoadVisitor.java:113)
at com.salesforce.dataloader.action.visitor.BulkLoadVisitor.loadBatch(BulkLoadVisitor.java:87)
... 6 more
Caused by: com.sforce.ws.ConnectionException: unable to find end tag at:  START_TAG seen ..."http://www.force.com/2009/06/asyncapi/dataload">\n <exceptionCode>... @3:17
at com.sforce.ws.bind.TypeMapper.consumeEndTag(TypeMapper.java:398)
at com.sforce.async.BatchInfo.load(BatchInfo.java:200)
at com.sforce.async.BatchRequest.loadBatchInfo(BatchRequest.java:75)
at com.sforce.async.RestConnection.createBatchFromStream(RestConnection.java:142)
... 10 more
2010-03-25 10:45:54,145 ERROR [deleteAccounts] progress.NihilistProgressAdapter doneError (NihilistProgressAdapter.java:51) - Failed to create batch 

I have a problem with an embedded VisualForce page that has only started occurring since the Spring '10 upgrade.

 

Here is the page.

 

 

<apex:page standardController="Account"> <apex:iframe src="http://<<<URL OBSCURED>>>>/Default.aspx?docs=false&id={!Account.Id}&sid={!$Api.Session_ID}&url={!$Api.Enterprise_Server_URL_140}" rendered="{!ISBLANK(Account.Sharepoint_URL__c)}"/> <apex:iframe src="{!Account.Sharepoint_URL__c}" rendered="{!NOT(ISBLANK(Account.Sharepoint_URL__c))}"/> </apex:page>

 

The 'Account.Sharepoint_URL__c' is a text field with a URL to a Sharepoint site.  If this value is not populated, I direct users to an ASPX page which will generate a Sharepoint site based on a template and will populate the 'Sharepoint URL' field for the appropriate Account record.  The users are then redirected to the Sharepoint site. 

 

This VisualForce page was working without issue last week for all  users.  Now, whenever a user who is not a part of our 'System Administrator' profile accesses this page, they get an 'Insufficient Privileges' error. The users using this page have the 'View Setup and Configuration' permission.

 

I have verified that all profiles are granted access to the VisualForce page in the 'Security' for the page.  I have tried removing access, and re-granting it.  I have verified that  both the Sharepoint site and the ASPX page are accessible for this user outside of the frame.  I have verified that the field 'Account.Sharepoint_URL__c' is accessible to the user's profile.

 

As near as I can tell, this should work without issue.  In fact, when I or any other SalesForce System Administrator try to access this page, it does work without issue.

 

What has changed, or what permissions am I not checking which would cause this error?

 

 

 

I've been debugging an issue where I need to use getSObject to get the inner object on a query.

 

Debug code:

 

 

SObject sox = Database.query('select id, Contact.FirstName from CampaignMember limit 1'); 
System.debug (sox.getSObject('Contact') == null) );

 

 

I have four testMethods with this, three return true on the second line, the fourth returns false.

 

It appears always to be false in a managed package.

 

Which means that, in my experience, getSObject works 20% or less of the time.

 

 

 

 

 

I'm trying to build the url for a page to be called via Ajax in a Salesforce Sites page which is in the format:

 

http://sitename-developer-edition.na3.force.com/extension

 

When I do {!$Page.myPage}" in Visualforce it it brings up the full correct reference to the page:

 

/extension/PackageName__pageName

 

This works great.

 

However, I cannot find out how to correctly find out the "extension" through native Apex code.

 

ApexPages.currentPage().getHeaders('Host') returns only the first part, "sitename-developer-edition.na3.force.com" without the extension, and there is no other information in any of the Headers element which contains it (i.e. Accept-Charset, Accept-Encoding, Accept-Language, CipherSuite, Connection, Host, Keep-Alive, User-Agent, X-Salesforce-Forwarded-To, X-Salesforce-SIP).

 

Advice?

 

 

 

 

 

 

 

 

 

I filled up my developer org then mass deleted about 500 Accounts, skipping the recycle bin. I also cleared out a bunch of things from the recycle bin. How long until I have space again? It has been a couple of hours...

 

 

As far as I can tell, there is no way to natively iterate through more than 10,000 records without using an @future method or an action poller from a Visualforce page. There is a page documenting a for loop which uses QueryMore but as far as I can tell that does not actually work with > 10,000 records.

 

So, if I want to construct a json String including my 40,000 records what should do and output it to a Visualforce page what should I do?

 

It seems I have the following options;

 

(1) Asynchronously construct a Blob with a list of Strings as each reaches the maximum String size. The problem then? No way to save the blob...

 

(2) Create a text file via APEX that is not dependent on a VF page to store the data? But I don't think you can do this via a VF page (cannot be generated asyncronously) or text file (no idea how to do this)...

 

(3) Export the information to another webservice, convert it into a text file, bring it back in as a Static Resource, read the contents, in from the text file (seems possible).

 

(4) Create an action poller which gradually brings in the information I need for my page (will not be available on load and probably will require multiple rerenders which could make things ugly).

 

 

Anyone have more and/or better ideas or care to recommend one of the above?  Sample code also greately aprpeciated....

 

 

This error appears with increasing frequency:

 

 

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary

 

 

Unfortunately, I never have any information indicating why it has happened. I am logged in as the System Administrator and I should have access to everything.

 

Perhpas this message also appears when a managed package throws an error?

So I was editing one of my visualforce components and clicked over to "Version Settings" then quicksaved. When I went back to "Visualforce Markup" I got what you see:

 

 

Basically, the window shrank so you could only see the first line of code.

 

Reloading the page made this go away.

 

btw, I hope we get a real SFDC bug tracker at some point... 

So I think this may also be a n00b question but I can't seem to figure out how to display the id of a standard object in a Visualforce page.

 

 

All I want is something like this:

 

 

<apex:page standardController="Contact">

   {!object.id}

</apex:page>

 

Any ideas? I know I could use a custom controller as an extension but would prefer not to.

 

 

Vaguely recall seeing this before but couldn't find any previous discussion so here we go:

 

If you use a variable named "width" or "height" in your Visualforce component the value will be reset to null (or to an empty string) even if you initialize it.

 

Example controller method:

 

 

public void init() {

  height = '200';

}

 

 

Example visualforce page:

 

 

height: {!height}

 

 

Example output:

 

 

height: 

 

 

 

Okay folks, I know this is a n00b question but I can't remember if or how to initialize a string with a set of arguments.

 

What I want to do is something like this

 

 

List<String> alphabet = { 'a' , 'b' , 'c' ...  };

 

How can I do this?

 

I have a managed package which as of version 1.1 now gives me an internal server whenever I attempt to upload it.  Any idea what could cause this? I made a number of changes, one of them was enableing global access on visualforce component attributes.

 

 

Page header: <apex:page standardController="Form__c" extensions="FormAdminController" id="page">

Could not find this error documented anywhere (which I get on save):

 

 

Custom and standard controller cannot be referenced in the same page

 

 

Just re-encountered Test.startTest() and stopTest() again with Jeff Douglas's post this morning and was going back through some articles to see when and whether you should use Test.startTest() and Test.stopTest() since:

 

(1) As far as I can tell most of the test code in Force.com Labs apps does not use this convention

(2) As far as I can tell governor limits for Tests are applied in every testMethod regardless of whether or not you call startTest()

 

Maybe it is just a convention to make test code easier to read?

 

 

Have to admit it, I am stumped by this one. Visualforce page outputs like this when I include my component:

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
</html>

No authorization required message. No error in debug log. Just one closed html tag.

 

Here's the code of the page:

 

 

<apex:page controller="FormDemoController" showheader="false">
        
            Component here: <c:myComponent /> 
       
</apex:page>

 

 I think this is just another episode of broken component-controller communication on Na7 in whatever maintenance release rolling out and derailing previously working code. I wonder how long my code on Na3 is safe.

 

FYI I went in and gave the maximum access on all classes and pages, etc.

 

 

 

Just released the full source for my Form Generation suite including full client-side validation with jQuery and optional use of jQuery enhanced components:

 

Formation @ d3developer.com

Used to have some simple code that went like this:

 

 

				g.showRule.Value_To_Show__c = '';	
					
				for(String s : g.showVals)
					g.showRule.Value_To_Show__c += s + ',';

 Crazy thing was, the value to show would save like this:

 

 

nullvalue1,value2,value3

 

 

So for some reason a double single quote was being converted into a four character string 'null.' Oddly, this has not happened in other instances where I successfully concatenate strings.

 

My workaround:

 

				if(g.showVals.size() > 0)
				{
					g.showRule.Value_To_Show__c = g.showVals.get(0) + ',';
										 
					for(Integer i = 1; i < g.showVals.size(); i++)
						g.showRule.Value_To_Show__c += g.showVals.get(i) + ',';
}

 

 

 

 

 

I was trying to deploy some custom fields for the Events object across orgs with the ant tool but noticed in Eclipse that the metadata related to the custom fields was not present. Any idea why this might be the case? They are part of a managed package but for other managed packages I have in other organizations the custom fields display fine. Also, other custom fields on standard objects other than the Event object appear to be available in the metadata.

 

Any ideas...  ?

Somewhat surprised that this doesn't work:

 

 

				if(g.showRule.Form_Field__c == null || g.showRule.Form_Field__c == '')
g.showRule.Form_Field__c = ffid;

 

Not a big deal since I can remove the test.

 

Full error:

 

 

 System.StringException: Invalid id:

 

 

 

 

 

Maybe I'm missing something incredibly obvious but none of the standard visualforce components for checkboxes appear to be correctly setting the default value for my object:

 

Here's the inputfield version:

 

 

              <apex:inputField value="{!webform.Use_Enhanced_Multiselect__c}" />    

 

Default value of checked/selected does not appear when object is first initialized.

 

Here's the inputCheckbox version:

 

 

              <apex:inputCheckbox  value="{!webform.Use_Enhanced_Picklist__c}" />      

Default value of checked also does not appear when object is first initalized.

 

Unlike inputfield, I can do this:

 

 

              <apex:inputCheckbox selected="true" value="{!webform.Use_Enhanced_Datepicker__c}" />      

 

 

But then it always appears checked, even after I update the object.

 

 

The only way I've figured out is to use my own enhancedComponent library which allows me to set the defaults:

 

 

<c:enhancedCheckbox fieldname="Use_Enhanced_Lookup__c" pageController="{!this}" defaultValue="checked"  />    

 

 

This method works fine but I was hoping to use standard components this time around.

 

            
Am I missing something obvious?

 

 

 

 

 

 

 

Trying to filter on a rich text field yields the following error:

 

 

 

INVALID_FIELD: 
formation__Form_Field__c where formation__Info__c != ''
                               ^
ERROR at Row:1:Column:584
field 'formation__Info__c' can not be filtered in query call

 

 

 

 

My managed package failed to install into another org. The error message given was the following:

 

 

Your requested install failed. Please fix the following error(s) or obtain a fix and try this again.

If this error persists, contact the package publisher and include the error details.

ProblemComponent Detail
enhancedcomponenttestsuite.testTestObject()Apex Classes(01pR0000000DW7g)System.AssertException: Assertion Failed: Expected: false, Actual: true
(formation)
External entry point

 

 

It would be great if the line number of the error message could be included. 

   
   

Okay folks, I know this is a n00b question but I can't remember if or how to initialize a string with a set of arguments.

 

What I want to do is something like this

 

 

List<String> alphabet = { 'a' , 'b' , 'c' ...  };

 

How can I do this?

 

Can we display Product family in visualforce page similar to Group by clause? 
I am using PE so I cannot write apex class.
Here is my code:
<table width="100%" border="1" cellpadding="5" cellspacing="0">    
      <tr style="background-color:#C0C0C0;font-weight:bold;">
          <th width="5%" > Sr. </th>
          <th width="40%"> Description </th>
          <th width="20%"> Part Number </th>
          <th width="12%"> Unit Price </th>
          <th width="5%"> Qty </th>
          <th width="18%"> Total </th>
      </tr>
      <apex:repeat value="{!Quote.QuoteLineItems}" var="qFam" >
          <tr style="display:{!IF(qFam.PricebookEntry.Product2.Family == null,'None','')}">
              <td colspan="6" style="background-color:#E8E8E8;">
                  <apex:outputText value="{!qFam.PricebookEntry.Product2.Family}"></apex:outputText>
              </td>
          </tr>
          <apex:repeat value="{!Quote.QuoteLineItems}" var="q">
              <tr>
                  <td align="center"> 
                      <apex:outputText value="{0,number}">
                          <apex:param value="{!q.Sr_No__c}"/> 
                      </apex:outputText>
                  </td>
                  <td> <apex:outputText value="{!q.PricebookEntry.Product2.Name}"/> </td>
                  <td> <apex:outputText value="{!q.PricebookEntry.Product2.ProductCode}"/> </td>
                  <td align="right">
                      <apex:outputText value="{0,number,###,###,###,###.00}">
                          <apex:param value="{!q.UnitPrice}"/>
                      </apex:outputText>
                  </td>
                  <td align="right"> 
                      <apex:outputText value="{0,number}">
                          <apex:param value="{!q.Quantity}"/> 
                      </apex:outputText>
                  </td>
                  <td align="right"> 
                      <apex:outputText value="{0,number,###,###,###,###.00}">
                          <apex:param value="{!q.TotalPrice}"/> 
                      </apex:outputText>
                  </td>
              </tr>
          </apex:repeat>
      </apex:repeat>
  </table>

 

Following is what it displays:
As you can see same product family is repeated as well as the products.
I can get this if I modify this slightly. Please suggest.

Hi All,

I created one Apex documentation tool just like javadoc. Please share your feedbacks on that.

 

http://www.aslambari.com/apexdoc.html

 

Blog:-

http://techsahre.blogspot.com/2011/01/apexdoc-salesforce-code-documentation.html

 

Thanks

Aslam Bari

  • January 27, 2011
  • Like
  • 1

Something strange is going on and I can't figure it out. Data binding to variables in an Apex controller is not working if the <apex:input> tags are within a jQuery UI Dialog box. I've confirmed action method executes when called from a dialog box and rerenders are working but data binding is not. Unfortunately all else I can can provide is this very simple page to reproduce and then hope someone can help figure this out.

 

Page:

 

<apex:page controller="JQDialog">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"/>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"/>
    <apex:stylesheet value="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/ui-lightness/jquery-ui.css"/>
    
    <script type="text/javascript">
        var j$ = jQuery.noConflict();
        
        j$(document).ready(function(){
            //Creat modal
            j$("#popup").dialog();
        });
    </script>
    
    <apex:outputPanel id="count">
        Count: {!count} <br/>
        Checkbox: {!myCheckBox} <br/>
        String: {!myString}
    </apex:outputPanel>
    
    <apex:form >
        <div id="popup">
            <apex:inputCheckbox value="{!myCheckbox}"/> <br/>
            <apex:inputText value="{!myString}"/> <br/>
            <apex:commandButton value="Do Something" action="{!doSomething}" rerender="count" oncomplete="closeModal();"/>
        </div>
    </apex:form>
</apex:page>

 Controller:

 

public class JQDialog {

    public Integer count {get; set;}
    public Boolean myCheckbox {get; set;}
    public String myString {get; set;}
    
    public JQDialog(){
        count = 0;
    }

    public void doSomething(){
        count++;
    }
}

 

 

Thanks,

Jason

 

 

  • January 07, 2011
  • Like
  • 0

Hey everyone,

I have an application where I need to impliment a filter as you type system. Basically we have a pageBlockTable that loads a few hundered records. My users want to be able to have a text field where they can begin typing the name of a person and have the results in the pageBlockTable filter to match their query. I figure someone else must have already done this and figured I'd ask the community before I try and hammer it out myself. If I were going to do it, I figure the approach would be

 

1) Find all people and populate the pageBlockTable

2) Create text field with onKeyUp event tied to apexActionFunction

3) apexActionFunction sends current value in filter box to an apex method

4) apex method makes a backup of the complete list. Then queries against the original using the parameters provided by the user.

5) return the new filtered list to the pageBlockTable

6) reRender the table.

 

The only part I don't really know how to do is to filter against the list I already have, as opposed to running a whole new SOQL query against the DB (which would be super inefficient). How can I filter a list that exists in the heap instead of running a few query?

Does anyone have the complete Chatter Bubbles sample code, including the css/jquery?  It's not in chatter commons...


Thanks,

Jon

 

 

I've been debugging an issue where I need to use getSObject to get the inner object on a query.

 

Debug code:

 

 

SObject sox = Database.query('select id, Contact.FirstName from CampaignMember limit 1'); 
System.debug (sox.getSObject('Contact') == null) );

 

 

I have four testMethods with this, three return true on the second line, the fourth returns false.

 

It appears always to be false in a managed package.

 

Which means that, in my experience, getSObject works 20% or less of the time.

 

 

 

 

Hello,

           We have an salesforce org ,that org have lot of Managed package applications provided by different ISV's.Right now we want expose our salesforce org to salesforce sites.It is possible use other ISV'w applications in sites.

 

Some application have APex and VF pages

 

In some application have S-controls.I did't see any document s-controls support to site.

 

Sombody clarified my question that would helpful me further search.

 

Thanks in Advance.

Gopi

  • July 15, 2010
  • Like
  • 0

 

Trying to filter on a rich text field yields the following error:

 

 

 

INVALID_FIELD: 
formation__Form_Field__c where formation__Info__c != ''
                               ^
ERROR at Row:1:Column:584
field 'formation__Info__c' can not be filtered in query call

 

 

 

 

Anyone else getting this error when they attempt to save pages / Apex classes? Any idea what it means?

 

Doesn't happen every time.

Hi everyone,

 

Do you know a way to test a class that uses Site.createPortalUser and expect it to be successfull?

 

Do we have any way to "fake" the success of this call?

 

I have a lot of code that depends on the success of this call and I don't know how to test it.

 

Cheers,

 

Laurent

 

 

Is there some way to toggle email notifications via APEX code?

 

If possible, I'd like to be able to turn them off and on for all users.