• mattdarnold
  • NEWBIE
  • 200 Points
  • Member since 2007

  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 57
    Replies
Currently we can integrate google talk onto sidebar. Can we bring the gtalk window onto visualforce page?
I had to change an existing method so that it would execute asynchoronously. Here is the original method
 

public class WorkflowTickler { public static void TickleOpportunitySalesGoal(Opportunity_Sales_Goal__c[] opportunitySalesGoalArr) { DateTime currentTime = System.Now(); for(Opportunity_Sales_Goal__c opportunitySalesGoal:opportunitySalesGoalArr) { opportunitySalesGoal.Last_Sync_To_Parent__c = currentTime; } update opportunitySalesGoalArr; }}

 

 

The trigger that calls the method is

 

 

trigger syncParentOpportunitySales on Sales_Goal__c (after update) { Opportunity_Sales_Goal__c[] lstOpportunitySalesGoal = [Select Id from Opportunity_Sales_Goal__c where Sales_Goal__c in :Trigger.newMap.keyset()]; WorkflowTickler.TickleOpportunitySalesGoal(lstOpportunitySalesGoal); }

 I ran into Too many rows issue when trying to update rows. So I am trying to use the @future to resolve the issue.

 

But when I try to use @future in the method it would not work since I keep getting this error

 

 

Save error: Unsupported parameter type LIST:SOBJECT:Service__c e

 

 The documentation says 

List, Array of SObject cannot be a parameter to an @future method.

How to solve this issue now. This is in production :(
 
Thanks
 

 

 

 

  • July 16, 2009
  • Like
  • 0

Hi,

 

I'm not able to get the inputField values passed into my extended controller. Need that to do some calculations in my apex code and refresh the visualforce page to show the new calculated values to the user.

Here share the code I have up to now:

 

Visualforce code: (please see the line comments on it)

 

<apex:page standardController="Cnno_Purchase_Requisition__c" extensions="PurchaseRequisitionController" id="PR_New_page"> <apex:SectionHeader title="Purchase Requisition" subtitle="New Purchase Resquisition" /> <apex:form > <apex:pageblock title="Purchase Requisition Creation" mode="edit" id="block"> <apex:pageMessages /> <apex:pageBlockButtons location="both"> <apex:commandButton action="{!save}" value="Save"></apex:commandButton> <apex:commandButton action="{!cancel}" value="Cancel"></apex:commandButton> <apex:commandButton action="{!doRefresh}" value="Refresh Values" rerender="block"></apex:commandButton> </apex:pageBlockButtons> <apex:pageBlockSection columns="2" title="Information"> <apex:outputField value="{!PurchaseRequisition.OwnerId}"/> <apex:outputField value="{!PurchaseRequisition.Status__c}"/> <apex:pageBlockSectionItem > <apex:outputLabel value="Item Requested"/> <apex:outputPanel id="item"> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Item_Requested__c}"> <!-- apex:actionSupport event="" rerender="item" status="status"/ --> </apex:inputField> <!-- apex:actionStatus startText="applying value..." id="status"/ --> </apex:outputPanel> </apex:pageBlockSectionItem> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Request_Date__c}"/> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Required_Item_Description__c}"/> <apex:outputField value="{!Cnno_Purchase_Requisition__c.Item_Requested__r.Standard_Cost__c}"/> <!-- THIS IS NOT SHOWN!! --> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Ship_To_Location__c}"/> <apex:pageBlockSectionItem > <apex:outputlabel value="Total Amount" /> <apex:outputtext value="{!totalamount}"/> <!-- This throught NULL when refresh performs --> </apex:pageBlockSectionItem> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Max_to_pay__c}" /> </apex:pageBlockSection> <apex:pageBlockSection columns="1" title="Additional Notes"> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Additional_Notes__c}"/> </apex:pageBlockSection> </apex:pageblock> </apex:form> </apex:page>

 

APEX Code in extended controller:

 

public class PurchaseRequisitionController { private Cnno_Purchase_Requisition__c purchaseRequisitionObj; private Cnno_Purchase_Items__c item; private String vendor; private Double totalAmount; public PurchaseRequisitionController(ApexPages.StandardController controller) { this.purchaseRequisitionObj = (Cnno_Purchase_Requisition__c)controller.getRecord(); this.purchaseRequisitionObj.OwnerId = UserInfo.getUserId(); this.purchaseRequisitionObj.Status__c = '1 - Open'; } public Cnno_Purchase_Requisition__c getPurchaseRequisition() { return purchaseRequisitionObj; } public void setPurchaseRequisition(Cnno_Purchase_Requisition__c pr) { this.purchaseRequisitionObj = pr; } public Double getTotalAmount() { return TotalAmount; } public void doRefresh() { totalAmount = purchaseRequisitionObj.Item_Requested__r.Standard_Cost__c * purchaseRequisitionObj.Quanitity__c; } }

 

Will really appreciate your help! I'm blocked here.

 

Thanks!

 

Fernando.-

  • July 05, 2009
  • Like
  • 0

OK, I must be going crazy because I think this was working yesterday...  I need to have a VF page with a

multiselect list, which I can't seem to get working.  Here's the simplest case I've been able to boil it

down to.

VF Page:


<apex:page controller="TestController" sidebar="false" showHeader="false"> <apex:pageBlock title="Values" rendered="true" id="Pageid"> <apex:form > <apex:pageBlockSection columns="1"> <apex:pageBlockSectionItem > <apex:outputLabel value="Test: " for="pickTest"/> <apex:selectList value="{!Values}" size="4" id="pickTest" multiselect="true" > <apex:selectOptions value="{!ValueOptions}"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:commandButton action="{!testIt}" value="Test It!"/> </apex:pageBlockSection> </apex:form> </apex:pageBlock> </apex:page>

 


Controller:

public class TestController { private String [] m_lstVals; public void setValues (String [] lstVals) { m_lstVals = lstVals; } public String [] getValues () { return m_lstVals; } public List<SelectOption> getValueOptions() { List<selectoption> lstOptions = new List<SelectOption>(); lstOptions.add(new SelectOption ('one', 'one')); lstOptions.add(new SelectOption ('two', 'two')); lstOptions.add(new SelectOption ('three', 'three')); return lstOptions; } public PageReference testIt () { if (m_lstVals == null) { System.debug ('No values'); return null; } for (String s : m_lstVals) { System.debug ('Selected value: ' + s); } return null; } public static testmethod void testController () { TestController tc = new TestController (); List<SelectOption> so = tc.getValueOptions(); } }

 


 

 

When I select 'one' and 'two' and press the 'test It' button, I get the following in the debug log:

Conversion Error setting value 'one two' for '#{Values}'.

When I set 'multiselect' to 'false' (and change the accessor methods to just Strings) everything works

correctly.  It must be something really silly/simple here!  Could someone take a look and point out my

mistake?

Thanks in advance!

Can someone help me understand why this javascript is able to change the outputText in the page, but not able to change the outputText in the list?

This might not be the right way to start going about this but I am trying to find a way to toggle visibility of a value in a column for a record if that record meets certain criteria, and only that record in the list, not the other records in the list.

 

 outputText in the page:

 

 

<apex:page> <script> function changeVisibility() { var item = document.getElementById('{!$component.msgpost}'); if(item.style.visibility == 'visible') { item.style.visibility = 'hidden'; } else { item.style.visibility = 'visible'; } } </script> <input type="button" onclick="changeVisibility()" /> <apex:outputText id="msgpost" value="Show/hide me!"/> </apex:page>

 

 outputText in the list:


<apex:page standardController="sfObject" extensions="myExtension"> <script> function changeVisibility() { var item = document.getElementById('{!$component. myChange}'); if(item.style.visibility == 'visible') { item.style.visibility = 'hidden'; } else { item.style.visibility = 'visible'; } } </script> <input type="button" onclick="changeVisibility()" /> <apex:dataTable value="{!myQuery}" var="myLineItem"> <apex:column> <apex:outputPanel layout="block" id="myChange"> <apex:outputField value="{!myLineItem.myField__c}" /> </apex:outputPanel></apex:column> </apex:dataTable> </apex:page>

 

Thank you.




 

I am trying to place a Visualforce page on the Home Page using an HTML component and the following code:

 

<IFRAME id=itarget src="/apex/TestPage" frameBorder=0 width="100%" height=100></IFRAME>

 

I have seen multiple postings where this is what others are doing, but when I try it all I get is the code displayed verbatim in the HTML area.  Perhaps I am missing something, but is there something else I need to be doing to actually render the VF page?

 

Thanks..

  • March 25, 2009
  • Like
  • 0

Hi,

 

I have created a small vf page with extJs included.Its not giving any error but its not working,i cannot see anything on page.

 

Here is the code i have written.Please let me know how will it work??

 

<link rel="Stylesheet" type="text/css" href="{!$Resource.ExtJs}/ext-2.1/resources/css/ext-all.css" />

<script type="text/javascript" src="{!$Resource.ExtJs}/ext-2.1/adapter/ext/ext-base.js"></script>

<script type="text/javascript" src="{!$Resource.ExtJs}/ext-2.1/ext-all.js"></script>

<apex:page>

<!-- Begin Default Content REMOVE THIS -->

<h1>Congratulations</h1>

This is your new Page

<script type="text/javascript">

Ext.onReady(function(){

Ext.Msg.show({

title: 'Milton',

msg: 'Have you seen my stapler?',

buttons: {

yes: true,

no: true,

cancel: true

}

});

});

</script>

</apex:page> 

Hi - I am trying to get the color value associated with a PicklistEntry. I've written some logic that gets the PicklistEntry, but I am not sure if there is a way to get the color associated with that entry using the Apex field describe methods. Can someone help me out or confirm that this isn't possible? (It looks like it is part of the metadata API, but I can't find any documentation on using it in Apex.)

 

 

Map<String, Schema.SObjectType> globalDescribe = Schema.getGlobalDescribe();
Map<String, Schema.SObjectField> objectFields = globalDescribe.get('Campaign').fields.getMap();
Schema.DescribeFieldResult fieldInfo = objectFields.get('Type');

if(fieldInfo.getType() == 'Picklist' || fieldInfo.getType() == 'MultiPicklist') {
for(Schema.PicklistEntry pe : fieldInfo.getPicklistValues()) {
// Instead of getValue(), is there a getColor() method? pe.getValue();
}
}

 

 

 

I am running a batch apex class that is scheduled to run periodically throughout the week. (It implements the schedulable interface.) As part of the finish method, I am attempting to create and send an email alerting users that the batch class has completed running. The code compiles / saves fine in the Sandbox - and my unit tests run fine in the Sandbox as well. However, we I go to deploy I get the following error that disappears if I comment out the email code:

System.Exception: Error processing messages

Here is the code within the finish method. Any help / thoughts are appreciated.

Thanks
-- Matt

 

global void finish(Database.BatchableContext BC){

List<String> toAddresses = new List<String>();
// Add email string to List
toAddresses.add('marnold@communispace.com');
String subject = 'Batch class run complete';
String body = '';

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

mail.setToAddresses(toAddresses);

mail.setSenderDisplayName('Salesforce Outbound Notification');
mail.setSubject(subject);
mail.setPlainTextBody(body);
mail.setUseSignature(false);

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

}

 

 

 

Hi - can someone confirm whether or not a user on professional edition can access the metadata API - i.e. can a partner use the metadata API the same way they'd be able to use the standard API to provide application functionality despite a professional users lack of API access?

 

Not sure if this is the right place for this question...

 

-- Matt

Can someone help me out with the @future limits? The documentation states that "Salesforce also imposes an organization-wide limit of 200 method calls with the future annotation per license per 24 hours." So I assume this means that each user could make 200 @future calls daily. But when testing, I am hitting the limit on one license and it seems to impose an organization wide limit on any other @future calls. So is the limit 200 calls per org or 200 calls per user/license?

 

-- Matt

Hi all,

I am building an application that makes use of the actionFunction component with parameters to take in data from the page and make inline updates to the database with no page refresh. I have this working, but I am trying to build some functionality to handle situations when the updates fail – the user is offline, the call times out etc. so I don’t miss updates.

I’ve built the code below that uses a Boolean true/false that gets updated when the function completes successfully then passes that to an inputText area on the screen to be read by my oncomplete JS function in the actionFunction (and then set back to false to handle the next updates from the user). This works, but is there an easier or more reliable way to handle this?

Open to any ideas. Thanks.

-- Matt

 

:: Page ::

 

<apex:page controller="reportActionTestController">

<script type="text/javascript">
// Javascript function to check value of outputForm.outputField and execute
// an alert and actionFunction fnCompleteReset only if the component
// outputForm.outputField is true
function fnCompleteAlert() {
if(document.getElementById('{!$Component.outputForm.outputField}').value=="true"){
alert("Function called, if is true, and fnSuccess=" +
document.getElementById('{!$Component.outputForm.outputField}').value);
window.fnCompleteReset(false);
} else {
alert("Function called, if is false, and fnSuccess=" +
document.getElementById('{!$Component.outputForm.outputField}').value);
}
}
</script>

<!-- inputText field to hold contents of fnSucess and is rerendered by fnComplete
actionFunction - this would be a hidden field, but is left displayed for
demonstration purposes -->
<apex:form id="outputForm">
<apex:inputText id="outputField" value="{!fnSuccess}" />
</apex:form>
<br/>
<br/>

<!-- Button to call fnComplete actionFunction -->
<apex:outputPanel onclick="window.fnComplete()" styleClass="btn">
Click Me
</apex:outputPanel>

<!-- Form contains actionFunction components to call fnComplete and fnCompleteReset
from the button and JS function actionStatus displays status for fnComplete -->
<apex:form id="theForm">
<apex:actionFunction name="fnComplete" action="{!fnComplete}" status="functionStatus"
oncomplete="fnCompleteAlert()" rerender="outputField" timeout="30000" />
<apex:actionFunction name="fnCompleteReset" action="{!fnCompleteReset}"
rerender="outputField" timeout="30000" />
<apex:actionStatus startText="Calling fnComplete..."
stopText="fnComplete call finished." id="functionStatus" />
</apex:form>
</apex:page>

 

:: Controller ::

 

public class reportActionTestController {

// Boolean variable to switch between true/false to determine
// function success or failure, defaulted to false when page loads
// and only set to true when main function completes successfully
public Boolean fnSuccess = false;

public Boolean getfnSuccess() {
return fnSuccess;
}

public void setfnSuccess(Boolean b) {
fnSuccess = b;
}

// Main function, this would be where data updates are processed
// and then fnSuccess is set to true, for this example, the function
// just sets fnSuccess to true
public void fnComplete() {
fnSuccess = true;
System.debug('fnComplete Called fnSuccess=' + fnSuccess);
}

// Function to reset fnSuccess after fnSuccess has been verified
// true by JS function
public void fnCompleteReset() {
fnSuccess = false;
System.debug('fnCompleteReset Called fnSuccess=' + fnSuccess);
}
}

 

 

 

Hi - I've been working on some code to create a 2 dimensional array or an array of arrays - i.e. List<List<Primitive/Sobject>>, in this case List<List<Integer>>. I've developed some code along with some help from this post that sets up an array then loops through the array generating the internal array, or columns, then adds that array to the containing array thereby generating a row. The issue I am having is that while this works, when I examine the array outside of the for-loop each of the rows contains the same data when it shouldn't.

For example, I expect to generate a matrix containing the following data with the code below:
1,0,0,0,0,0
2,0,0,0,0,0
3,0,0,0,0,0
4,0,0,0,0,0
5,0,0,0,0,0
6,0,0,0,0,0

And, instead I get:
6,0,0,0,0,0
6,0,0,0,0,0
6,0,0,0,0,0
6,0,0,0,0,0
6,0,0,0,0,0
6,0,0,0,0,0
6,0,0,0,0,0

Here is the code I've been using to test. Any help/advice is greatly appreciated. Try running this in the Execute Anonymous window in the Force IDE or the System Log window.

Code:
 public String createArray() {
  Integer n;
  Integer m;
  Integer i;
  Integer j;
  Integer x;
  List<List<Integer>> d = new List<List<Integer>>();
  List<Integer> xd = new List<Integer>();
  
  n = 6;
  m = 5;
  
  for (i=0; i<=n; i++) {
   xd.clear();
   for (j=0; j<=m; j++) {
    xd.add(0);
   }
   d.add(xd);
   d[i][0] = i;
  }
  
  System.debug(d);
  
  return 'Success';
 }
 
 String ma = createArray();

 



Message Edited by mattdarnold on 10-21-2008 09:56 AM
Hi,

I am trying to implement some basic inline editing functionality on a Visualforce page with some custom Javascript code. I have the table setup so that when a user clicks a specific row the row elements turn into text input areas. What I've tried to do is when the user clicks the update button, the Javascript code sets two inputHidden elements to the newly edited text and then posts the apex:form element containing these two inputHidden elements. I have run into two issues here:

1. The page isn't recognizing my {!$Component.elementID} elements for the two inputHidden fields, but it is for the form element; I've got around this by adding in the full ID manually. Not sure why it works for some elements and not the others
2. When the form gets submitted (which it seems like it does successfully submit), my setDescription method runs, but doesn't update the description for the corresponding Account. I've put in some System.debug code in the setDescription method and it does show the new value I had entered in the form. The Apex log does turn up this error: "thePage:form:aDescription: An error occurred when processing your submitted information." However, it also states the select and update statements ran sucessfully.

Any help here is appreciated. And, if there is a better way to do this I'd be interested. Here is my page:

Code:
<apex:page controller="revAController" id="thePage">

 <head>
 
  <style>
  #hor-minimalist-b
  {
   font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
   font-size: 12px;
   background: #fff;
   width: 50%;
   border-collapse: collapse;
   text-align: left;
  }
  #hor-minimalist-b th
  {
   font-size: 14px;
   font-weight: normal;
   color: #666666;
   padding: 10px 8px;
   border-bottom: 2px solid #666666;
  }
  #hor-minimalist-b td
  {
   border-bottom: 1px solid #ccc;
   color: #666666;
   padding: 6px 8px;
  }
  #hor-minimalist-b tbody tr:hover td
  {
   color: #666666;
   background: #FAF8CC;
  }
  </style>
  
  <script type="text/javascript">
  
   var data = new Array();
   
   function Item(row){
    this.Row = row;
    this.Name = row.cells[0].innerHTML;
    this.Dsc = row.cells[1].innerHTML;
    this.Owner = row.cells[2].innerHTML;
    
    var _this = this;
    var mode = "view";
    
    row.onclick = function() {
     if (mode != "edit") {
      _this.Edit();
     }
     mode = "edit"
     return false;
    }

    this.Edit = function() {
     this.NameField = document.createElement("input");
     this.NameField.type = "text";
     this.NameField.value = this.Name;
     
     this.Row.cells[0].innerHTML =  "";
     this.Row.cells[0].appendChild(this.NameField);
     
     this.DscField = document.createElement("input");
     this.DscField.type = "text";
     this.DscField.value = this.Dsc;
     
     this.Row.cells[1].innerHTML =  "";
     this.Row.cells[1].appendChild(this.DscField);
     
     this.UpdateLink = document.createElement("a");
     this.UpdateLink.innerHTML = "update";
     this.UpdateLink.href = "#";
     this.UpdateLink.onclick = function() {
      _this.Update();
     }
     this.Row.cells[2].appendChild(this.UpdateLink);
     
    }
    
    this.Update = function() {
     var form = document.getElementById("{!$Component.form}");
     document.getElementById("thePage:form:aName").value = this.Name;
     document.getElementById("thePage:form:aDescription").value = this.DscField.value;
     
     //aName.value = this.Name;
     //aDescription.value = this.DscField.value;
     
     form.submit(); 
    }
   
   }
   
   window.onload = function() {
    var table = document.getElementById("hor-minimalist-b");
    
    for(var i=1; i<table.rows.length; i++){
     data.push(new Item(table.rows[i]));
    } 
   }
  
  </script>
 
 </head>

 <table id="hor-minimalist-b">
  <thead>
      <tr>
          <th scope="col">Account Name</th>
          <th scope="col">Account Description</th>
             <th scope="col">Owner</th>
         </tr>
     </thead>
  <tfoot>
  </tfoot>
     <tbody>
  <apex:repeat value="{!accounts}" var="account" id="theTable">
   <tr>
    <td>
     <apex:outputText value="{!account.name}"/>
    </td>
    <td>
     <apex:outputText value="{!account.description}"/>
    </td>    
    <td>
     <apex:outputText value="{!account.owner}"/>
    </td>
   </tr>
  </apex:repeat>
  </tbody>
 </table>
 
 <apex:form id="form">
  <apex:inputHidden id="aName" value="{!Name}"  />
  <apex:inputHidden id="aDescription" value="{!Description}"  />
 </apex:form>
</apex:page>

 And, here is my controller:

Code:
public class revAController {
 
 List<Account> accounts;
 
 public List<Account> getAccounts() {
  accounts = [select name, description, owner.name from account limit 10];
  return accounts;
 }
 
 Account acct = new Account();
 
 public String getName() { return acct.name; }
 public void setName(String aName) {
  acct.name = aName; 
 }
 
 public String getDescription() { return acct.Description; }
 public void setDescription(String aDescription) {
  System.debug('setDescription working'); 
  System.debug(acct.Name);
  System.debug(aDescription);
  Account a = new Account();
  a = [select id, name, description from account where name = : acct.Name limit 1];
  a.description = aDescription;
  update a;
 }
 

}

Thanks.

-- Matt


Hi - I am trying to create a simple visualforce page that displays a dataTable of opportunities and then provides a commandLink within each row that when clicked changes the Forecast_Category__c field to 'Medium'. This works, however, only for the final row of the dataTable. I also tried this using a pageBlockTable and it worked, but only for the first record.

Thanks for any help -- Matt

Here is my page:

Code:
<apex:page controller="forecastController" title="Forecast Report">

<apex:form id="theForm">
<apex:dataTable value="{!OppsHigh}" var="opp" id="theTable" cellpadding="4">
<apex:column >
<apex:facet name="header">Link</apex:facet>
<apex:commandLink action="{!updateOpp}" value="M" id="theCommandLink" rerender="theTable">
<apex:param value="{!opp.id}" assignTo="{!oppId}" />
</apex:commandLink>
</apex:column>
<apex:column >
<apex:facet name="header">Name</apex:facet>
<apex:outputText value="{!opp.name}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Forecast Category</apex:facet>
<apex:outputText value="{!opp.Forecast_Category__c}"/>
</apex:column>
</apex:dataTable>
</apex:form>

</apex:page>

 And, here is my controller:

Code:
public class forecastController {

public ID oppId;
public void setOppId(ID i) { oppId = i; }
public ID getOppId() { return oppId; }

public List<Opportunity> getOppsHigh() {
List<Opportunity> opps = [select
id,
name,
CloseDate,
Type,
Forecast_Category__c
from Opportunity
where Forecast_Category__c = 'High'];
return opps;
}

public void updateOpp() {
Opportunity opp = [select
id,
name,
CloseDate,
Type,
Forecast_Category__c
from Opportunity
where id =:oppId limit 1];

opp.Forecast_Category__c = 'Medium';
update opp;
}

}

 




Hi all,

I am trying to write a bit of Apex code to check for duplicate Leads before insert. These would be Leads coming from a web-to-lead form and they would be associated with Campaigns.

If it does find a duplicate, it should do the following:

1. Shouldn't insert this lead
2. Should take the existing Lead and create a CampaignMember record that links the existing Lead with the Campaign ID associated with the incoming Lead.

The trouble I am having is that I don't really understand how the web-to-lead form inserts records into the database and how I could access the associated Campaign and ID through the trigger. Any help is greatly appreciated.

Thanks,
-- Matt

Hi everyone,

I working with the conference management app provided by Salesforce on the Appexchange. (http://www.salesforce.com/appexchange/detail_overview.jsp?NavCode__c=&id=a0330000000HFT3AAO)

I am trying to make some modifications to the Attendee Role object. What I would like to do, ideally, is that when a user selects an attendee, really a contact (via the contact lookup), I want it to automatically select the account that corresponds to that contact.

The reason I want to add this functionality is so that the conferences will show up under a related list in both the contact and account page layouts.

I have been struggling with this for a little while - hopefully someone can help me out.

Thanks.
-- Matt

Hi,

 

If I have a dataTable with id = tableId and use jQuery to access it using $("#tableId") it doesn't work. But when I create the same table using regular HTML tags it works.

 

Anybody know's what's going on?

 

Thanks.

  • January 15, 2010
  • Like
  • 0

We've been struggling with getting a zipped static resource to work for weeks now. We got Salesforce Support involved from the beginning, but they've gotten us nowhere. If we can't get a resolution to this issue soon, we might just find a platform that wastes less of our time...

 

Here is the situation - we are trying to upload a portion of the YUI library as a static resource, but no matter what we try, we can't get the files to render in our VisualForce pages. Salesforce Support can get it to work (sometimes), but we can't. The difference seems to be around the MIME Type that is set when the file is uploaded. When we upload the file, it gets set to a MIME Type of 'application/zip', but when SFDC Support uploads the file, it gets set to a MIME Type of 'application/x-zip-compressed' or 'application/octet-stream'. Salesforce can't explain to us exactly why or how these different MIME Types get set. They're looking into why our uploads don't work, but I'm not expecting much from them at this point.

 

To reproduce our steps:

 

Download the file from here after clicking the radio button labeled "Full developer kit":

Steps:
  1. Download "Full developer kit"
  2. Open zip and remov the documentation and examples folders (to reduce size)
  3. Change file name from "yui_3.0.0.zip" to "yui.zip"
  4. Upload as a static resource named "testyui"
  5. In component "header" (where all other JS files are included) add:
    • <apex:includeScript value="{!URLFOR($Resource.testyui, 'yui/build/yui/yui-min.js')}" />
  6. If we refresh the page we get a 404 error for this resource.
 
If anyone has experienced a similar issue, any help you could provide would be greatly appreciated.

Hi - can someone confirm whether or not a user on professional edition can access the metadata API - i.e. can a partner use the metadata API the same way they'd be able to use the standard API to provide application functionality despite a professional users lack of API access?

 

Not sure if this is the right place for this question...

 

-- Matt

Hi All

Is there any solution to implement dependent picklists in visualforce using apex?

I know an alternate solution to hack picklist.js of salesforce and can implement dependent picklist functionality. But I want to confirm again that is there any idea to implement this same functionality using visualforce & apex without hacking javascript? I tried with DescribeSObject to get dependent picklist values, but could not able to get their Field Dependency relationships.

Thanks  :smileyhappy:
  • September 18, 2009
  • Like
  • 0

I have a static resource javascript file with code -

var strTbl1='';
strTbl1+='<table>';
strTbl1+='<tr>';
strTbl1+='<td align="center" width="15" height="20"> <img src="cancel.png" border="0"/> </td>';
strTbl1+='</tr>';
strTbl1+='</table>';

I have an image, it is not in zip file, with name "cancel" in static resource.
How can replace  "<img src="cancel.png" border="0"/>" with static resource image?

I'm trying to embed a Visualforce page within an Opportunity to display some checkboxes in a view mode. The logic is there and it works just fine, but I just can't get the thing to look like the rest of the opportunity page. 

 

Now I know what you're going to say... why didn't I use a pageblock and pageblocksection? It just doesn't look good. It looks like I have a section within a section instead of a new section on its own. Basically, all I want is the pageblocksection. Unfortunately, you need the pageblock to have a pageblocksection.

 

I tried using Salesforce's common CSS stylesheet, but couldn't figure out which class to use. Here is the visualforce, anyone willing to help out?

 

<apex:page standardController="Opportunity"> <apex:form > <apex:panelgrid width="100%"> <h3>Sales Management Questionaire</h3> </apex:panelgrid> <apex:panelGrid columns="2" > <apex:inputcheckbox value="{!opportunity.Q1__c}" disabled="true"/>Question 1 <apex:inputcheckbox value="{!opportunity.Q2A1__c}" disabled="true"/>Question 2 <apex:inputcheckbox value="{!opportunity.Q2B1__c}" disabled="true"/>Question 3 <apex:inputcheckbox value="{!opportunity.Q2C1__c}" disabled="true"/>Question 4 </apex:panelGrid> </apex:form> </apex:page>

 

 

 

 

 

 

I have an Account trigger where I want to update all the contacts.

 

I might have more than a 1000 contacts (query limit) or 100 contacts (DML Limit) So I might have to resort to a @future method. 

 

However given that @future methods have 200 a day limit (per user or per org?), I don't want to call a @future method if an Account has only 2 contacts.

 

But how do I find out that I have only 2 contacts? I have to query, and that might cause a governor limit error...

 

 

Currently we can integrate google talk onto sidebar. Can we bring the gtalk window onto visualforce page?

Hi

 

Can any one help me to how can we count the repeat counter.I want display sequeance number when display data using repeat.

  • July 21, 2009
  • Like
  • 0

Hi all,

 

Can anyone help me out in writing a unit test for constructor method? I am very new to writing test methods. Please help!!

 

Here is the snippet of the controller constructor code:

 

// Constructor Method public newScoreRuleController () { // Give me blank lines of my Object ScoringRule = new List<ScoringRule__c>(); for (integer i = 0; i < 5; i++) { ScoringRule.add( new ScoringRule__c() ); } }

 

 Thanks in advance!

Regards

Mukul

 

  • July 21, 2009
  • Like
  • 0
I had to change an existing method so that it would execute asynchoronously. Here is the original method
 

public class WorkflowTickler { public static void TickleOpportunitySalesGoal(Opportunity_Sales_Goal__c[] opportunitySalesGoalArr) { DateTime currentTime = System.Now(); for(Opportunity_Sales_Goal__c opportunitySalesGoal:opportunitySalesGoalArr) { opportunitySalesGoal.Last_Sync_To_Parent__c = currentTime; } update opportunitySalesGoalArr; }}

 

 

The trigger that calls the method is

 

 

trigger syncParentOpportunitySales on Sales_Goal__c (after update) { Opportunity_Sales_Goal__c[] lstOpportunitySalesGoal = [Select Id from Opportunity_Sales_Goal__c where Sales_Goal__c in :Trigger.newMap.keyset()]; WorkflowTickler.TickleOpportunitySalesGoal(lstOpportunitySalesGoal); }

 I ran into Too many rows issue when trying to update rows. So I am trying to use the @future to resolve the issue.

 

But when I try to use @future in the method it would not work since I keep getting this error

 

 

Save error: Unsupported parameter type LIST:SOBJECT:Service__c e

 

 The documentation says 

List, Array of SObject cannot be a parameter to an @future method.

How to solve this issue now. This is in production :(
 
Thanks
 

 

 

 

  • July 16, 2009
  • Like
  • 0

Hi,

 

I'm not able to get the inputField values passed into my extended controller. Need that to do some calculations in my apex code and refresh the visualforce page to show the new calculated values to the user.

Here share the code I have up to now:

 

Visualforce code: (please see the line comments on it)

 

<apex:page standardController="Cnno_Purchase_Requisition__c" extensions="PurchaseRequisitionController" id="PR_New_page"> <apex:SectionHeader title="Purchase Requisition" subtitle="New Purchase Resquisition" /> <apex:form > <apex:pageblock title="Purchase Requisition Creation" mode="edit" id="block"> <apex:pageMessages /> <apex:pageBlockButtons location="both"> <apex:commandButton action="{!save}" value="Save"></apex:commandButton> <apex:commandButton action="{!cancel}" value="Cancel"></apex:commandButton> <apex:commandButton action="{!doRefresh}" value="Refresh Values" rerender="block"></apex:commandButton> </apex:pageBlockButtons> <apex:pageBlockSection columns="2" title="Information"> <apex:outputField value="{!PurchaseRequisition.OwnerId}"/> <apex:outputField value="{!PurchaseRequisition.Status__c}"/> <apex:pageBlockSectionItem > <apex:outputLabel value="Item Requested"/> <apex:outputPanel id="item"> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Item_Requested__c}"> <!-- apex:actionSupport event="" rerender="item" status="status"/ --> </apex:inputField> <!-- apex:actionStatus startText="applying value..." id="status"/ --> </apex:outputPanel> </apex:pageBlockSectionItem> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Request_Date__c}"/> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Required_Item_Description__c}"/> <apex:outputField value="{!Cnno_Purchase_Requisition__c.Item_Requested__r.Standard_Cost__c}"/> <!-- THIS IS NOT SHOWN!! --> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Ship_To_Location__c}"/> <apex:pageBlockSectionItem > <apex:outputlabel value="Total Amount" /> <apex:outputtext value="{!totalamount}"/> <!-- This throught NULL when refresh performs --> </apex:pageBlockSectionItem> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Max_to_pay__c}" /> </apex:pageBlockSection> <apex:pageBlockSection columns="1" title="Additional Notes"> <apex:inputField value="{!Cnno_Purchase_Requisition__c.Additional_Notes__c}"/> </apex:pageBlockSection> </apex:pageblock> </apex:form> </apex:page>

 

APEX Code in extended controller:

 

public class PurchaseRequisitionController { private Cnno_Purchase_Requisition__c purchaseRequisitionObj; private Cnno_Purchase_Items__c item; private String vendor; private Double totalAmount; public PurchaseRequisitionController(ApexPages.StandardController controller) { this.purchaseRequisitionObj = (Cnno_Purchase_Requisition__c)controller.getRecord(); this.purchaseRequisitionObj.OwnerId = UserInfo.getUserId(); this.purchaseRequisitionObj.Status__c = '1 - Open'; } public Cnno_Purchase_Requisition__c getPurchaseRequisition() { return purchaseRequisitionObj; } public void setPurchaseRequisition(Cnno_Purchase_Requisition__c pr) { this.purchaseRequisitionObj = pr; } public Double getTotalAmount() { return TotalAmount; } public void doRefresh() { totalAmount = purchaseRequisitionObj.Item_Requested__r.Standard_Cost__c * purchaseRequisitionObj.Quanitity__c; } }

 

Will really appreciate your help! I'm blocked here.

 

Thanks!

 

Fernando.-

  • July 05, 2009
  • Like
  • 0

Is there any other way to include visualforce page into home page instead of using iframe?

 

By using iframe, there will have scroll bar which I do not want.