• PaulDyson
  • NEWBIE
  • 55 Points
  • Member since 2009

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 12
    Replies

My deploy from Ant failed this morning to a new "Developer Edition" org with this error; I have a few custom fields added to the User object. This deployment has been working fine and is run very frequently because we use continuous integration.

 

Does anyone have insight into this error?

 

Thanks,

Keith

Hi,

 

I am having problems with System.assertEquals method not working in my test method. This is the trigger and the class with testmethod:-

 

 

trigger NoOfEmployeesTrigger on Account (before insert, before update) 
{
if(Trigger.isInsert)
{
Account[] accs = Trigger.new;
for(Integer i=0; i<accs.size(); i++)
{
if(accs[i].name.contains('19'))
{
accs[i].NumberOfEmployees = 25;
}
else
accs[i].NumberOfEmployees = 75;
}
}

if(Trigger.isUpdate)
{
Account[] accs = Trigger.new;
for(Integer i=0; i<accs.size(); i++)
{
if(accs[i].name.contains('19'))
{
accs[i].NumberOfEmployees = 25;
}
else
accs[i].NumberOfEmployees = 75;
}
}
}
 public class NoOfEmployeesClass
{
static testMethod void NoOfEmployeesTest()
{
Account acc1 = new Account(name = 'Vim_19Jun_acc1');
Account acc2 = new Account(name = 'Vim_20Jun_acc2');

test.startTest();
insert acc1;
insert acc2;

System.assertEquals(25, acc1.NumberOfEmployees);
//System.assertNotEquals(acc2.NumberOfEmployees, 25);

acc2.name = 'Vim_19Jun_acc2';
update acc2;

test.stopTest();
}
}

The Number of employees field is a number field and it is giving error there under Test failures section:-

 

Method Name
Total Time (ms)
Message
Stack Trace
NoOfEmployeesClass.NoOfEmployeesTest126.0System.Exception: Assertion Failed: Expected: 25, Actual: nullClass.NoOfEmployeesClass.NoOfEmployeesTest: line 12, column 3

 

 

However, if I remove the method the test method works successfully giving 100% code coverage.

 

Please assist!

 

Thanks,

 

Vimal

We have a piece of code that has been unchanged for months that has stopped working; not entirely sure when. It's very simple:

 

<apex:outputPanel layout="none" rendered="{!showEmailLink}">

  <apex:commandlink action="{!mailToMe}" styleClass="mail_link" oncomplete="mailConfirmation()" rerender="dummyPanel">

    <apex:param name="documentId" assignTo="{!documentId}" value="{!document.Id}"/>

    <apex:image value="{!URLFOR($Resource.Singletrack, '/images/mail.gif')}" styleClass="mailto_icon" />

  </apex:commandlink>

</apex:outputPanel>

 

The problem seems to be that the mailToMe method is never called. Firebug doesn't report any script errors but also shows that there is no call being made to the server.

 

Any ideas?

Is it possible to exclude certain fields from SOSL searches. We are using SOSL to search custom objects and want all fields to be search bar one. That one contains an external reference, many of which happen to contain pairs of letters (CD, BA and so on) that also happen to be common search terms, leading to spurious results.

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 an HTML formatting error appearing on a Sites login screen. The problem appears to be due to the Visualforce compiler setting a warning because of badly formatted HTML as described in this thread: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=17009. However, the poor HTML formatting is deliberate in order to be able to do conditional inclusion of styles sheets, as described in this thread: http://community.salesforce.com/sforce/board/message?message.uid=146753.

 

Is there a way either to do conditional inclusion of style sheets without bad HTML formatting or else to ensure that the <apex:messages> tag doesn't display HTML warnings?

I have a very odd problem with some dml code. I have a form on a Sites site which creates Leads. The submit action of the form is just halting when I come to insert the new Lead; no exception is thrown and no further processing takes place. A code snippet:

 

try {

Lead l = new Lead(LastName = 'foo', Company = 'bar', Status = 'Open - Not Contacted'); 

Database.insert(l,false);

System.debug('Lead saved'); 

} catch (Exception e) {

System.debug('Exception caught');

  System.debug(e);

} 

 

Neither 'Lead saved' nor 'Exception caught' appears in the debug log, the log just ends:

 

 

20090822071712.927:Class.SitesLoopBlog.WebFormController.saveObject: line 96, column 14: Insert: SOBJECT:LeadCumulative profiling information:

 

And I get the dreaded Authorization Required page. Any ideas?
Just set up our first production site but, having set the active flag, all I get is a 'Can't find the server "mydomain.force.com"' message. For Developer Edition sites setting the active flag is instantaneous; I can immediately see the site via its public URL. Are there additional checks/approvals that have to be made for production sites and, if so, how long do they take?

I've set up a sample feed using the example in the Introduction to Force.com Sites article. When I click the preview link all I see is a blank area on the preview page and clicking the external URL brings up an 'under construction' page.

 

Also I don't really understand how the definition field works. Does anyone have an example of an RSS definition? 

This is strange ...

 

I'm trying to test some custom sharing code. Manually the code all works fine. However, when I run it under test, I get a System.SObjectException: Field is not writeable: Chatroom__Share.RowCause exception.

 

The code is running without sharing so it shouldn't be anything to do with the permissions of the user (although I've manually tested using the same profile as the test user used in the runAs() method).

 

Any ideas? 

Creating a few users in my tests but getting a license limit exceed exception. This is a pain as I have a couple of test users for manual testing and a few more for automated testing. Do users created in tests really count towards license limits or am I just doing something wrong?

Sorry if this is a dumb question ... I'm a beginner with VisualForce and searching hasn't turned anything up.

 

I have a list of objects I want to render but I also want to highlight a particular value as the 'current selection' (i.e. give it a different class to the other elements). This is easy with JSTL: use a foreach tag to iterate over the collection and an if...test tag to check whether the value is the one I want to highlight. Obviously I can use dataList or repeat to iterate over the collection but I can't see any equivalent to if...test. 

 

Any ideas? I can do it with Javascript but that seems very hacky. 

Is there any way to detect user login or logout event within Apex and attach code to it (e.g. a trigger on some aspect of the User object)?

 

TIA 

My deploy from Ant failed this morning to a new "Developer Edition" org with this error; I have a few custom fields added to the User object. This deployment has been working fine and is run very frequently because we use continuous integration.

 

Does anyone have insight into this error?

 

Thanks,

Keith

My packaging org was upgraded to Summer '10 this past weekend.  Since that happened I am unable to deploy classes to the packaging org.  I consistently get an error "An unexpected error occurred.  Please include this ErrorId if you contact support: 1478925739-55 (-210895607).

 

Has anyone else seen this and do you have any idea how to get around the problem?  I have tried saving class files individually, deploying with the IDE and using the migration tool

I noticed this entry on the Spring '10 Preview website: http://developer.force.com/releases/release/Spring10/Authenticated+Website+User

 

Sounds intriguing - I assume this means we can allow public, non-portal site users to create user accounts and authenticate.

 

I kicked around a Spring 10 pre-release org and see the profile type there, but I cant do much with it.

 

Anyone have details around this new user type? Also, what's the pricing structure going to be? The portal pricing structure has been the main reason why we haven't been able to move ahead with creating authenticated Force.com sites. Hope this changes things... 

  • January 18, 2010
  • Like
  • 0

I have a very odd problem with some dml code. I have a form on a Sites site which creates Leads. The submit action of the form is just halting when I come to insert the new Lead; no exception is thrown and no further processing takes place. A code snippet:

 

try {

Lead l = new Lead(LastName = 'foo', Company = 'bar', Status = 'Open - Not Contacted'); 

Database.insert(l,false);

System.debug('Lead saved'); 

} catch (Exception e) {

System.debug('Exception caught');

  System.debug(e);

} 

 

Neither 'Lead saved' nor 'Exception caught' appears in the debug log, the log just ends:

 

 

20090822071712.927:Class.SitesLoopBlog.WebFormController.saveObject: line 96, column 14: Insert: SOBJECT:LeadCumulative profiling information:

 

And I get the dreaded Authorization Required page. Any ideas?
Just set up our first production site but, having set the active flag, all I get is a 'Can't find the server "mydomain.force.com"' message. For Developer Edition sites setting the active flag is instantaneous; I can immediately see the site via its public URL. Are there additional checks/approvals that have to be made for production sites and, if so, how long do they take?

I've set up a sample feed using the example in the Introduction to Force.com Sites article. When I click the preview link all I see is a blank area on the preview page and clicking the external URL brings up an 'under construction' page.

 

Also I don't really understand how the definition field works. Does anyone have an example of an RSS definition? 

Hi,

 

I am having problems with System.assertEquals method not working in my test method. This is the trigger and the class with testmethod:-

 

 

trigger NoOfEmployeesTrigger on Account (before insert, before update) 
{
if(Trigger.isInsert)
{
Account[] accs = Trigger.new;
for(Integer i=0; i<accs.size(); i++)
{
if(accs[i].name.contains('19'))
{
accs[i].NumberOfEmployees = 25;
}
else
accs[i].NumberOfEmployees = 75;
}
}

if(Trigger.isUpdate)
{
Account[] accs = Trigger.new;
for(Integer i=0; i<accs.size(); i++)
{
if(accs[i].name.contains('19'))
{
accs[i].NumberOfEmployees = 25;
}
else
accs[i].NumberOfEmployees = 75;
}
}
}
 public class NoOfEmployeesClass
{
static testMethod void NoOfEmployeesTest()
{
Account acc1 = new Account(name = 'Vim_19Jun_acc1');
Account acc2 = new Account(name = 'Vim_20Jun_acc2');

test.startTest();
insert acc1;
insert acc2;

System.assertEquals(25, acc1.NumberOfEmployees);
//System.assertNotEquals(acc2.NumberOfEmployees, 25);

acc2.name = 'Vim_19Jun_acc2';
update acc2;

test.stopTest();
}
}

The Number of employees field is a number field and it is giving error there under Test failures section:-

 

Method Name
Total Time (ms)
Message
Stack Trace
NoOfEmployeesClass.NoOfEmployeesTest126.0System.Exception: Assertion Failed: Expected: 25, Actual: nullClass.NoOfEmployeesClass.NoOfEmployeesTest: line 12, column 3

 

 

However, if I remove the method the test method works successfully giving 100% code coverage.

 

Please assist!

 

Thanks,

 

Vimal

Creating a few users in my tests but getting a license limit exceed exception. This is a pain as I have a couple of test users for manual testing and a few more for automated testing. Do users created in tests really count towards license limits or am I just doing something wrong?

My Visual force page is using custom components created in the same org. Till yesterday the page was working fine but all of sudden today I am getting this error when I open this page.

 

Tag Library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: attribute

 

 

Another trivial but strange thing thats happening is that, I can't open a component in view mode. On trying to view the component from Setup > Develop > Components. Following salesforce error comes, though we can edit the component :)

 
An internal server error has occurred An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact support@salesforce.com. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using Salesforce!

Error ID: 299154357-472 (-607383983)

 

I am getting couple of these wierd errors recently, like I get same error on "Run All Tests".

 

Does this means that latest salesforce upgrades are not stable and worth installing ?? I tried removing the custom components, still the error is coming.

 

Please help !

Sorry if this is a dumb question ... I'm a beginner with VisualForce and searching hasn't turned anything up.

 

I have a list of objects I want to render but I also want to highlight a particular value as the 'current selection' (i.e. give it a different class to the other elements). This is easy with JSTL: use a foreach tag to iterate over the collection and an if...test tag to check whether the value is the one I want to highlight. Obviously I can use dataList or repeat to iterate over the collection but I can't see any equivalent to if...test. 

 

Any ideas? I can do it with Javascript but that seems very hacky.