-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
6Questions
-
7Replies
Unicode javascript as a static resource
Tried adding some pretty standard Javascript files as static resources. Having problems including the files in VF pages which contain unicode character. Is unicode not supported?
-
- Luke@PCA
- August 12, 2009
- Like
- 0
- Continue reading or reply
Lead Assignment Trigger
I have a quite complex lead assignment process for which lead assignment rules are simply not up to the task, both in complexity and number.
I can overcome the complexity problem by using a webservice to calculate the name of the user I need to assign the lead to but I still have problems as rules like Manager__c = "X" assign to user X would cause me to hit the limit of assignment rules.
So I was thinking I could do it with an Apex trigger but I have been unable to find a way so far. I have some up with something like:
trigger assignLead on Lead (before insert, before update) { for (Integer i = 0; i < Trigger.new.size(); i++) { if (trigger.new[i].Status == 'Qualified') { Trigger.new[i].Owner.Name = [Select Name from User where Name = 'X'][0].Name; } } }
Messy I know but that was after trying many different things, so far but that throws a compile error "Field is not writeable: Owner.Name at line 7 column 28" and was wondering if I was thinking down the wrong route?
-
- Luke@PCA
- March 06, 2008
- Like
- 0
- Continue reading or reply
methods and properties for visual force objects
-
- Luke@PCA
- December 19, 2007
- Like
- 0
- Continue reading or reply
relatedList of custom objects
Child Relationship Name is | Customisations. However
Code: <apex:relatedList list="Customisations" title="Profiles" subject="{!SettingId}"/> Causes an error: 'Customisations' is not a valid child rationship name for entity Setting. The name right and I think I have the objects setup right. SettingId is the Id of the setting record I am using to store the information and the customisation record is related to the correct one. Seems to be moaning about the right object so I doubt its a custom controller problem. |
-
- Luke@PCA
- December 17, 2007
- Like
- 0
- Continue reading or reply
unexpected token: PageReference when adding another button
-
- Luke@PCA
- December 14, 2007
- Like
- 0
- Continue reading or reply
apex:selectManyCheckbox + apex:repeat?
We want to have a way of selecting which countries apply using check boxes but the following code will not work:
<apex:selectManyCheckbox value="{!CountrySelection}" id="selectCheckbox" layout="pageDirection">
<apex:repeat value="{!Countries}" var="Country">
<apex:selectItem itemValue="{!Country}" itemLabel="{!Country}"/>
</apex:repeat>
</apex:selectManyCheckbox>
Custom Control Code:
public String[] getCountries() {
return new String[]{'GBR','USA','CAN','IRL'};
}
public List<String> getCountrySelection() {
List<String> countrylist = new List<String>();
countrylist.add('GBR');
countrylist.add('USA');
return countrylist;
}
Within the <apex:repeat> tags it is possible to output the country names with an <apex:outputText value="{!Country}/> and also possible to make an <apex:selectItem> using an API reference to a string outside of the repeat tags but cant seem to find a way to loop through countries and make an <apex:selectItem> for each.
Anyone else had problems with this?
-
- Luke@PCA
- October 09, 2007
- Like
- 0
- Continue reading or reply
Lead Assignment Trigger
I have a quite complex lead assignment process for which lead assignment rules are simply not up to the task, both in complexity and number.
I can overcome the complexity problem by using a webservice to calculate the name of the user I need to assign the lead to but I still have problems as rules like Manager__c = "X" assign to user X would cause me to hit the limit of assignment rules.
So I was thinking I could do it with an Apex trigger but I have been unable to find a way so far. I have some up with something like:
trigger assignLead on Lead (before insert, before update) { for (Integer i = 0; i < Trigger.new.size(); i++) { if (trigger.new[i].Status == 'Qualified') { Trigger.new[i].Owner.Name = [Select Name from User where Name = 'X'][0].Name; } } }
Messy I know but that was after trying many different things, so far but that throws a compile error "Field is not writeable: Owner.Name at line 7 column 28" and was wondering if I was thinking down the wrong route?
- Luke@PCA
- March 06, 2008
- Like
- 0
- Continue reading or reply
relatedList of custom objects
Child Relationship Name is | Customisations. However
Code: <apex:relatedList list="Customisations" title="Profiles" subject="{!SettingId}"/> Causes an error: 'Customisations' is not a valid child rationship name for entity Setting. The name right and I think I have the objects setup right. SettingId is the Id of the setting record I am using to store the information and the customisation record is related to the correct one. Seems to be moaning about the right object so I doubt its a custom controller problem. |
- Luke@PCA
- December 17, 2007
- Like
- 0
- Continue reading or reply
unexpected token: PageReference when adding another button
- Luke@PCA
- December 14, 2007
- Like
- 0
- Continue reading or reply
Override View with Visualforce Page
Scott
- Scott.M
- December 06, 2007
- Like
- 0
- Continue reading or reply
apex:selectManyCheckbox + apex:repeat?
We want to have a way of selecting which countries apply using check boxes but the following code will not work:
<apex:selectManyCheckbox value="{!CountrySelection}" id="selectCheckbox" layout="pageDirection">
<apex:repeat value="{!Countries}" var="Country">
<apex:selectItem itemValue="{!Country}" itemLabel="{!Country}"/>
</apex:repeat>
</apex:selectManyCheckbox>
Custom Control Code:
public String[] getCountries() {
return new String[]{'GBR','USA','CAN','IRL'};
}
public List<String> getCountrySelection() {
List<String> countrylist = new List<String>();
countrylist.add('GBR');
countrylist.add('USA');
return countrylist;
}
Within the <apex:repeat> tags it is possible to output the country names with an <apex:outputText value="{!Country}/> and also possible to make an <apex:selectItem> using an API reference to a string outside of the repeat tags but cant seem to find a way to loop through countries and make an <apex:selectItem> for each.
Anyone else had problems with this?
- Luke@PCA
- October 09, 2007
- Like
- 0
- Continue reading or reply