• cic
  • NEWBIE
  • 75 Points
  • Member since 2007

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 31
    Replies

I have a Visualforce page that was working when it was a part of an unmanaged package, but when I created a managed package and its required namespace (CI) the page quit working and now displays the following error whenever I click on the button to call it:

 

Invalid field RA_Matched_Account__c for SObject CI__INOW_Reported_Account__c

 

The custom button is using a Content Source of a Visualforce Page.  The RA_Matched_Account__c field is being used to determine whether or not to display a warning message if the field has a value.

 

<!-- Display a warning message if the Reported Account has already been matched -->

<h1>

<apex:pageMessage summary="This Reported Account has already been matched, if you continue 

            your new Account will overwrite the existing one!" severity="warning" strength="3" 

            rendered="{!RepAcct.RA_Matched_Account__c!=''}" />

        </h1> 

 

Obviously the field does not have the CI namespace before it's name, but that is not for a lack of trying (every time I save the CI__ is stripped out).  The getRepAcct method is using fields with the CI namespace, althought it doesn't matter if I have them there or not, the result is the same.

 

public CI__INOW_Reported_Account__c getRepAcct() {

repAcctInfo = [select Id, Name, CI__RA_Street1__c, CI__RA_City__c, CI__RA_StateProv__c, 

CI__RA_Postcode__c, CI__RA_Country__c, RA_Matched_Account__c

from CI__INOW_Reported_Account__c 

where id = :cid];

 

return repAcctInfo;

} 

 

 I have tried everything I can to resolve this issue, but no matter what I do I continue to receive this same error message since creating the namespace.

 

Thanks in advance for any help! 

The Visualforce developer's guide, p. 126, describes how to use a custom controller in the context of a VF email template by referencing a custom component from the email template. In the example in the doc, the custom component's controller does a query for all Acounts with a name like 'Smith%.' What if I'd like to pass the name (or any other value) into the component as an attribute -- or, in my case, pass in an ID that the controller should query for?

 

I've tried this:

<apex:component controller="Component_Controller" access="global">

<apex:attribute name="myId" type="String" description="The ID" assignTo="{!myId}" />

<pre>
myId = {!myId}

dbg = {!dbg}
</pre>

</apex:component>

My controller looks like this:

public class Component_Controller {

public String dbg {get;set;}
public String myId;

public Component_Controller() {
dbg = '';
dbg += '===== constructor: myId= ' + myId+ '\n';
}

public void setMyId(String str) {
dbg += '===== setmyId(' + str + ')\n';
myId= str;
}
}

 The email template refers to the component in the usual way:

<messaging:attachment renderAs="PDF" filename="Test">
<c:MyComponent MyId="{!RelatedTo.Opportunity__c}" />
</messaging:attachment>

When the email is generated, the attachment shows that the page has a valid value for MyId, but the controller never seems to get it. When the constructor adds to the dbg value, MyId is null. The dbg value shows that MyId's setter doesn't get called. 

 

I would add 'required="true"' to the attribute definition, but that's apparently not allowed if the component is defined with access="global," and global access is required for components called from an email template.

 

My bottom-line problem is that I need to send an email message from a trigger where the email contains a PDF with content that is so complex that I need a controller to help construct it.  I've created a regular VF page that contains the PDF, but I can't render the page's content from within a trigger -- a PageReference object's getContent() and getPDFContent() methods don't work from within a trigger (see Calling getContent() from a trigger). And I've tried using a simple PDF attachment without a custom component inside the template, but I can't get to the data I need (see this). I'm really stuck -- I'd appreciate any suggestions!

 

Thanks.

 

 

 

 

 

 

  • February 11, 2010
  • Like
  • 0

Hi,

 

I am following this tutorial - http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_hello_world.htm

 

I don't seem to be able to find create page link and page editor at the footer of the page.

 

I am on enterprise edition and I had the developer mode enabled.

 

Please can someone help?

 

Thanks, 

  • February 10, 2010
  • Like
  • 0

With new projects we have, we are looking to take on a new Force.com developer.  This will be a full time role.  It will be to support and further develop our range of HR software on the Salesforce platform.    Our customers are UK and US based.  The work will be based from our Reading, UK office.

 

Essential skills:-

    Object oriented development using either C#, Java or equivalent.

    Web-based development as a programmer.

    Experienced with HTML/CSS/Javascript client-side development.

    Education to university level

    Happy to work in a small team and happy to do some 2nd or 3rd line support where needed.

 

Ideal skills:-

    Force.com developer – we will cross-train if needed, but must have capability to get Advanced force.com certified.

    Experience of HR, payroll or recruitment

 

Email to apply@fairsail.com quoting VN006 in the subject line and attaching your CV/resume in Word, RTF or PDF format.

  • March 16, 2011
  • Like
  • 0

We are getting a problem querying chatter feeds in Apex.  At sporadic times we get an error page:-

 

"Unable to Process Request

Concurrent requests limit exceeded.

To protect all customers from excessive usage and Denial of Service attacks, we limit the number of long-running requests that are processed at the same time by an organization. Your request has been denied because this limit has been exceeded by your organization. Please try your request again later.".

 

 

If we take out the query to NewsFeed or Object__Feed then it all works fine.  With those queries we get the sporadic error.  Once the error appears then all subseqent queries to NewsFeed fail for about 30 minutes.  After that the queries start working again.

 

Note that we are not using any Webservice or API calls etc.  The queries are in vanilla Visualforce controllers in Apex.  No Ajax callback or anything like that.   The error happens whether or not we use Eclipse to develop.

 

We only first noticed this since summer 10 went live, but that could be a coincidence as the app is being actively developed.

 

Anyone else have this problem?  Even better, a cure?  Or is this an SFDC bug?

 

 

 

 

  • June 12, 2010
  • Like
  • 0
Is it possible to use a custom component within a repeating part of a Visualforce page (table, repeat, pageBlockList etc) where it needs part of the repeat variable passed to the component?
 
 
Component myComponent:
<apex:component>
<apex:attribute name="myValue" description="Value to show" type="String"/>
<apex:outputText value="{!myValue}"/>
</apex:component>
Part of page:
           <apex:pageBlockSection title="Test Section" columns="1">
                <apex:pageBlockList value="{!myData}" var="record">
   <apex:column headerValue="Sample"><c:myComponent value="{!record.Name}"/></apex:column>
         </apex:pageBlockList>
           </apex:pageBlockSection>

 
in the page controller I link up GetMyData to return a custom object.
 
The page code fails compile with a mesage: Unknown property 'MyController.record'.
 
The controller and page all work since I can get the page to work fine without the customer component.
 
Is there is restriction on using custom components in repeating structures?  Or is this a bug?
 
 
  • April 22, 2008
  • Like
  • 0
Old releases of the Apex Code authoring in Eclipse used to show line numbers of errors in code when compiling / saving back to the server.   The latest release no longer does this.  Some errors (e.g. missing ";") take a long time to track down in big chunks of code.
 
Can you put it back in in the next release? 
  • November 30, 2007
  • Like
  • 0
Getting a "the metadata is invalid - delete your class or contact support" message when recompiling an Apex Code class.
 
I reported this a few weeks ago but I have more information.  The problem is still there with the latest Eclipse add-in.  I also get the same message if editing code through the web interface.
 
The problem occurs if you have a class that is global and contains webservice methods or attributes.  It is an intermittant problem, however certian things seem to make it more likely to happen:
 
   1. if you change the type of one of the webservice methods or attributes.
   2. if you have lots of webservice methods or attributes in a class.
   3. if you have two of such a classes featured in 1 and 2 where one classes uses the other class for its function.
I've had situations where the second recompile of a class will almost always cause this fault.  The first works and the code runs.  Any change to the class (or even recompile without a change) causes the metadata invaid error.
 
The only fix I've found that works is to delete the class and recreate it straight away from a copy-pasted peice of code.
 
The problem seems equally bad in both Eclipse and through the web.
 
Thanks.
  • November 08, 2007
  • Like
  • 0
public class A {
    public void MethodA() {
         /*do something*/
         B.MethodB();
  }
}
 
public class B {
  public methodB() {
       /*do something else*/
       A.MethodA();
  }
}
 
NB These two classes are in seperate files so complied seperately.
 
Not a very useful bit of code - but one that illustrates a question.  Is this type of thing allow in Apex?  There are more useful examples I could give and it is a very useful construct.  Without it you have to be careful to design classes in a strict hierarchy.
 
If you try it you find that the compiler will allow it.  The classes will run and work.  You get a problem if you try to deploy it or if one of the classes is detected as needing recompilation on use.   The underlying Apex Code system does not seem to recognise mutual dependancy - only strict tree-like dependancies.  Deployment or recompilation of such structures frequently fail.
 
Is it intended that Apex Code supports this?  If so can the compiler / dependency checker be made to work?  It is a useful structure to permit.  Thanks.
 
 
 
 
 

Message Edited by cic on 11-08-2007 10:57 PM

Message Edited by cic on 11-08-2007 11:06 PM

  • November 08, 2007
  • Like
  • 0
I have started getting the following message with increasing frequency:
 
"Severity and Description Path Resource Location Creation Time Id
Compilation error: Problem with the existing metadata for this class, try deleting the class first or contact support Fairsail Develop/Apex Classes CompetencyAssessment.cls line 1 1192792313859 4150"
The cure is to delete the class and paste it back in again.  This is getting to be a hastle since it sometimes happens on almost any change to a class source.  It doesn't just happen with one class - several have done it.  I can't spot a pattern as to when it occurs.
 
What is causing it?
 
How can I avoid it?
 
If it is a bug can it be fixed?
 
 
  • October 19, 2007
  • Like
  • 0
I have a set of Apex Code.  It references various custom objects.  I want a low-level user profile to be able to access those Apex Code classes.   One of the custom objects is marked as not accessible by that profile (it contains my system config data).  The user cannot use any of the Apex Code classes because one of the dependant classes references the hidden custom object.
 
This seems to violate the Apex Code design principal that the Apex Code writer is resonsible for security of objects i.e. the code all runs at the system administrator level of priviledge.  The code would run if it would compile.  It drops out with an Exception because it can't compile the dependant class.  The only way I can get it to work is to switch on Read access to that custom object in the profile.
 
As a side query on this I'm not sure why the code is compiling?  It says it is because one of the dependant classes is invalid.  However I've tried recompiling them all as a system administrator and trying again.  I still get the same error message.  Does Apex Code compile every time a user calls it.
 
PS The Apex Classes are being called via AJAX and webservice methods.  I've enabled the class-level security of those to all profiles.
 
 
  • October 19, 2007
  • Like
  • 0
Eclipse uses lots of API calls - particularly when refreshing.  We frequently hit the 5000 API calls per day because of this.  It appears that you get at least one API call per file refreshed.
 
We have a team of 3 developers working on about 200 triggers, sobjects and classes.  As our development continues this will get worse.  We are hitting the ceiling more and more often.  When it happens we have to wait 24 hours.
 
Any plan to make the API call usage less?  Or raise the 5000 API call limit? 
  • September 06, 2007
  • Like
  • 0

Fairsail are developing a range of HR applications natively on the Salesforce platform.  Version one launches at Dreamforce in 2 weeks.  We are going on to extend this application (and bulid new ones).

 

Our ideal candidate should have:

- Excellent programming experience with C# or Java

- A depth of experience with web based development

- An ability to write well structured object oriented code.

- Ideally some experience of HR software

 

You will be coding in Apex, Scontrols, custom objects with triggers and the SF platform i.e. deep into the SF internals.

 

You MUST be resident in either the UK or SF Bay Area.  Flexible working arrangements encouraged.

 

Email resume to jobs@fairsail.com or come and see us on booth#214 @ Dreamforce.  Company info @ www.fairsail.com


  • September 04, 2007
  • Like
  • 0
I'm using the Eclipse toolkit to deploy to another SF account.  Not all my classes are being picked up in the list of items to deploy?  Three are missing.   They compile OK.  They all pass the tests with sufficient code coverage for classes and triggers.  What else might make them missing from the deploy list?
 
Note the new account has no code installed - but does have all required custom objects etc.
 
 
 
 
  • September 01, 2007
  • Like
  • 0
When compliing the following code:
 
String test = 'test';
Integer len = test.length;
 
I get a compile error on the second line "Initial term of field expression must be an SObject: String".
 
Why can't I use the string length attribute?
 
 
  • September 01, 2007
  • Like
  • 0
If you delete a project on Eclipse, using the new version of the toolkit, it will delete all the triggers and classes from the Salesforce developer account.  It gives no warning - just asking if you want to delete the local copy of the files.   It does leave the scontrols.
 
Watch out - we had a scarey few hours recovering from that one.  The older version of the kit didn't do that.
 
Also "rename" doesn't rename - it deletes instead!!!!
 
 
  • August 24, 2007
  • Like
  • 0
1. How can we package Apex code with an app on Appexchange?
 
2. If so which editions could install such an app?
 
3. If not how can we use Apex in an Appexchange app?
 
 
  • August 19, 2007
  • Like
  • 0
We are building a new HR / Performance Management / Talent Management system on the salesforce.com platform.  We need developers and support people to both build the initial application and then grow and deliver it on a worldwide basis.  Here is a chance to join an exciting new company from the early stages.
 
The company is based in the UK at Reading and London.  However we will work with remote people if you have the right motivation.  Our customers will be worldwide.  Flexible working hours an advantage.
 
Experience of the Salesforce development platform is required for the developers (advanced SControls,  structured SObjects, APEX triggers etc.).  Experience of working with HR systems will be a distinct advantage.  For support people experience of HR and the administrative parts of Salesforce is required.
 
Email jobs@fairsail.com with your CV.
  • June 08, 2007
  • Like
  • 0

All out DEs and our PE have been upgraded to Spring '10 but our client is still on Winter '10. We need to release a new package version to them but the deployment fails saying that a Spring '10 package can't be deployed to a Winter '10 org. Seems reasonable but this means that we can't release new features they require and the latest announcement says that it might be March until we can. This will cause them significant issues.

 

What are our options?

 

Can we get our DEs and PE rolled back to Winter '10 (or is there a plan to roll everyone back to Winter '10 if there is an issue with Spring)? Can we have this block overridden as we're not using any Spring '10-specific features yet?

I have a Visualforce page that was working when it was a part of an unmanaged package, but when I created a managed package and its required namespace (CI) the page quit working and now displays the following error whenever I click on the button to call it:

 

Invalid field RA_Matched_Account__c for SObject CI__INOW_Reported_Account__c

 

The custom button is using a Content Source of a Visualforce Page.  The RA_Matched_Account__c field is being used to determine whether or not to display a warning message if the field has a value.

 

<!-- Display a warning message if the Reported Account has already been matched -->

<h1>

<apex:pageMessage summary="This Reported Account has already been matched, if you continue 

            your new Account will overwrite the existing one!" severity="warning" strength="3" 

            rendered="{!RepAcct.RA_Matched_Account__c!=''}" />

        </h1> 

 

Obviously the field does not have the CI namespace before it's name, but that is not for a lack of trying (every time I save the CI__ is stripped out).  The getRepAcct method is using fields with the CI namespace, althought it doesn't matter if I have them there or not, the result is the same.

 

public CI__INOW_Reported_Account__c getRepAcct() {

repAcctInfo = [select Id, Name, CI__RA_Street1__c, CI__RA_City__c, CI__RA_StateProv__c, 

CI__RA_Postcode__c, CI__RA_Country__c, RA_Matched_Account__c

from CI__INOW_Reported_Account__c 

where id = :cid];

 

return repAcctInfo;

} 

 

 I have tried everything I can to resolve this issue, but no matter what I do I continue to receive this same error message since creating the namespace.

 

Thanks in advance for any help! 

According to the documentation you should be able to create a map of Id or String to SObject from a list of sObjects and Database.query() returns a list of sObjects.   However, the following code will not compile/execute:

Map<Id, sObject> accounts = new Map<Id, sObject>( Database.query( 'SELECT Id FROM Account LIMIT 5' ) );

Also, map.putAll() should work similarly but gives the same error message.   Example of broken code:

Map<Id, sObject> accounts = new Map<Id, sObject>();
accounts.putAll( Database.query( 'SELECT Id FROM Account LIMIT 5' ) );

It looks like the map constructor and putall are expecting a list of explicit object types, not generic sObjects.  According to the documentation, a generic sObject list should work.

See the definition of Map.putAll() here:

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_map.htm

It states:

If the map is of IDs or Strings to sObjects, adds the list of sObject records l to the map in the same way as the Map constructor with this input.

 

Actually, with further testing it doesn't appear that I can get putAll() to work at all on a map of Id to sObject whether the input is a list of explicit types (say List<Account> ) or a list of sObjects.

  • February 11, 2010
  • Like
  • 0

The Visualforce developer's guide, p. 126, describes how to use a custom controller in the context of a VF email template by referencing a custom component from the email template. In the example in the doc, the custom component's controller does a query for all Acounts with a name like 'Smith%.' What if I'd like to pass the name (or any other value) into the component as an attribute -- or, in my case, pass in an ID that the controller should query for?

 

I've tried this:

<apex:component controller="Component_Controller" access="global">

<apex:attribute name="myId" type="String" description="The ID" assignTo="{!myId}" />

<pre>
myId = {!myId}

dbg = {!dbg}
</pre>

</apex:component>

My controller looks like this:

public class Component_Controller {

public String dbg {get;set;}
public String myId;

public Component_Controller() {
dbg = '';
dbg += '===== constructor: myId= ' + myId+ '\n';
}

public void setMyId(String str) {
dbg += '===== setmyId(' + str + ')\n';
myId= str;
}
}

 The email template refers to the component in the usual way:

<messaging:attachment renderAs="PDF" filename="Test">
<c:MyComponent MyId="{!RelatedTo.Opportunity__c}" />
</messaging:attachment>

When the email is generated, the attachment shows that the page has a valid value for MyId, but the controller never seems to get it. When the constructor adds to the dbg value, MyId is null. The dbg value shows that MyId's setter doesn't get called. 

 

I would add 'required="true"' to the attribute definition, but that's apparently not allowed if the component is defined with access="global," and global access is required for components called from an email template.

 

My bottom-line problem is that I need to send an email message from a trigger where the email contains a PDF with content that is so complex that I need a controller to help construct it.  I've created a regular VF page that contains the PDF, but I can't render the page's content from within a trigger -- a PageReference object's getContent() and getPDFContent() methods don't work from within a trigger (see Calling getContent() from a trigger). And I've tried using a simple PDF attachment without a custom component inside the template, but I can't get to the data I need (see this). I'm really stuck -- I'd appreciate any suggestions!

 

Thanks.

 

 

 

 

 

 

  • February 11, 2010
  • Like
  • 0

Hi,

 

I am following this tutorial - http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_hello_world.htm

 

I don't seem to be able to find create page link and page editor at the footer of the page.

 

I am on enterprise edition and I had the developer mode enabled.

 

Please can someone help?

 

Thanks, 

  • February 10, 2010
  • Like
  • 0

 So spring 10 is out but we still don't see any option to package standard action overrides.

 

The partner developer org that we are using to create our managed package is on na7 and i do see AnswersNew! and Translation WorkbenchNew!

 

We even created a new package this morning, just to check if the standard action overrides are being packaged implicitly.

 

Still no luck.

 

Do i need to raise a case in partner portal or am i missing something obvious?

 

 

  • February 08, 2010
  • Like
  • 0

Spring 10 was released on my instance Friday, and my time-based workflows have been failing since.  I came in this morning to 300 emails stating which ones failed and an "Error Number" but no error message.  I have already opened a case, but it'll be days (and hundreds more records to fix) before Tier II gets back to me.  Anyone have any time-based workflows working who is using Spring 10 release?  Any SF Employee want to translate that error number into an error message for me please? Any ideas?

 

Email Subject: Salesforce.com workflow could not perform a pending action

Details:
Object Type: Opportunity
Record: XXXXXXXXXXXXXXXX-BS-121997

Workflow Rules attempted: Create Task: Follow Up or Adjust Close Date

Workflow Actions attempted: Follow Up or Adjust Close Date

Error Number: 1991919676-60 (1275087062)
Date: 8 Feb 2010 05:01:15 GMT

Is there a way to query for a particular user's "Recent Items" list?

 

That is, I want to be able to fetch a list of the last several records of a particular object that a particular user has viewed.

 

Thanks

I need to catch all inbound and outbound email in SF.

 

Yesterday, I found an option "Email to Salesforce" - anybody knows how can  it help or may be propose another solution?

Hi all,

I am trying to find out if there is a way to integrate google gadgets aka opensocial gadgets into salesforce. The gadget complies with opensocial specificiation which require an opensocial container to run. And for authentication and authorization purposes, I would be using SAML SSO and OAuth so that the gadget could pull data from my servers while running within the container application, which would be salesforce in this case.


The only gadget i found was

http://sites.force.com/appexchange/listingDetail?listingId=a0N300000016bafEAA

Once installed , this gadget was available as s-control and i could add it to my dashboard, but no user preferences were saved. My case would be a bit more complex one, with some amount of user preferences, security and authentication aspects involved(think userprefs in opensocial, SAML and OAuth).


I would like to know how i could make my opensocial gadget available for my customers who are using salesforce, is it packaging? . Is it that i need to submit my application to appexchange, or is there an api(url) with which i could have the user install my gadget deployed at an external url?


Is there a way I could follow the "develop once - publish multiple" philosophy.


Thanks in advance.

Best Regards,
Hafiz
Code:
<apex:page Controller="testController">
<apex:tabPanel switchType="ajax" id="theTabPanel">
<apex:repeat value="{!stringList}" var="astring" id="theRepeat">
<apex:tab label="{!astring}">
</apex:tab>
</apex:repeat>
</apex:tabPanel>
</apex:page>



Code:
public class testController {

String[] ss;
public String[] getStringList() {
return ss;
}

public testController() {
this.ss = new String[]{'a', 'b', 'c'};
}

}


I want to create a variable number of tabs with repeat statement. The code above doesn't work...Any work arounds anyone can think of?



 

 
    Hi,

Is it possible to call Apex code When a work flow is triggered?

Any help would be very much appreciated.

Thanks in advance.

Naresh.T


What's the best way to use users in unit tests?  You can't create temporary users in apex code for unit tests because they are a 'setup entity'.  Should you hardcode some users that are in the system and hope they don't change in the future and break your unit tests?  Should you select the top N users from the user list and just use whoever is returned everytime?
If I build an App on Force.com, my understanding is that the code is visible to anyone who downloads the application.

Any way of protecting the IP you create?