• gsargucci
  • NEWBIE
  • 25 Points
  • Member since 2009

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

Hi,

I have the following code snippet in the managed package for our product:

  ...

List<Area__c> areaName = [Select Id,Name,eoSite__c from Area__c where eoSite__c = : m_project.Site_new__c ORDER BY Name];
  ...

    public List<SelectOption> getAreaOptions()
    {
        List<SelectOption> lstAreaOptions = new List<SelectOption>();
        for (Integer iRow = 0; iRow < areaName.size(); iRow++)
        {

            lstAreaOptions.add(new SelectOption(areaName[iRow].Id, areaName[iRow].Name));
        }
        return lstAreaOptions;
    }

...

When it gets executed in ONE of the orgs where we have our package installed, I get the following exception:

caused by: System.ListException: List index out of bounds: 1
Class.eo3.EditSubContract.getAreaOptions: line 266, column 58

This location corresponds to the line inside the 'for' loop above.  What I don't understand is, the way the code is written, it seems like you should NEVER receive an 'out of bounds' exception, since the list is never modified inside the loop.  The list, BTW, should only contain 1 entry, so it is true that if I tried to access entry at [1], I'd get an exception.  However, shouldn't the 'for' construct handle that?

The package is installed in many orgs; none of which have this problem.  In addition, it seems like the problem started happening about two weeks ago--without any package updates on our part.

So, I am usually the first one to roll my eyes when people say 'it's a bug in the platform', but I'm really not understanding what's happening in this case and how there could possibly be an 'out of bounds' exception in that code.  Has anyone seen anything like that?  Is there some caveat that I'm overlooking?

Going insane--please help!

Hello,

I am having some difficulty getting the Sites registration flow to work.  I have read the login setup instructions for both Sites and the Customer Portal, as well as the article about authenticating users on Sites.  We have implemented a custom SiteRegister form,and defined various access settings and profiles, but are not seeing the behavior we'd expect.  I'm sure it's our misunderstanding or operator error, but any insights on what we may be doing wrong would be much appreciated.
Setup
- Sites and Customer Portal enabled and configured in a Partner DE org
- Login settings for site set to 'Customer Portal'
- Active Site Home Page set to SiteRegister
- Self-registration settings for CP are set as follows:
  - Registration enabled
  - Default new user license: High-volume Customer Portal
  - Default new user profile: Custom profile 'P', based on High-volume Customer Portal profile
- VF page 'Public', as well as SiteLogin and SiteRegister pages, are enabled for:
  - the site
  - Guest profile
- VF page 'Private' is enabled for the HVCP profile 'P' above
- Page 'Public' links to page 'Private'
Expected behavior 
1. Navigate to 'Public'; click on link to 'Private'
2. Be presented with (redirected to) the login page for the site--SiteLogin (that presumably would also have a link to SiteRegister)
  a. Login and be redirected to 'Private'; OR
  b. Register and be redirected to 'Private'
Observed behavior 
1. Navigate to 'Public'; click on link to 'Private'
2. Redirected to a page that looks like the customer portal 'Home' page.  No additional prompts or error messages.
While I could very much allow that there are still bugs in the custom registration code, it doesn't seem like we're even getting that far, since we're never prompted to login or register.  So, I'm guessing it's a matter of getting the configuration right, but am honestly getting lost in the permutations of the config options.
Can any one offer hints for areas of further investigation?  (Of course, if you want to just come out and tell me what I'm doing wrong, that's fine as well!  :-)  )
Thank you in advance!
Alex

 

Hi there,

 

I'd like to customize the look of my Sites VF pages very slightly.  Specifically, I'd like to be able to control the background color of the section blocks.  I can do this via the 'tabStyle' attribute on either the 'page' or the 'pageBlock' tags, like this:

 

 

<apex:page showheader="false" sidebar="false" tabStyle="eoSite__c">
<apex:sectionHeader title="Test Section Title"/>
<apex:pageBlock mode="edit">
<apex:pageBlockSection title="Block Section"/>
</apex:pageBlock>
</apex:page>

 

 

This works fine when the page is rendered 'inside' SFDC proper, and I can change the look by changing the tab properties of my 'eoSite' custom object tab, but in the Sites context, it just uses the default Sites styles and colors.  I've read various articles for customizing look and feel of Sites pages, and know that I can upload a custom stylesheet and take almost total control over that, but that seems like such overkill for what I need to do.  I just want to change the silly block background colors!  :-)

 

So:

- Is there a simpler way to change the background color of the 'pageBlock' sections?

- If I'm stuck dealing with CSS, what is the minimum set of styles that I need to 'override' to accomplish the above?  (I've looked at the CSS files that are loaded by default, and there are a lot of styles and selectors there...  Plus, I'm not a CSS guru, so am hoping to avoid them, if at all possible.)

 

Thank you all in advance!

 

Alex

 

When I try to execute this code snippet:

 

String strVal = '';
List <String> lstVals = strVal.split(',');
System.debug ('***** List: ' + lstVals + ', size: ' + lstVals.size ());
for (String s : lstVals)
  System.debug ('***** List element [' + s + ']');

 

 

String strVal = '';

List <String> lstVals = strVal.split(',');

System.debug ('***** List: ' + lstVals + ', size: ' + lstVals.size ());

for (String s : lstVals)

  System.debug ('***** List element [' + s + ']');

 

I get the following output (some lines omitted for clarity:

 

15:24:15.186|USER_DEBUG|[3,1]|DEBUG|***** List: (), size: 1

15:24:15.186|USER_DEBUG|[5,3]|DEBUG|***** List element []

So, it seems that somehow I'm getting back an empty list of size '1'.  I would expect back a list of size 0, since there are no tokens in my string being split (it's an empty string).
Am I missing something, or is this a peculiar bug?  If so, is it a bug in 'split' or 'size'?
Thanks!

 

Hi,

 

I'm trying to get a seemingly simple workflow rule to fire, but, for the life of me, cannot.  Here's the setup:

- Object A (Project) has a text formula field, 'Application_Project__c', defined as follows:

IF ( CONTAINS($RecordType.DeveloperName, 'Application'),
"Yes",
"No"
)

 

- Object B has a Lookup to Object A (Project__r) and is trying to do a field update using the following, formula-based WF criteria:

Every time a record is created or edited

IF (CONTAINS (eo3__Project__r.eo3__Application_Project__c, "Y"), true, false)

 

I see that an instance of Object A correctly evaluates its formula field to "Yes".  I then save an instance of Object B and see the following in the System Log:

 

9:10:48.579|WF_CRITERIA_BEGIN|[Object-name a0NA0000002mbzz]|Mark Retrofit as Application|01QA0000000DBAA|ON_ALL_CHANGES
9:10:48.589|WF_FORMULA|Formula:IF (CONTAINS (eo3__Project__r.eo3__Application_Project__c, "Y"), true, false)|Values:eo3__Project__r.eo3__Application_Project__c=Yes
9:10:48.589|WF_CRITERIA_END|false

 

So, even though the field that I'm trying to base the comparison on is set to 'Yes', the WF evaluates to 'false'.  I've tried this with and without CONTAINS, with single quotes, double quotes, etc--but I can't seem to get the silly thing to evaluate to 'true' and for the WF to fire.  I don't know if it's something silly or if I'm missing something fundamental here.

 

Any ideas or insights will be greatly appreciated.  Thanks!

I need to move the source code making up a managed package to another org, so that I can create a new package (with a different namespace) after making some changes.  I have a custom object with several fields that are all 'Lookup(User)'.  The child relationship names for all of these fields somehow ended up being the same.  I don't know how that happened, why SF let us do it in the first place, etc.--but I'm now stuck in the following situation:

 

- The object has multiple fields with the same relationship name

- When I try to deploy this object to the new org, I get the following error:

    # Deploy Results:
    File Name:    objects/Work_Order__c.object
    Full Name:  Work_Order__c.Assigned_Installation_Manager__c
    Action:  NO ACTION
    Result:  FAILED
    Problem: Duplicate relationship name: Work_Orders
- I cannot change the relationship name (or delete the field) in the source org, because it's a part of a managed, released package

 

Could anyone offer any suggestions on how to get past this?  Maybe I'm overlooking something.

 

Thank you in advance!

 

 I have a program feature that generates PDF documents via the standard Visual Force 'renderAs="PDF"' mechanism. This feature does not work reliably for 'larger' documents (i.e. 50 pages). By 'reliably' I mean that I can run PDF generation 10 times, and it will work successfully 3-5 times out of these 10. The rest of the time, after a 3+ min delay, I get the following error message:

"PDF generation couldn't complete because the request took too long. You are using components that are not fully supported by PDF generation, please consult the documentation for a list of unsupported components."

I've reviewed the page (it's a long and ugly beast, so am not posting it here), but am not seeing anything unsupported or suspicious.  This test can be run on the exact same object, with the exact same data, 10 times in a row, and the results are non-deterministic.   The fact that it works for some runs, but not others makes me suspect that this doesn't have to do with any specific page markup, but I could be wrong.

When I look at the system log output, I see that the controller code for this page is done after 12-15 sec. After that, there's a long delay--when the PDF is rendered successfully, the delay is about 30-40 sec. When it fails, as above, it is 3+ min.

It appears that something is making the PDF rendering engine go haywire, but I have not been able to figure out what it may be, and therefore, how to work around it.

If you have the system log open, you can see that the last statement from the controller (CODE_UNIT_FINISHED|StaticResourcePick <init>) is usually executed a long time before the CUMULATIVE_LIMIT_USAGE line. 

 

 

Does anyone have any ideas/suggestions?

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!

Hi,

 

This is really a follow-up to another question for which I've been unable to get a response.  Sorry for reposting.   I'm a little confused about the namespace prefixes and their usage in Apex.  The docs for namespaces say:

 

Salesforce automatically prepends your namespace prefix, followed by two underscores ("__":smileywink:, to all unique component names in your Salesforce organization. A unique package component is one that requires a name that no other component has within Salesforce, such as custom objects, custom fields, custom links, s-controls, and validation rules. For example, if your namespace prefix is abc and your managed package contains a custom object with the API name, Expense__c, use the API name abc__Expense__c to access this object using the API. The namespace prefix is displayed on all component detail pages.

 

Is the 'API' referred to here the 'client' API?  For example if I want to expose a Web Service and call it from Java, I'd have to use the namespace prefix in the call.  Or do I somehow have to reference the namespace prefix in the Apex code?  I'm assuming it's the former, because the latter doesn't seem to make much sense--since the namespace would change from org to org as the package gets inistalled in different orgs, I couldn't really reference it in the Apex code.  Or am I missing something?

 

Thanks!

Hi,

 

I've recently discovered that the custom object name 'Site', with the API name 'Site__c' seems now to be used as a native SF object name (presumably since Sites went public).  I use this name in my application and now need to deploy it to another org.  Of course, I'm unable to transfer my custom Site__c object, because SF complains that the name already exists.

 

I have that name referenced in quite a few Apex classes and VF pages.  What is the most practical to go about resolving this?  I can think of a couple of ways:

 

Option 1 -- Try reusing the existing 'Site' object

- Temporarily remove all references to Site__c from all Apex and VF page files (How???  This sounds like it would be a pain.)
- Rename the site API name to 'azSite__c' (for example)

- Modify all of the Apex and VF page references to the old name ('Site__c') to reference 'azSite__c'

Advantages:
- Can keep existing Site data

Disadvantages:
- Temporily removing existing references sounds very painful


Option 2 -- Create and use a new 'Site' object

- Create a new site object with the API name 'azSite__c'
- Modify all of the Apex and VF page references to the old name ('Site__c') to reference 'azSite__c' (can do this by doing a global 'search and replace' on the local files in Eclipse, then saving files to Force.com)

Advantages:
- Simpler to implement than trying to modify existing object
Disadvantages:
- Lose existing Site data 

 

Are there other options that I'm overlooking? Can something be done with namespaces to avoid the conflict with the built-in name 'Site'?

 

Any suggestions would be greatly appreciated.

 

Thank you in advance!

 

Alex

 

Hi,

 

I'd like to have a 'configuration' object in my Force.com app--effectively mirroring the functionality of a properties or a configuration file that you'd have in a non-cloud app.  Conceptually, I could have a singleton object that contains fields that represent the various configuration attributes, modify this object via the standard UI, and read it to access its fields as necessary.

 

However, I'd like to avoid re-reading this object for every request (I know that I can read it once and have it be available via a static variable within the context of the same request).  Is there a way to somehow 'cache' it to make it available for multiple requests without having to re-read this (perhaps only re-reading it every so often)?  Is there a best practice or a Force.com design pattern to accomplish this?  Or is this not even necessary, because the overhead of reading a single object is trivial, due to the DB's own caching?

 

Thanks!

 

Alex

 

Hi,

 

I'm hoping someone can offer some insights about class loading and object instantiation overhead in Apex.  Based on what I've seen in the docs, it appears that classes are loaded for each request context (which, for example, allows you to use static variables across different invocations in the same request).

 

Are classes really loaded for each request or are they cached?  How much overhead is associated with class creation in Apex.

 

For example, if I wanted to have a class of string constants, like this:

 

class MyStrings

{

  public static String STR_HELLO = "Hello";

  public static String STR_WORLD = "world";

}

 

and then access these strings from multiple other classes, like MyStrings.STR_HELLO, how much overhead would I be introducing, vs. just hard-coding the string ?

 

Is this described somewhere?  In general, is there any kind of a lower-level whitepaper or Apex architecture document that is available to shed some light on something like this?

 

Thanks in advance,

 

Alex

 

 

Hi,

 

I've seen that the topic of sites authentication has been discussed at some length in another thread in this forum.  Can someone confirm for me, however, that if I wanted to implement authentication aside from customer portal, I'd have to roll it more or less (or completely?) from scratch myself?

 

If so, are there any 3rd party libraries/AppExchange apps/Apex classes that facilitate that?  For example, session management (for sites), password hashing, checking for authentication bypass, etc...

 

Any insights are most welcome...

 

Thanks  in advance,

 

Alex

 

We have an application that can be published using OEM edition.   We are targeting companies with large numbers of users:

1)       Most will simply use our application “as is” – with built in reports, forms, capabilities

2)       Some would like to be able to create new reports, dashboards

3)       Some subset of users would like full CRM capabilities, such as available in PE or EE

 

Some questions:

1) Can we deploy for one organization where some users are using the fixed OEM product, others use a full featured Salesforce license, and together access shared information?   If not, is there a workaround (e.g., Salesforce to Salesforce) and what are the limitations?

2) If not, can we use a mix of platform edition and PE/EE licenses. Obviously more expensive.  What are the implications?

3) If an organization wants to extend the solution on their own – new reports, new fields – will users of the OEM product be able to take advantage of this?  If not, would Platform Edition provide these capabilities.

 

Thanks

I recently upgraded to the Winter 09 edition for the Force.com IDE.  I've completely uninstalled the previous version, followed the new installation instructions to the letter (I think!) and have successfully downloaded and installed the Winter 09 version.  However, when I try to create a new Force.com Project, I get the following error:

 

The selected wizard could not be started.  Reason:  Plug-in com.salesforce.ide.ui was unable to load class com.salesforce.ide.ui.wizards.project.ProjectCreateWizard.

 

I'm running on top of MyEclipse 6.0.1, which in turn is running on top of Eclipse Platform 3.3.3.r33x_r20080129.  I had no problems with the previous version of the IDE (Summer 08 I think).  Can anyone shed any light on what I may be doing wrong or need to do?

 

Thanks in advance!

 

Hi,

 

I'd like to have a 'configuration' object in my Force.com app--effectively mirroring the functionality of a properties or a configuration file that you'd have in a non-cloud app.  Conceptually, I could have a singleton object that contains fields that represent the various configuration attributes, modify this object via the standard UI, and read it to access its fields as necessary.

 

However, I'd like to avoid re-reading this object for every request (I know that I can read it once and have it be available via a static variable within the context of the same request).  Is there a way to somehow 'cache' it to make it available for multiple requests without having to re-read this (perhaps only re-reading it every so often)?  Is there a best practice or a Force.com design pattern to accomplish this?  Or is this not even necessary, because the overhead of reading a single object is trivial, due to the DB's own caching?

 

Thanks!

 

Alex

 

Hi,

I have the following code snippet in the managed package for our product:

  ...

List<Area__c> areaName = [Select Id,Name,eoSite__c from Area__c where eoSite__c = : m_project.Site_new__c ORDER BY Name];
  ...

    public List<SelectOption> getAreaOptions()
    {
        List<SelectOption> lstAreaOptions = new List<SelectOption>();
        for (Integer iRow = 0; iRow < areaName.size(); iRow++)
        {

            lstAreaOptions.add(new SelectOption(areaName[iRow].Id, areaName[iRow].Name));
        }
        return lstAreaOptions;
    }

...

When it gets executed in ONE of the orgs where we have our package installed, I get the following exception:

caused by: System.ListException: List index out of bounds: 1
Class.eo3.EditSubContract.getAreaOptions: line 266, column 58

This location corresponds to the line inside the 'for' loop above.  What I don't understand is, the way the code is written, it seems like you should NEVER receive an 'out of bounds' exception, since the list is never modified inside the loop.  The list, BTW, should only contain 1 entry, so it is true that if I tried to access entry at [1], I'd get an exception.  However, shouldn't the 'for' construct handle that?

The package is installed in many orgs; none of which have this problem.  In addition, it seems like the problem started happening about two weeks ago--without any package updates on our part.

So, I am usually the first one to roll my eyes when people say 'it's a bug in the platform', but I'm really not understanding what's happening in this case and how there could possibly be an 'out of bounds' exception in that code.  Has anyone seen anything like that?  Is there some caveat that I'm overlooking?

Going insane--please help!

Hello,

I am having some difficulty getting the Sites registration flow to work.  I have read the login setup instructions for both Sites and the Customer Portal, as well as the article about authenticating users on Sites.  We have implemented a custom SiteRegister form,and defined various access settings and profiles, but are not seeing the behavior we'd expect.  I'm sure it's our misunderstanding or operator error, but any insights on what we may be doing wrong would be much appreciated.
Setup
- Sites and Customer Portal enabled and configured in a Partner DE org
- Login settings for site set to 'Customer Portal'
- Active Site Home Page set to SiteRegister
- Self-registration settings for CP are set as follows:
  - Registration enabled
  - Default new user license: High-volume Customer Portal
  - Default new user profile: Custom profile 'P', based on High-volume Customer Portal profile
- VF page 'Public', as well as SiteLogin and SiteRegister pages, are enabled for:
  - the site
  - Guest profile
- VF page 'Private' is enabled for the HVCP profile 'P' above
- Page 'Public' links to page 'Private'
Expected behavior 
1. Navigate to 'Public'; click on link to 'Private'
2. Be presented with (redirected to) the login page for the site--SiteLogin (that presumably would also have a link to SiteRegister)
  a. Login and be redirected to 'Private'; OR
  b. Register and be redirected to 'Private'
Observed behavior 
1. Navigate to 'Public'; click on link to 'Private'
2. Redirected to a page that looks like the customer portal 'Home' page.  No additional prompts or error messages.
While I could very much allow that there are still bugs in the custom registration code, it doesn't seem like we're even getting that far, since we're never prompted to login or register.  So, I'm guessing it's a matter of getting the configuration right, but am honestly getting lost in the permutations of the config options.
Can any one offer hints for areas of further investigation?  (Of course, if you want to just come out and tell me what I'm doing wrong, that's fine as well!  :-)  )
Thank you in advance!
Alex

 

Hi there,

 

I'd like to customize the look of my Sites VF pages very slightly.  Specifically, I'd like to be able to control the background color of the section blocks.  I can do this via the 'tabStyle' attribute on either the 'page' or the 'pageBlock' tags, like this:

 

 

<apex:page showheader="false" sidebar="false" tabStyle="eoSite__c">
<apex:sectionHeader title="Test Section Title"/>
<apex:pageBlock mode="edit">
<apex:pageBlockSection title="Block Section"/>
</apex:pageBlock>
</apex:page>

 

 

This works fine when the page is rendered 'inside' SFDC proper, and I can change the look by changing the tab properties of my 'eoSite' custom object tab, but in the Sites context, it just uses the default Sites styles and colors.  I've read various articles for customizing look and feel of Sites pages, and know that I can upload a custom stylesheet and take almost total control over that, but that seems like such overkill for what I need to do.  I just want to change the silly block background colors!  :-)

 

So:

- Is there a simpler way to change the background color of the 'pageBlock' sections?

- If I'm stuck dealing with CSS, what is the minimum set of styles that I need to 'override' to accomplish the above?  (I've looked at the CSS files that are loaded by default, and there are a lot of styles and selectors there...  Plus, I'm not a CSS guru, so am hoping to avoid them, if at all possible.)

 

Thank you all in advance!

 

Alex

 

When I try to execute this code snippet:

 

String strVal = '';
List <String> lstVals = strVal.split(',');
System.debug ('***** List: ' + lstVals + ', size: ' + lstVals.size ());
for (String s : lstVals)
  System.debug ('***** List element [' + s + ']');

 

 

String strVal = '';

List <String> lstVals = strVal.split(',');

System.debug ('***** List: ' + lstVals + ', size: ' + lstVals.size ());

for (String s : lstVals)

  System.debug ('***** List element [' + s + ']');

 

I get the following output (some lines omitted for clarity:

 

15:24:15.186|USER_DEBUG|[3,1]|DEBUG|***** List: (), size: 1

15:24:15.186|USER_DEBUG|[5,3]|DEBUG|***** List element []

So, it seems that somehow I'm getting back an empty list of size '1'.  I would expect back a list of size 0, since there are no tokens in my string being split (it's an empty string).
Am I missing something, or is this a peculiar bug?  If so, is it a bug in 'split' or 'size'?
Thanks!

 

Hi,

 

I'm trying to get a seemingly simple workflow rule to fire, but, for the life of me, cannot.  Here's the setup:

- Object A (Project) has a text formula field, 'Application_Project__c', defined as follows:

IF ( CONTAINS($RecordType.DeveloperName, 'Application'),
"Yes",
"No"
)

 

- Object B has a Lookup to Object A (Project__r) and is trying to do a field update using the following, formula-based WF criteria:

Every time a record is created or edited

IF (CONTAINS (eo3__Project__r.eo3__Application_Project__c, "Y"), true, false)

 

I see that an instance of Object A correctly evaluates its formula field to "Yes".  I then save an instance of Object B and see the following in the System Log:

 

9:10:48.579|WF_CRITERIA_BEGIN|[Object-name a0NA0000002mbzz]|Mark Retrofit as Application|01QA0000000DBAA|ON_ALL_CHANGES
9:10:48.589|WF_FORMULA|Formula:IF (CONTAINS (eo3__Project__r.eo3__Application_Project__c, "Y"), true, false)|Values:eo3__Project__r.eo3__Application_Project__c=Yes
9:10:48.589|WF_CRITERIA_END|false

 

So, even though the field that I'm trying to base the comparison on is set to 'Yes', the WF evaluates to 'false'.  I've tried this with and without CONTAINS, with single quotes, double quotes, etc--but I can't seem to get the silly thing to evaluate to 'true' and for the WF to fire.  I don't know if it's something silly or if I'm missing something fundamental here.

 

Any ideas or insights will be greatly appreciated.  Thanks!

 

 I have a program feature that generates PDF documents via the standard Visual Force 'renderAs="PDF"' mechanism. This feature does not work reliably for 'larger' documents (i.e. 50 pages). By 'reliably' I mean that I can run PDF generation 10 times, and it will work successfully 3-5 times out of these 10. The rest of the time, after a 3+ min delay, I get the following error message:

"PDF generation couldn't complete because the request took too long. You are using components that are not fully supported by PDF generation, please consult the documentation for a list of unsupported components."

I've reviewed the page (it's a long and ugly beast, so am not posting it here), but am not seeing anything unsupported or suspicious.  This test can be run on the exact same object, with the exact same data, 10 times in a row, and the results are non-deterministic.   The fact that it works for some runs, but not others makes me suspect that this doesn't have to do with any specific page markup, but I could be wrong.

When I look at the system log output, I see that the controller code for this page is done after 12-15 sec. After that, there's a long delay--when the PDF is rendered successfully, the delay is about 30-40 sec. When it fails, as above, it is 3+ min.

It appears that something is making the PDF rendering engine go haywire, but I have not been able to figure out what it may be, and therefore, how to work around it.

If you have the system log open, you can see that the last statement from the controller (CODE_UNIT_FINISHED|StaticResourcePick <init>) is usually executed a long time before the CUMULATIVE_LIMIT_USAGE line. 

 

 

Does anyone have any ideas/suggestions?

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!

Hi,

 

I've recently discovered that the custom object name 'Site', with the API name 'Site__c' seems now to be used as a native SF object name (presumably since Sites went public).  I use this name in my application and now need to deploy it to another org.  Of course, I'm unable to transfer my custom Site__c object, because SF complains that the name already exists.

 

I have that name referenced in quite a few Apex classes and VF pages.  What is the most practical to go about resolving this?  I can think of a couple of ways:

 

Option 1 -- Try reusing the existing 'Site' object

- Temporarily remove all references to Site__c from all Apex and VF page files (How???  This sounds like it would be a pain.)
- Rename the site API name to 'azSite__c' (for example)

- Modify all of the Apex and VF page references to the old name ('Site__c') to reference 'azSite__c'

Advantages:
- Can keep existing Site data

Disadvantages:
- Temporily removing existing references sounds very painful


Option 2 -- Create and use a new 'Site' object

- Create a new site object with the API name 'azSite__c'
- Modify all of the Apex and VF page references to the old name ('Site__c') to reference 'azSite__c' (can do this by doing a global 'search and replace' on the local files in Eclipse, then saving files to Force.com)

Advantages:
- Simpler to implement than trying to modify existing object
Disadvantages:
- Lose existing Site data 

 

Are there other options that I'm overlooking? Can something be done with namespaces to avoid the conflict with the built-in name 'Site'?

 

Any suggestions would be greatly appreciated.

 

Thank you in advance!

 

Alex

 

Hi,

 

I'm hoping someone can offer some insights about class loading and object instantiation overhead in Apex.  Based on what I've seen in the docs, it appears that classes are loaded for each request context (which, for example, allows you to use static variables across different invocations in the same request).

 

Are classes really loaded for each request or are they cached?  How much overhead is associated with class creation in Apex.

 

For example, if I wanted to have a class of string constants, like this:

 

class MyStrings

{

  public static String STR_HELLO = "Hello";

  public static String STR_WORLD = "world";

}

 

and then access these strings from multiple other classes, like MyStrings.STR_HELLO, how much overhead would I be introducing, vs. just hard-coding the string ?

 

Is this described somewhere?  In general, is there any kind of a lower-level whitepaper or Apex architecture document that is available to shed some light on something like this?

 

Thanks in advance,

 

Alex

 

 

I have a simple VisualForce window that works fine in my DE org.  It is basically a shell that passes context via {!} expressions to a Flex swf file.  Here is the source in the DE org:

 

<apex:page standardController="A_R_Summary__c" sidebar="true" showHeader="true">
   
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="SliderGraphic" width="100%" height="100%"
          codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
    <param name="movie" value="{!$Resource.SliderGraphic}" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#869ca7" />
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="flashVars" value="arId={!A_R_Summary__c.account__r.id}&arDate={!A_R_Summary__c.Date__c}&accountId={!A_R_Summary__c.id}" />
    <embed src="{!$Resource.SliderGraphic}"
           width="100%"
           height="300"
           quality="high"
           bgcolor="#869ca7"
           name="SliderGraphic"
           align="middle"
           play="true"
           loop="false"
           quality="high"
           allowScriptAccess="sameDomain"
           type="application/x-shockwave-flash"
           pluginspage="https://www.adobe.com/go/getflashplayer"
           flashVars="arId={!A_R_Summary__c.account__r.id}&arDate={!A_R_Summary__c.Date__c}&accountId={!A_R_Summary__c.id}">
    </embed>
  </object>
</apex:page>

 

Problems occur when I install it in another org.  The controller reference is updated with the namespace, but the {!} references are not.  The page cannot render and generates the error:


Unknown property 'testdfc1__A_R_Summary__cStandardController.A_R_Summary__c'

Here is the page in the installer org:

 

<apex:page standardController="testdfc1__A_R_Summary__c" sidebar="true" showHeader="true">



<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="SliderGraphic" width="100%" height="100%"

codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">

<param name="movie" value="{!$Resource.SliderGraphic}" />

<param name="quality" value="high" />

<param name="bgcolor" value="#869ca7" />

<param name="allowScriptAccess" value="sameDomain" />

<param name="flashVars" value="arId={!A_R_Summary__c.account__r.id}&arDate={!A_R_Summary__c.Date__c}&accountId={!A_R_Summary__c.id}" />

<embed src="{!$Resource.SliderGraphic}"

width="100%"

height="300"

quality="high"

bgcolor="#869ca7"

name="SliderGraphic"

align="middle"

play="true"

loop="false"

quality="high"

allowScriptAccess="sameDomain"

type="application/x-shockwave-flash"

pluginspage="https://www.adobe.com/go/getflashplayer"

flashVars="arId={!A_R_Summary__c.account__r.id}&arDate={!A_R_Summary__c.Date__c}&accountId={!A_R_Summary__c.id}">

</embed>



</object>



</apex:page>

 

 

As you can see, the controller attribute is updated to include the namespace, but the other references are not.  If I attempt to manually prefix these {!} references in the DE org with the namespace, I cannot save the file.

 

Can someone help me?  Thanks!

 

Dave

 

  • May 12, 2009
  • Like
  • 0

Hi All,


I'm the Product Manager for packaging here at salesforce.com.  We're currently working on a feature that would allow fields and objects to be removed from managed packages.  This is a popular request and something we're hoping to deliver very soon, but we need your help.  Please respond to this post with any thoughts around this topic.  I've included a few questions to get the conversation going:


  • Why do you want to remove these?  No longer used?  Customers didn't like them?  Replace with a new field?
  • When you deprecate a field/object, what should happen for existing customers?  New customers?
  • Would you have to remove all usage of a field/object in your app before you can deprecate it?  What happens if you've included the field in another formula field, etc?  
Thanks for your time and input!
Message Edited by A_Smith on 02-20-2009 05:55 PM