• Paul Bourdeaux
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies

Hi All,

 

can anyone tell me how to prepopulate an account lookup field while creating a new record from a related object. And this should happen through onclick javascript of a button cos i m nt using VF pages here.

 

Thanks,

Sandeep

Hi all, 

 

i'm trying to use Rich Text Field on a Salesforce site's page with a custom controller. 

I updated both the controller and Visualforce page version at 18.0 :

 

- the controller, after this save, works correctly 
- but when i try to saving the version of this visualforce page, the error will appear is: 
"Error: Invalid field Description__c for SObject Ospitalita__c" 
(Description__c is the Rich Text Field) 


For your info, if i insert this rich text field in a empty visualforce page, it works correctly. 
But i give the error in my site pages , which have the template tags (apex:composition and apex:insert) . 

Are "this tags" the problem? 

How can i fix it? 
I need apex:composition and apex:insert and i don't want to delete them or substitute with component.

 

Thanks in advance!! 

I had a need to sort several small lists of SelectOptions (<100 items) and wrote this basic quicksort to do it.  I decided to share it in case anyone else finds it useful.

 

Be advised this will probably only work for smaller lists because the call stack may get large, in which case you will want to use one of the more complex versions of quicksort which are posted around the forums. 

 

// This is a simple quicksort algorithm to sort a SelectOption list (dropdown)
// by label alphabetically.
public static List<SelectOption> SortOptionList(List<SelectOption> ListToSort)
{
if(ListToSort == null || ListToSort.size() <= 1)
return ListToSort;

List<SelectOption> Less = new List<SelectOption>();
List<SelectOption> Greater = new List<SelectOption>();
integer pivot = 0;

// save the pivot and remove it from the list
SelectOption pivotValue = ListToSort[pivot];
ListToSort.remove(pivot);

for(SelectOption x : ListToSort)
{
if(x.getLabel() <= pivotValue.getLabel())
Less.add(x);
else if(x.getLabel() > ListToSort[pivot].getLabel()) Greater.add(x);
}
List<SelectOption> returnList = new List<SelectOption> ();
returnList.addAll(SortOptionList(Less));
returnList.add(pivotValue);
returnList.addAll(SortOptionList(Greater));
return returnList;
}

 

 

 

 

Message Edited by jhartfield on 03-15-2010 11:17 AM

 

 

Where is Mapping of picklist values to a particular RecordType defined?

I couldn't find it in the API.

 

 

 

 

  • March 04, 2010
  • Like
  • 0

We're trying to use the new "Rich Text Area" Data Type in our VisualForce pages, but getting the following error:

 

"Error: Invalid field Main_Content__c for SObject CloudConversion__Portal_Content__c"

 

This is supported yet?  Is there a special trick to get it to work?

 

Thanks,

Jon 

 

 

<apex:outputText escape="false" value="{!content.Main_Content__c}"/>

 

 

 

Hi,

    I have problem in Batch Apex Query.Below is My Query,

 

 

return DataBase.getQueryLocator('Select Id,Account.Annual_Account_Target_Number__c,Account.Target_for_Q1__c,Account.Target_for_Q2__c,Account.Target_for_Q3__c,Account.Target_for_Q4__c,Territory.Name,Account.Name,Opportunity__c,CloseDate,Projections__c,Closed_Won__c,AccountId,StageName,(Select Id, Name,Start_Date__c,End_Date__c,Opportunity__c,Resource_Amount__c,CreatedDate From OpportunityProducts__r where Start_Date__c >= '+g_StartDate+' AND End_Date__c <= '+ g_EndDate +') from Opportunity where (StageName!=\'Lead\' AND StageName!=\'Closed Lost\') AND (CloseDate >= '+g_StartDate+' AND CloseDate <= '+ g_EndDate +' )ORDER BY CloseDate');

 

 The error message is : System.QueryException: line 1:411 no viable alternative at character ' ' .

 

Please help me to get out from this bug.

 

Thanks! 

 

  • November 19, 2009
  • Like
  • 0