• Luke@PCA
  • NEWBIE
  • 0 Points
  • Member since 2007

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

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?

 

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:

Code:
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?
 


 

Hi,
 
Not been able to find anything about this in documentation. Is it possible to access DOM methods and properties for visual force objects? I am looking at making paired lists similar to the ones on the Web-To-Lead setup page which allows users to select, order and switch items between lists. I have constructed the lists and tied them into the data fine so just need to code the buttons. Is this at all possible in Visual Force/Apex do this or will I need to use Javascript like the components on other pages?
 
Thanks
I have two custom objects, Setting and Customisation (British spelling). Customisation has a Master-Detail(Setting) field and
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.
Hi,
 
Building a page in Visual force. Has a detail view of a custom object and an Edit button with action !edit. Below is another Pageblock. If I have another button New here with an action !new and save I get the error: Unexpected token: PageReference and lose all changes I had made. If I add public PageReference new() into the code I get Error: Compile Error: unexpected token: PageReference at line 61 column 12. Surely its possible to have more than one button on a page?
Had a play with Visual Force as our app is all in clunky S-Controls at the moment and I'm very impressed with it so far, however have not found a way to get around the follow problem.

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?

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:

Code:
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?
 


 

I have two custom objects, Setting and Customisation (British spelling). Customisation has a Master-Detail(Setting) field and
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.
Hi,
 
Building a page in Visual force. Has a detail view of a custom object and an Edit button with action !edit. Below is another Pageblock. If I have another button New here with an action !new and save I get the error: Unexpected token: PageReference and lose all changes I had made. If I add public PageReference new() into the code I get Error: Compile Error: unexpected token: PageReference at line 61 column 12. Surely its possible to have more than one button on a page?
I've made a visualforce page that uses the Contact standardController, for some reason it doens't show up as an option in the override view page list. I can see it in the override tab list though. Any ideas?

Scott
Had a play with Visual Force as our app is all in clunky S-Controls at the moment and I'm very impressed with it so far, however have not found a way to get around the follow problem.

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?