• JuanBess
  • NEWBIE
  • 50 Points
  • Member since 2009

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 15
    Replies
Hi there,

I have two objects: (the standard) Contact and a CustomObject. The relationship between the two is a lookup-field on the Contact, named "CustomObjectID". 
I have a checkbox on the CustomObject-record; this checkbox shows whether a Custom Object has a Contact related to it.

Now, when I delete a Contact, I want the checkbox on the related Custom Object to be unchecked.

I currently use this apex trigger:

trigger CustomObjectDelete on Contact (before delete) {
for (Contact c : Trigger.old) {
c.CustomObject__r.Checkbox__c = false;
  }
}

But it gives error:  "System.NullPointerException: Attempt to de-reference a null object:"

Many many thanks in advance !

KR, Valentijn

I'm trying to create new EmailServicesFunction and EmailServicesAddress via Apex, but I'm getting the error
"Save error: DML not allowed on EmailServicesFunction".  Does anyone know how to accomplish this?

 

Thanks,

Jon

Hi All, I'm trying to package my release managed package, and i'm getting lot of failures related to the same error: 
"System.LimitException: Your runAllTests request is using too many DB resources." 

I was able to package before, but seems like we have a new limitation now.... 
I really need this package to go live ASAP and of course, this is a BLOCKER. 

Notice that ALL MY TEST CASES HAVE 0 FAILURES if i run them individually. 

Thanks in advance, 
J.

Hi, I would like to logged on my EE org be able to access my Customer Portal account (setup on another org).

I was researching the Salesforce documentation but some articles seems to be out of date.

 

I found this:

Delegated Authentication

 

Use delegated authentication if you have mobile users in your organization, or if you want to enable single-sign on for partner portals or Customer Portals. You must request that this feature be enabled by salesforce.com. This recipe explains delegated authentication in more detail.

 

This is the better or recommended approach? Someone already did it or have a better understanding of the subject?

Thanks in advance,

J.

Hi, I'm working on a native force.com application. Since this weekend our code start failing in some orgs.

The problem seems to be the assignment of '' (empty value, or just spaces). The strange thing is that is failing in some orgs, and in some of the is working fine. All of them are in the winter release.

 

I tried this in my orgs:

 

Account a = new Account();
a.name = '';
system.debug('\n\n================\n' + a + '\n==========================\n\n');

 

 

In some of the the result is:

 

================
Account:{Name=null}
==========================

 

 

And in some others:

 

================
Account:{Name=}
==========================

 

 

I don't know if they have changed to assign null instead of '', but at least seems to be an issue of consistence between different salesforce instances.

Anyone had the same issue?

Juan.

Hi All,

I'm trying to validate that an user have the correct object permissions to correctly use my application.

I was searching everywhere and I couldn't find a possible solution... I'm looking for the information store in the section "Custom Object Permissions" at a Profile Detail.

I think my main issue is that I want to validate other users but logged in with the System Admin. I thought about try/catch the dml and determinate the permissions, but this only works with the context user, and runAs only works inside Test Methods, so, that won't work for me.

I wonder if someone try to do this or figured out some work around to determinate the object permissions.

Thanks in advance,

J.

Hi,

I have a problem when override the user image. The image link change to something like this:

https://na7.salesforce.com/userphoto?id={!userId}&v=2&s=T

and before has v=1 .

I wonder where i can get the version number of the image or where this images are stored to check the size of the related images.

Thanks in advance,

Juan.

I'm looking to rendered a Visualforce Page as a Doc File.

On the content of the document i need to include the html stored in the database (entered by a text area with the standard rich text editor). The problem is that i failed the security review because of this.

 

Any help or work around to pass the review?

 

This is where it failed:

 

50. public FooController() //FooController.cls
...
53. currentId = ApexPages.currentPage().getParameters().get('cId');
1. <!-- //Foo.page
...
412. <div><apex:outputText escape="false" value="{!fooObj.richText__c}"/></div>

 

 

I also tried to wrap my object with an inner class to avoid mapping directly the stored field, but without luck....

 

Thanks in advance,

J.

 

 

Hi, I Need to know the pre-requisits for QTP (Quick Test Professional) to work with virtual force application

  • what version of QTP
  • plug ins
  • what IE/FF version

and anything I need to know about the set up.

 

Thanks in advance,

J.

 

Hi,

 

Yesterday I was ready to update my package, but i couldn't because of the server where my package org is was down. Today i was able to update my package, but now i'm getting installation failed errors. I don't know if this is related to the server problems, but looks like a salesforce internal problem because i'm only receiving an error id, and not log about the test method failed or something else.
I'm only receiving mails likes this:

Organization: xxxxxxxxxxxxxxxxxxxx (xxxxxxxxxxxxxxxxxxxx)
User: xxxxxxxxxxxxxxxxxxxx (xxxxxxxxxxxxxxxxxxxx)
Package: xxxxxxxxxxxxxxxxxxxx (xxxxxxxxxxxxxxxxxxxx)
Error Number: 974505854-276240 (92173634)

 

 

 

Thanks in advance,

J.

Hi,
I'm use a developer org, and another org where i make my packages. I have a problem while saving a class (i think only happens with class that implement BATCH processes) in my package org. I'm trying to save from the browser and eclipse, but always get the error. I also getting the error if i refresh (with the correct code), and the try to add something (like only a white space....).
This is the error message:

   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 Salesforce Support
   <https://na1.salesforce.com/_ui/training/help/pub/UserEdSolution?id=50130000000M9gH&orgId=00D000000000062>.
   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.com!

   Error ID: 900748768-170 (-1718382306)


Also if I try to follow the link "Salesforce Support": https://na1.salesforce.com/_ui/training/help/pub/UserEdSolution?id=50130000000M9gH&orgId=00D000000000062, i get and error, i change the server to na6 like:
https://na6.salesforce.com/_ui/training/help/pub/UserEdSolution?id=50130000000M9gH&orgId=00D000000000062
and now i'm getting this error:
Your organization has been disabled Salesforce.com has disabled access to the system for your company. Please contact support@salesforce.com <mailto:support@salesforce.com> for more information about this error.

I need this ASAP because i need a new package in a few hours.

Thanks in advance.
J.
Message Edited by JuanBess on 11-13-2009 08:54 AM

Hi,

I have a test class that create a new Opportunity to work with. The problem is that some customers have their own validation rules in some of the Opportunity object, and cause the insert fail.

 

 

Opportunity newOppty = new Opportunity(StageName='Qualification', Probability=10, Amount=100.00, Type='Existing Customer - Downgrade', LeadSource='Web', IsPrivate=false, Name='John Bess Oppty', ForecastCategoryName='Pipeline', CloseDate=Date.today());
insert newOppty;

 

 There is a way to know if there are any validation rule on the opportunity fields before the insert and create a valid Opportunity?? What is the best practice in this case?, because I can't what the users can have differents validations depend of each Org. 

 

Thanks in advance,

J.

Hi,
I've created a new package with important changes. We changed some of the logic and the way that we store values, so when we try to install the application the new code failed because to the test that data is wrong.
There is a best practice to run update data process like we need to do in this case or some work around?

Thanks in advance,
J.
Hi,
I'm making my code coverage and I run into problems while I was trying to test the permissions. In my application the user have profiles and depend on each profiles, is the level of security of my records.
So first I run the code with a system administration (who has all the permission), and then I have to run the test (using System.runAs) with a non-system administrator, that enter to another parts of the code because that user don't have permission to do certain thinks.
Well may problem here is when I have only user in the org, or all the users are System Administration. Also I wasn't able to create new user in my test methods. There is some work around this or to create an user in my test methods??
Thanks in advance,
J.

Hi All, I'm trying to package my release managed package, and i'm getting lot of failures related to the same error: 
"System.LimitException: Your runAllTests request is using too many DB resources." 

I was able to package before, but seems like we have a new limitation now.... 
I really need this package to go live ASAP and of course, this is a BLOCKER. 

Notice that ALL MY TEST CASES HAVE 0 FAILURES if i run them individually. 

Thanks in advance, 
J.

Hi there,

I have two objects: (the standard) Contact and a CustomObject. The relationship between the two is a lookup-field on the Contact, named "CustomObjectID". 
I have a checkbox on the CustomObject-record; this checkbox shows whether a Custom Object has a Contact related to it.

Now, when I delete a Contact, I want the checkbox on the related Custom Object to be unchecked.

I currently use this apex trigger:

trigger CustomObjectDelete on Contact (before delete) {
for (Contact c : Trigger.old) {
c.CustomObject__r.Checkbox__c = false;
  }
}

But it gives error:  "System.NullPointerException: Attempt to de-reference a null object:"

Many many thanks in advance !

KR, Valentijn

Hi, I'm working on a native force.com application. Since this weekend our code start failing in some orgs.

The problem seems to be the assignment of '' (empty value, or just spaces). The strange thing is that is failing in some orgs, and in some of the is working fine. All of them are in the winter release.

 

I tried this in my orgs:

 

Account a = new Account();
a.name = '';
system.debug('\n\n================\n' + a + '\n==========================\n\n');

 

 

In some of the the result is:

 

================
Account:{Name=null}
==========================

 

 

And in some others:

 

================
Account:{Name=}
==========================

 

 

I don't know if they have changed to assign null instead of '', but at least seems to be an issue of consistence between different salesforce instances.

Anyone had the same issue?

Juan.

Hi All,

I'm trying to validate that an user have the correct object permissions to correctly use my application.

I was searching everywhere and I couldn't find a possible solution... I'm looking for the information store in the section "Custom Object Permissions" at a Profile Detail.

I think my main issue is that I want to validate other users but logged in with the System Admin. I thought about try/catch the dml and determinate the permissions, but this only works with the context user, and runAs only works inside Test Methods, so, that won't work for me.

I wonder if someone try to do this or figured out some work around to determinate the object permissions.

Thanks in advance,

J.

Hi,

I have a problem when override the user image. The image link change to something like this:

https://na7.salesforce.com/userphoto?id={!userId}&v=2&s=T

and before has v=1 .

I wonder where i can get the version number of the image or where this images are stored to check the size of the related images.

Thanks in advance,

Juan.

Hi,

 

I need to use escape="false" in some of our app's Visualforce pages in order to allow the display of HTML stored in the database. Per SFDC's Security Review of our app (and for good reason), I must sanitize this HTML. Unfortunately, SFDC does not yet provide any built-in methods to do so, therefore, one must roll their own solution.

 

Any ideas on the best way to go about implementing this?

 

Thanks a lot,

Mike 

I have a custom controller and associated VF page that I am trying to deploy, and in the sandbox my Unit Test coverage for the class is showing as 97%.  All of my data is defined in the Unit Test.

 

When I go through the deployment validation in the Force.com IDE, the validation fails because it is only showing 47% test coverage of the same class.

 

All of the unit tests are defined in a single test class, and I am including the test class, the VF pages that it uses, and the controller (as all of the items) in my deployment.

 

There are triggers that also impact the test, but the lowest coverage on any of them is 75%, and the Code Coverage Total in the sandbox summary is 92%.

 

Any thoughts as to what might be causing the discrepancy between the sandbox test results and the IDE deployment wizard's test results? 

Hi,

 

Yesterday I was ready to update my package, but i couldn't because of the server where my package org is was down. Today i was able to update my package, but now i'm getting installation failed errors. I don't know if this is related to the server problems, but looks like a salesforce internal problem because i'm only receiving an error id, and not log about the test method failed or something else.
I'm only receiving mails likes this:

Organization: xxxxxxxxxxxxxxxxxxxx (xxxxxxxxxxxxxxxxxxxx)
User: xxxxxxxxxxxxxxxxxxxx (xxxxxxxxxxxxxxxxxxxx)
Package: xxxxxxxxxxxxxxxxxxxx (xxxxxxxxxxxxxxxxxxxx)
Error Number: 974505854-276240 (92173634)

 

 

 

Thanks in advance,

J.

Hi,

 

I have created some batch apex code alongwith other triggers and class/controller codes. 

 

When I run individual test methods on them, I am able to get test success result alongwith nice code coverage %. However when I run all tests together, I get following test failure errors:-

 

1)System.AsyncException: Database.executeBatch cannot be called from a batch or future method.

2)System.AsyncException: Future method cannot be called from a future method: changeOwners(String, String)

3)System.AsyncException: Future method cannot be called from a future method: getLead_Rollup_Amount(Id)

4)System.AsyncException: Future method cannot be called from a future method: changeOwners(String, String)

 

Please note again that the exceptions dont come when tested individually.

 

Please advise on same.

 

 

Thanks,

 

Vimal 

Hi,
I'm making my code coverage and I run into problems while I was trying to test the permissions. In my application the user have profiles and depend on each profiles, is the level of security of my records.
So first I run the code with a system administration (who has all the permission), and then I have to run the test (using System.runAs) with a non-system administrator, that enter to another parts of the code because that user don't have permission to do certain thinks.
Well may problem here is when I have only user in the org, or all the users are System Administration. Also I wasn't able to create new user in my test methods. There is some work around this or to create an user in my test methods??
Thanks in advance,
J.

I'm trying to create new EmailServicesFunction and EmailServicesAddress via Apex, but I'm getting the error
"Save error: DML not allowed on EmailServicesFunction".  Does anyone know how to accomplish this?

 

Thanks,

Jon