• JDev
  • NEWBIE
  • 25 Points
  • Member since 2005

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 10
    Replies

For last two days we have been unable to execute test classes in Winter 12 sandbox - using the UI we get internal server error - using eclipse get similar message  Error Id is Error ID: 1631129070-2716 (2077994544)

We will open case with support - is anyone else having this problem?

  • September 23, 2011
  • Like
  • 0

We are using Customer Portal with High Volume Customer Portal Licenses and Person Accounts (Winter11)  - we have enabled a custom object tab in the Customer Portal tab settings, the object is deployed and available for Customer Portal, the fields on the object are accessible by the High Volume Customer Portal User Profile and the Person Account has a valid license and can log in to the Customer Portal. The Custom Object has public read/write access and no relationshiops or dependencies to other objects. The Custom Object Tab does not show to the logged in user or to an admin using Login as Portal User - is there anything else needed to enable a custom object's Tab visibility in the Customer Portal? 

  • October 31, 2010
  • Like
  • 0

I have a batch apex query processing all contacts in a spring10 sandbox org (with about 170,000 total contact records) using a Query locator as below. If I use a Limit clause in the query the batch process excecutes OK - up to a point - I've run successfully with 1,000, 10,000 and 100,000 limits (no other change to batch or query code.) When I try 200,000 row limit, or leave the row limit off, I get failure on the first batch and no records processed.

 

As the contacts are in order by sequence, and the default batch scope is 200 rows, it looks as though something is preventing the batches from even being created (as the first 200 rows should be the same batch in all cases) - yet the doeumentation indicates we should be able to process 50 million records, so 200,000 doesn't seem like it should cause a problem.

 

Anyone have the same symptoms in a Spring 10 release / any suggestions on how to overcome the problem?

 

global Database.queryLocator
        start(Database.BatchableContext custContact){
                   return Database.getQueryLocator(
        [Select Id, RecordTypeId, LastName, Total_Case_Count__c, Name from Contact Where RecordTypeId = '0123000000007loAAA' AND Name!= 'Anonymous Customer' Order by LastName limit 100000]);
    }

  • May 22, 2010
  • Like
  • 0

Getting an upsert error in refreshed sandbox on CS1 - error is in a test class. The upsert statement is using the very field reported as the duplicate as the basis for the upsert match (case sensitive external id) on a custom object - test upserts a single row that should match an existing record and update, instead seems to attempt an insert and gets an error.

 

Division SummariesSystem.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: Division_Summary_Unique__c duplicates value on record with id: a0ES0000000OXUR:

  • February 10, 2010
  • Like
  • 0

We have a simple VF redirect page that overrides standard account edit to display a special visualforce page when a particular record type is selected but uses the standard edit page otherwise. This works fine, except that now we can't seem to change Record Types - when the Change Record Type link is selected the standard Edit Page opens up with the existing Record Type already saved. Controller Code page redirect is here

 

public PageReference gotoPage() {

Account acct = [Select id, RecordType.Name From Account Where Id =ApexPages.currentPage().getParameters().get('id')];

PageReference newPage;

if (acct.RecordType.Name == 'Special') {

newPage = Page.editSpecial;

} else {

newPage = new PageReference('/' + acct.id + '/e');

newPage.getParameters().put('nooverride', '1');

}

newPage.getParameters().put('id', acct.id);

return newPage.setRedirect(true);

}

 

 

Message Edited by JDev on 01-12-2010 04:33 PM
  • January 12, 2010
  • Like
  • 0

We have a custom object Account_Email__c as a child object of Account. In order to maintain summary data on the account record we override the standard New and Edit function for this object with a custom VF page controlled by an extension controller.

 

The extension controller uses the RetURL from the calling page to determine which Account record to use - this works well for the New and Edit functions called from the standard buttons on the Account Page, but it does not work when the user presses the Edit button presented on a standard search result that matches the AccountEmail Address (as the RetURL is not the Account record at all.)

 

Any suggestions on a way to determine the account record when it is not available on search as a retURL and there could be multiple matching search results?

 

Turned out there is a simple solution - use acctId = accountEmail.Account__c and as long as the field is on the Visualforce page (just use output field with rendered = false) then the account can be retrieved by selecting on acctId from new or edit, regardless of where the page is called from.

Message Edited by JDev on 09-28-2009 03:28 PM
  • September 28, 2009
  • Like
  • 0

I have a simple Visualforce page that works in production and developer sandbox but fails to return the correct URL in a full Sandbox when code was deployed there today.

 

Same Apex controller code and user profile used in all environments: Production is na2 Sandbox that works is cs2 Sandbox that fails is tapp0

 

Failure symptom is the URL returned without the preceding Org prefix

Working return url on cancel is https://cs2.salesforce.com//003R000000Du5go

Failed URL on cancel is: https://003t000000ihh83/

 

Code in controller is

 

private PageReference retURL = new PageReference('/'+ApexPages.currentPage().getParameters().get('retURL')); ..... public PageReference cancel() { retURL.setRedirect(true); return retURL; }

 

Is anyone else seeing this type of behavior?

Is there a better way of handling retURL (I'm passing the 15 char id as a parameter from a button?)

Message Edited by JDev on 06-24-2009 04:02 PM
  • June 24, 2009
  • Like
  • 0
In using the Eclipse environment with multiple orgs - some APEX enabled, some not - I've been getting some orgs showing no schema option at all (just scontrols), some the full queryable schema (appexchange.schema) and some a strange "place holder" text entry when I open the appexchange.schema. Whether I open a new project or resynch folders this doesn't change - is there anything people are aware of that might explain this? (I'm a system admin in all the orgs in question.)

Can anyone help with this? Salesforce support does not address dev issues so this is the only resource available - I can't see why when accessing different orgs from the same PC and the same Eclipse set up I'm sometimes able to browse and query a full schema and sometimes only seeing "placeholder entry"!

Message Edited by JDev on 05-15-2007 01:58 PM

  • May 11, 2007
  • Like
  • 0
I'm trying to use a merge field from a custom picklist in a where clause - my merge field value is "Mountain"
 
The following query runs successfully in Eclipse:
Select r.Region_Unit_ID__c, r.Name, r.Active__c From Region__c r where r.Name = 'Mountain' limit 1
 
However the following AJAX query returns error TypeError: records has no properties (if the where clause is passed a value - there is no problem if the value is null)
 
"Select r.Region_Unit_ID__c, r.Name, r.Active__c From Region__c r where r.Name = 'Mountain' limit 1", callback ); 
 
I've tried defining a variable and substituting the value but no luck - any ideas?
 var thisWhere = "Mountain";

"Select r.Region_Unit_ID__c, r.Name, r.Active__c From Region__c r where r.Name = '" + thisWhere + "' limit 1", callback );

If I send null string I'm successful (but result is obviously unhelpful)

"Select r.Region_Unit_ID__c, r.Name, r.Active__c From Region__c r where r.Name = '' limit 1", callback );

  • May 05, 2007
  • Like
  • 0
I am using a picklist to set a preferred address to 1 of 4 sets of Address data on Contact and showing the results in formula fields as below (example is for Preferred Zip):
IF(ISPICKVAL(Preferred_Address__c, "Address 1"),
Address_1_Zip__c,
IF(ISPICKVAL(Preferred_Address__c, "Address 2"), Address_2_Zip__c,
IF(ISPICKVAL(Preferred_Address__c, "Address 3"), Address_3_Zip__c , Address_4_Zip__c )) )

I am also using a workflow rule to set standard Contact Mailing address fields to the equivalent preferred values and making them read only on the page layout to facilitate data exchange with third party email systems.

The problem I have is with State Code, which as a pick list in it's own right cannot be directly addressed this way. I was hoping to be able to use the Text() function or something similar so that the code for Preferred State would be:
IF(ISPICKVAL(Preferred_Address__c, "Address 1"),
TEXT(Address_1_State__c),
IF(ISPICKVAL(Preferred_Address__c, "Address 2"), TEXT(Address_2_State__c),
IF(ISPICKVAL(Preferred_Address__c, "Address 3"), TEXT(Address_3_State__c) , TEXT(Address_4_State__c ))) )
Any one have any workable approaches?
  • February 20, 2007
  • Like
  • 0
Not sure where to post this. We've been trying to use PrintAnything (Salesforce Appechange tool) to retrieve a custom Object related to Contact via an intermediate custom object to print a contact data sheet. We are able to retrieve Contact and the first level custom object (a child relationship) but have not been able to retrieve the second level ( we need to look up the name of the related ID of the second custom object from the first custom object.) The queries are:
1. retrieve single row - Contact:0035000000KwNB3
2. select Id,Name,CreatedDate,CreatedById,LastModifiedDate,LastModifiedById,SystemModstamp,Contact__c,C_Event__c,RSVP_Status__c,Attended__c from RSVP__c where RSVP__c.Contact__c = '0035000000KwNB3AAN'
3. retrieve single row - C_Event__c:undefined

where we are looking to retrieve in 3 the C_Event Name for all C_Event__c on the returned RSVPs using Filter syntax: Retrieve RSVP__c.C_Event__c.0

Problem identified and resolved the correct syntax for query 3 is Retrieve:RSVP__c.C_Event__c.n with parameter set for mn array return. The tool is very capable but the syntax is specific and a browser doesn't make the best editor!

Message Edited by JDev on 09-26-2006 03:03 PM

  • September 26, 2006
  • Like
  • 0

I have the following VF page that is called by a button on a Person Account record.

 

 

<apex:page standardController="Account" title="Cancel Account">
    <apex:sectionHeader title="Cancel Account"/>
    <apex:form id="theForm">
        <apex:pageBlock id="theBlock">
            <apex:pageBlockSection id="sectionOne">
                <apex:outputField value="{!Account.Name}" />
                <!-- Bound to Date Field -->                
                <apex:inputField value="{!Account.Account_Cancel_Eff_Date__c}" />
                <!-- Bound to Picklist -->
                <apex:inputField value="{!Account.Account_Cancel_Reason__c}" />
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

When the page is called for a person account, Salesforce returns:

 

Validation Errors While Saving Record(s)

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Record Type ID: value not valid for the entity: Account". 

When the page is called for a normal Account, it renders as expected. If I remove the inputField that is bound to the picklist, then call the page for a person account, everything works as expected. What's going on here?

 

  • February 09, 2011
  • Like
  • 0

I have a batch apex query processing all contacts in a spring10 sandbox org (with about 170,000 total contact records) using a Query locator as below. If I use a Limit clause in the query the batch process excecutes OK - up to a point - I've run successfully with 1,000, 10,000 and 100,000 limits (no other change to batch or query code.) When I try 200,000 row limit, or leave the row limit off, I get failure on the first batch and no records processed.

 

As the contacts are in order by sequence, and the default batch scope is 200 rows, it looks as though something is preventing the batches from even being created (as the first 200 rows should be the same batch in all cases) - yet the doeumentation indicates we should be able to process 50 million records, so 200,000 doesn't seem like it should cause a problem.

 

Anyone have the same symptoms in a Spring 10 release / any suggestions on how to overcome the problem?

 

global Database.queryLocator
        start(Database.BatchableContext custContact){
                   return Database.getQueryLocator(
        [Select Id, RecordTypeId, LastName, Total_Case_Count__c, Name from Contact Where RecordTypeId = '0123000000007loAAA' AND Name!= 'Anonymous Customer' Order by LastName limit 100000]);
    }

  • May 22, 2010
  • Like
  • 0

Hello,

 

I'd like to create a new Person Account via API.  I have Person Account enabled.  Ideally, I want to create a Person Account in one shot, but I don't think it's possible?  I need to create an Account and 1 associated Contact and then convert the account to a Person Account type?  

 

 

void testCreateAndDestroyStudentAccount() { def first = "APIFirst" def last = "APILast" // create new, non-person Account first Account acct = new Account() acct.name = "${last}" def organizationaccount = getRecordTypes().find { it.name =='Educational Organization' } acct.recordTypeId = organizationaccount.id acct.ownerId = salesforce_owner_id acct.gender__pc = '' acct.languages__pc = '' acct.firstName = '' acct.lastName = '' acct.salutation = '' acct.level__pc = '' SaveResult[] result = salesForceService.createObjects(acct) result.each { it.errors.each { com.sforce.soap.partner.Error er -> println "ERROR: ${er.getMessage()}" } assertTrue("should have created account", it.success) println "Account ID: ${it.id}" acct.id = it.id } println "creating contact..." Contact contact = new Contact() contact.setFirstName(first) contact.setLastName(last) contact.accountId = acct.id contact.recordTypeId = '' contact.ownerId = salesforce_owner_id result = salesForceService.createObjects(contact) result.each { it.errors.each { com.sforce.soap.partner.Error er -> println "Create contact ERROR: ${er.getMessage()}" } assertTrue("should have created contact", it.success) println "CONTACT ID: ${it.id}" contact.id = it.id } def studentaccount = getRecordTypes().find { it.name =='Student Account' } acct.recordTypeId = studentaccount.id result = salesForceService.updateObjects(acct) result.each { it.errors.each { com.sforce.soap.partner.Error er -> println "Update Account ERROR: ${er.getMessage()}" } fail("should have converted to Person Account") } }

 

Code creates an Account and Contact fine, but fails at the update when attempting to convert to a Person Account (at the end) with message:

 

Cannot specify any additional fields when marrying or separating a Person-Account

 

 

 

Ideas?  Thoughts? Suggestions?

 

I appreciate any insight

 

Todd

I have a simple Visualforce page that works in production and developer sandbox but fails to return the correct URL in a full Sandbox when code was deployed there today.

 

Same Apex controller code and user profile used in all environments: Production is na2 Sandbox that works is cs2 Sandbox that fails is tapp0

 

Failure symptom is the URL returned without the preceding Org prefix

Working return url on cancel is https://cs2.salesforce.com//003R000000Du5go

Failed URL on cancel is: https://003t000000ihh83/

 

Code in controller is

 

private PageReference retURL = new PageReference('/'+ApexPages.currentPage().getParameters().get('retURL')); ..... public PageReference cancel() { retURL.setRedirect(true); return retURL; }

 

Is anyone else seeing this type of behavior?

Is there a better way of handling retURL (I'm passing the 15 char id as a parameter from a button?)

Message Edited by JDev on 06-24-2009 04:02 PM
  • June 24, 2009
  • Like
  • 0

Hey Guys,

 

This one has just popped up on a clients org when running test classes, im frantically searching through the config to make sure no one has change something to unique but i havent found anything yet, any ideas?

 

System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>

Is there an easy way to only display the Time of a DateTime object in VisualForce?

 

Also is there an easy way to display the Day-of-the-week like 'Friday' in VisualForce?

 

Currently, I'm using a switch statement taken from the pdf on Formulas, but am wondering if there is a better method:

{!CASE(MOD( TODAY() - DATE(1900, 1, 7), 7),0, "Sunday",1, "Monday",2, "Tuesday",3, "Wednesday",4, "Thursday",5, "Friday",6, "Saturday", "Error")}

 

Thanks

Parker

 

I'm trying to use a merge field from a custom picklist in a where clause - my merge field value is "Mountain"
 
The following query runs successfully in Eclipse:
Select r.Region_Unit_ID__c, r.Name, r.Active__c From Region__c r where r.Name = 'Mountain' limit 1
 
However the following AJAX query returns error TypeError: records has no properties (if the where clause is passed a value - there is no problem if the value is null)
 
"Select r.Region_Unit_ID__c, r.Name, r.Active__c From Region__c r where r.Name = 'Mountain' limit 1", callback ); 
 
I've tried defining a variable and substituting the value but no luck - any ideas?
 var thisWhere = "Mountain";

"Select r.Region_Unit_ID__c, r.Name, r.Active__c From Region__c r where r.Name = '" + thisWhere + "' limit 1", callback );

If I send null string I'm successful (but result is obviously unhelpful)

"Select r.Region_Unit_ID__c, r.Name, r.Active__c From Region__c r where r.Name = '' limit 1", callback );

  • May 05, 2007
  • Like
  • 0