• gogz_sfdc
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

Hi Guys,

 

I'm working through some app development and I've hit a snag. I have some jQuery code which is called using the .ready() function in jQuery. This all works fine until the point I have a ReRender and the DOM is redrawn my code no longer works.

 

Here's my page:

 

 

<apex:page standardController="Handover__c" extensions="HandoverExtension" sidebar="false">
	<apex:includeScript value="{!URLFOR($Resource.JQueryUI, 'jQueryUI/js/jquery-1.5.1.min.js')}"  />
	<script>
		$j = jQuery.noConflict();
		$j(document).ready(function(){
			$j("td.ItemTextCol").find("a").each(function(){
				if($j(this).text().length > 40){
					$j(this).attr("title", $j(this).attr("href"));
					$j(this).text("Long URL Replaced");
				}
			});
		});
	</script>
	<apex:form >
<apex:outputpanel id="ItemLists">
	<apex:pageblock title="Handover Items" mode="detail">
            <apex:actionStatus id="updateStatus">
       		<apex:facet name="start">
       			<apex:outputPanel >
       				<apex:image url="/img/loading.gif"/>
       				<apex:outputtext value=" Working..."/>
       			</apex:outputPanel>
       		</apex:facet>
   		</apex:actionStatus>
		<apex:pageblocktable value="{!Items.handoveritems}" var="i">
				<apex:commandLink action="{!i.activate_deactivate}" rerender="ItemLists" rendered="{!NOT(Items.hasActivate)}" status="updateStatus"> 
					<apex:image url="{!URLFOR($Resource.handover_images, 'HandoverImages/Delete.png')}" alt="Deactivate this Handover Item" title="Deactivate this Handover Item"/>
				</apex:commandLink>
			</apex:column>
			<apex:column Headervalue="Summary" styleClass="ItemTextCol">
				<apex:outputField value="{!i.item.Summary__c}" styleClass="ItemText"/>
			</apex:column>
			<apex:column headerValue="Current Status" >
				<apex:outputField value="{!i.item.Current_Status__c}" />
		</apex:pageblocktable> 
	</apex:pageblock>
	</apex:outputpanel>
</apex:form> 
</apex:page>

Now this all works until the point where I click on the CommandLink and there is a partial page refresh.  

 

Anyone know what I can do here? 

 

How can I call the jQuery code again after the partial page refresh? 

 

I have a component that accepts a Boolean attribute. Certain combinations of inline functions generate the error message shown in the subject line. See code below for details:

 

<!-- this produces the error --> <c:myComponent myBooleanValue="{!LEN(myObj__c.myField__c) == 0}" .../> <!-- this produces the error --> <c:myComponent myBooleanValue="{!LEN(myObj__c.myField__c) = 0}" .../> <!-- this works! --> <c:myComponent myBooleanValue="{!NOT(LEN(myObj__c.myField__c) > 0)}" .../>

 

Obviously I have a workaround (the last example) but I'm curious to know why the other two do not work.

I've set up a situation where:
* changing a field triggers a time-based WF rule, which after an hour
* changes another field on the same object, which
* triggers an apex trigger, which
* changes yet another field

This works fine in general, for small record sets.

However, I just tested it in bulk (by making that first field update to a bunch of records at once), and it failed governor limits (too many DML rows).  I didn't expect this, because as far as we the developers can tell, each record is put on the time-workflow queue separately.  However, it appears that since I triggered the time WF at the same time for all the records, they all came off the queue at the same time and were batched for trigger processing.

Specifcally, I tried this operation w/ 380 records.  It looks like it did one batch of 200 and one batch of 180.  So exactly what you'd expect if there was no time WF involved.

But the weird part is: it seems to have batched the records, but not scaled the governor limits to account for it.  So in my batch of 200, I got an error message saying: too many DML rows 201.  But for a trigger operating on 200 records, the limit for DML rows should be 20k.  And I got 200 separate email error messages delivered. So it seems to be treating it as partly a batch, but partly 200 separate operations.

Can someone help with this?  Is this how it's meant to work?

Thanks much!
  • November 06, 2008
  • Like
  • 0
Hello.  I'm trying to submit a lead via Web2Lead - but programatically.  Below is the essence of the code.  It isn't working.  I don't see any errors, but no lead is created and I don't get the resulting email.  If I create an HTML form and try it, it works perfectly.

I'm doing this programatically because I want to do multiple things with the info.  Send some emails, create a Lead, etc...

Thanks for your time.
Chris

Set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.Open "POST", "http://www.salesforce.com/servlet/servlet.WebToLead", False

QS = "debug=0"
QS = QS & "&encoding=UTF-8"
QS = QS & "&oid=my oid here"
QS = QS & "&debugEmail=my email addr here"
QS = QS & "&first_name=TEST"
QS = QS & "&last_name=TEST"
 

objHttp.Send QS
strResult = objHttp.responseText
Set objHttp = Nothing
 
response.write("[" & QS & "]<br>")
response.write("[" & strResult & "]<br>")
response.end