• sparky
  • NEWBIE
  • 110 Points
  • Member since 2006

  • Chatter
    Feed
  • 4
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 104
    Questions
  • 148
    Replies

I have a batch apex class, which references a formula field (custom field on CampaignMember) which in turn references a hierarchical custom settings object.  API v25.  I am inserting a record into this custom setting as the first part of my test.  I'm seeing the following behavior in my testmethod:

 

  • If I don't declare (SeeAllData = true) for my test, the entire thing gacks with the following err: FATAL_ERROR|System.UnexpectedException: Error processing messages(System Code)
  • If I declare (SeeAllData = true) that err does not occur (but I have other issues - i don't want to use all data)
  • If I remove the reference to the custom setting in the formula field, the error does not occur
  • The err occurs only in the test.  If I run the batch in production (with the setting populated) it runs fine

Seems like an internal SF bug - somehow the formula field is not able to access the values in the settings obj unless I use SeeAllData, even though I'm inserting a settings rec and everything else in the code is able to access it.

 

Can anyone confirm this issue?

 

Thanks much!

 

 

In the last few releases of the eclipse IDE, I find that attempting to refresh a folder (for example Objects) - done by right-clicking the folder and then choosing "Refresh from Server" - often fails to actually refresh the files in that folder.  The process appears to complete as normal, and I get no errors.  But even when  I have made changes in the browser and I know they should be pulled down, it fails to pull them down and the files remain as-is.

 

If I select the particular file, or multiple files, and do Refresh from Server, then it works.  But it fails at the folder level.

 

This is a pretty major problem w/ keeping our work straight, as you might expect.  Anyone else seeing this problem or have a way to fix it?  I just upgraded to the newest version of the IDE today, but was having the same problem w/ the previous version.

 

Thanks!

 

We have several old contact records that were mistakenly created years ago with no Account.  They are owned by inactive users.  I am attempting to reassign ownership so that I can then link them to an Account.  However, when I try to change Owner to an active user, I get the following error message:

 

Unable to Access Page
Invalid value: common.ownership.CannotReparentRecordException 

Error: The value of the parameter specified above contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and re-submit. If the error still persists, please report it to our Customer Support team and provide the URL of the page you were requesting as well as any other related information. 

 

I am of course sysadmin with full data modify-all-data permissions.  So what's going on here?

 

I have submitted a case to support but so far they don't know what's wrong.  Anyone seen this before?

 

Thanks!

  • August 21, 2010
  • Like
  • 0

I've been having this problem with the latest release of the Force.com IDE in Eclipse:

 

When I go to deploy from sandbox to production, using step 3 of the deployment wizard, the IDE thinks a number of files have changed, and need to be overwritten, when in fact nothing has changed.  I can refresh both sides, do a compare in eclipse, and there are no differences.  However, the deployment wizard still wants to overwrite.

 

This seems to be happening with some kinds of files and not others.  For example, apex code sseems to work correctly.  But some of the xml file types are exhibiting this behavior.  The ones that seem to always show differences are:

* Dashboards

* Email Templates

 

And then some of the time eclipse is finding non-existent differences in object files (both custom and standard) although this isn't happening with every object.

 

I'm not sure about this, but I don't believe this happened like this in prior versions of the IDE.  Is this an IDE bug, or something I'm doing wrong?  Other colleagues are experiencing the same thing, so I don't think it's anything to do with my particular setup.

 

Thanks!

 

  • August 04, 2010
  • Like
  • 0

Hi, I'm trying to do Run All Tests from the SF web UI (setup > Classes > Run All Tests) and it's just waiting for response for a long time, and seems to have timed out.  I've tried it twice and both times, after at least 20 mins or more, no response from SF.  I assume by this time that it has timed out?

 

In the past I've had trouble with this timing out under Firefox and Chrome, but it always worked in IE.  This time I'm trying IE but getting no love.

 

I have to do this in the browser and not Eclipse, b/c I'm testing a 3rd-party managed package, and those classes don't appear in eclipse.  We have a lot of code in here, but it shouldn't take 20 minutes!

 

BTW, this is a developer account that has already been upgraded to Summer '10. 

 

Any remedies out there?

 

M.

I've got a stylesheet I only want to load if user is using IE.  What's the best way to detect browser in VF?  Do I just need to inject some javascript?  Or is there a way to do this natively?

 

Thanks!

  • February 24, 2010
  • Like
  • 0

For a custom object, one of my users is unable to change the record type of a record she owns.  The "change" link simply does not appear for her.  It does appear for me as sysadmin.

 

I've double-checked that her profile has full CRUD permissions on the object, has access to all of the record types, and has field permissions on the Record Type field.  I've also logged in as her in sandbox, and double-checked that she's not just mis-reporting this.

 

What else would prevent her from being able to change the rectype?

 

Thanks!

  • December 04, 2009
  • Like
  • 0

Is it possible to delete list custom settings records in code?  I'm getting an "invalid cross reference id" when I attempt to do this as part of a test.

 

Reason I'm doing this: the code I'm working on will be packaged and distributed to various clients.  It uses a list custom settings object to enable each client to use their own parameters.  But for the tests, I need to know what the parameters are so I know what to test for.  Since I can't know what the client will have put in for their custom settings, safest bet in the test is to delete whatever settings exist, and then replace them with  standard ones.

 

It's letting me insert new settings, but not delete existing ones.

  • December 04, 2009
  • Like
  • 0

Can anyone tell me: with Salesforce Content, is it possible to upload an image, and then reference it from an external website, for display on a page?  (Basically, can you hotlink an image stored in Content if you assign the right permissions?)

 

I'm guessing the answer is no, but so far I can't verify in the documentation.  (Not using Content yet, waiting for it to become avail. for free!)

 

If the answer to that is yes, then is it possible to:

* link an image to a particular Contact record

* via the API, query for the contact and associated images, and determine the URL for the image

 

Thanks much!

  • December 03, 2009
  • Like
  • 0
What would cause a test class to pass when run on its own in Eclipse, but fail when run as part of Run All Tests in the SF UI.

Here's the test passing in Eclipse:
http://screencast.com/t/NzVhZDgxM

And here's the same test failing as part of Run All Tests:
http://screencast.com/t/ZGQ3NTljM

This is the same class in the same SF instance, run about 5 mins. apart, with no code (or anything else) changed in the interim.

Is there any proper reason this would happen, or is this a bug?

Thanks!
M.

PS I'm also seeing some odd problems with attempting to deploy code today, and am wondering if they might be related, since I'm guessing that a deploy uses a similar testing enviornment to Run All Tests.  Just a guess.
Message Edited by sparky on 11-12-2009 10:52 PM
  • November 10, 2009
  • Like
  • 0

We're seeing an odd behavior where Firefox will sometimes return an old version of a document.  At least on Windows XP.  To recreate:

 

* in Documents tab, save a MS Word document

* then open the document from the SF Document record ("view this file")

* make a change

* save it, and Replace the old version in SF

* now "view this file" again

 

For us, when we do that we get the old version of the document in Word.  However, we know the new version is in there.  If we use IE (or Chrome, I believe) we get the new version.  Or if you right-click the "view this file" link, and choose Save, then open the saved document, it's the new version.  So somehow the open-in-Word action is causing a cached copy of the old version to be opened?

 

Anyone got any insight into this, and how to improve this behavior?

 

Thanks!

  • October 16, 2009
  • Like
  • 0

Check out this screenshot:

 http://screencast.com/t/w3WHvQ3cmSxJ

 

This is a class in our developer instance.  It's one we wrote.  It has nothing whatsoever to do with Vertical Response, except for the fact that VR is also installed in this instance. 

 

So why is the VR package and namespace showing up here?   It also shows up in the -meta file in eclipse.  This looks like a bug to me.  Is it?  

 

Thanks!

 

BTW, I have checked a little further and:

* the VR reference shows up on most of the classes in this developer instance (haven't yet taken the time to confirm if it's all of them, but it looks like it is)

* I checked a production instance that contains both this class and VR, and the reference was not present there.

 

 

 

 Edit: although I just noticed this, we have evidence that this behavior has been around since at least June, so it's not a Winter '10 thing.

Message Edited by sparky on 10-13-2009 04:43 PM
Message Edited by sparky on 10-13-2009 04:55 PM
  • October 13, 2009
  • Like
  • 0

We're getting a problem in Eclipse when trying to add/remove metadata components.  One visible symptom is that report folders are showing up under Email and vice-versa.  And my package.xml is ending up corrupted/blank.  It seems to be getting data back from the metadata API that it's having trouble dealing with.

 

We strongly suspect this is a new problem introduced with Winter '10.  Because:

* the problem just started in the last day or 2

* we haven't changed eclipse environment in that time

* it's only occurring with servers that have been upgraded to winter '10 (at time of this writing, not all of them have been), and it seems to be happening with every instance that's on an upgraded server

* it's happening to muliple colleagues, so it's not a local client issue

 

This is causing major problems trying to deploy code in Eclipse.  I tried calling support but they had no idea.  Can anyone over at SF help here?  Anyone else seeing this problem?

 

To recreate:

* in eclipse, create new project for a winter 10 instance

* after entering login, choose "Selected Metadata Components", and click Choose..

* expand the Email node, and notice if there are report folders in there

 

Thanks!

Message Edited by sparky on 10-09-2009 05:11 PM
  • October 10, 2009
  • Like
  • 0

Just a quick note to the webmasters of this "developerforce" site: while the search feature has gotten a lot better over the last few years, it's still quite difficult to find what you want using the built-in search, and I often get better results using google to search your site.

 

One thing I just noticed: your indexing routine for Ideas and board postings seems to be indexing the entire UI of the site, not just the content of the idea or post!  For example, here's a search I just did:

 

http://screencast.com/t/Jmz1Ryuss2ds

 

The yellow boxes are from navigation elements like the menus at the top, not from any content particular to the postings/ideas!   In this case it makes it much more difficult to find stuff that's actually relevant, because "partner" is a very important element of what I'm looking for (since it's about the partner portal), but due to this indexing it thinks every forum post contains that word.

 

 

Message Edited by sparky on 09-14-2009 06:33 PM
  • September 15, 2009
  • Like
  • 0

When I get an email notice of an unhandled apex exception, sometimes it includes a full debug log dump, and sometimes it doesn't.  What determines whether it includes the log or not?

 

Last night I was struggling with a tricky bug, one I couldn't seem to recreate in my tests, and I was trying to get a log of some code launched from a VF page.  It was sending me exception emails, but the debug log was cut off after one line (total email size 2K).  Hours later, the exact same error resulted in an email with a full log (email size 190K).  I had the System Log window open the second time, hoping to get the log to show up there.  It didn't, but does that affect what you get in the email?  

 

I made a few other settings changes in between the two emails (turned off Development mode) and was using a different browser, but I wouldn't expect that to make a difference.

 

Thanks!
M.

  • September 09, 2009
  • Like
  • 0

I'm using the Partner Portal.  I would like to have a formula field on Account that would display the org of the owner, whether that user be a partner user or regular user. 

 

Any way to do this without resorting the apex triggers?

 

Thanks!

  • August 03, 2009
  • Like
  • 0

I've set up a semi-automatic email (using an HTML template) that gets sent out of SF in certain situations by an apex trigger.  This works as it should.

 

Problem is, I'm finding that MS Outlook, using its default settings, will mark the email as Junk (spam).  I want to avoid that.

 

I already turned on the SF deliverability options.  That by itself didn't solve the problem, but probably reduced the junk "score" that Outlook assigns.

 

Further testing: this template contains both an image (header on the email letterhead) and a number of links, pointing to the client's website.  I've found that if I remove either the links or the image, Outlook accepts it.  But with both if them in there, it calls it junk.

 

We generally don't have this problem w/ emails sent by services like Vertical Response.  (Maybe because the links in that case are redirects which first go to VR's domain, so the domain of the links & the email are the same??)  But we can't use VR for this, since the emails are triggered.

 

Any advice on how to improve deliverability here?  I've heard about the option of using our own mail server instead of SF's, but I don't think that's going to be feasible for this client.  Anyone got other ideas, and/or good resources for understanding how Outlook's junk filter works?

 

Thanks much!

  • August 03, 2009
  • Like
  • 0

Here's how I'd like to set up permissions for several objects, including Accounts:

 

* fully open read/write internally

* no access for partner users unless owned by a partner user

* if owned by a partner user, shared with every other partner user in that same partner org as read/write

 

Getting the first 2 to happen is easy (set to Private, add sharing rule to share to All Internal Users when owned by same).

 

But how do I get that 3rd to happen.  Seems like it would be a pretty common setup, but it doesn't look easy.  There's the 3 partner roles within each partner org (executive, manager, user) but I think partner executives  can by default only read recs owned by other partner execs, not read/write.

 

Only solution I can see is to create a public group for each partner org containing all of that partner org's profiles, then put in a sharing rule for each partner org based on the group.  Is there an easier way?

 

Thanks much!

I'm posting this here in the hopes that someone at SF will see it.  I tried submitting a case online, but the portal is down, and support lines are closed.

 

I'm working in sandbox, on the cs3 instance, which has had some performance problems last few days.  Not sure if that's related to my problem.

 

I'm using the TEXT() function to get the value of a picklist field in the formula for the rule, and it's throwing an err, saying:

" Error: Incorrect parameter for function TEXT(). Expected Number, Date, DateTime, received Picklist "

 

Umm, yeah, that's how it used to work, but that got changed, remember?  I know this sandbox is summer 09 enabled, b/c there are other summer09-only features that are available (like custom Campaign Member fields.)

 

Thanks for any help.

 

 

Message Edited by sparky on 07-23-2009 09:16 PM

We've got a list button that calls a VF pg which uses an extension to the standard controller for a custom object.

 

Unless I'm absolutely crazy, this worked fine very recently.  (Last week?)  Today it doesn't work.  I get the following error:

 

Invalid variant 'parent': value 'Opportunity'

 

Which I don't understand at all.  I've tried it in various instances and it seems to have stopped working everywhere.  SF, did you push a change that caused this to stop working?

 

Here's the code.  First the page:

 

 

<apex:page standardController="OppPayment__c" recordSetVar="installments" extensions="ONEN_EXT_MarkPaymentsPaid" action="{!markInstallmentsWrittenOff}">
<apex:param name="mark" value="writeoff"/>
</apex:page>

 

next the extension:

 

 

public class ONEN_EXT_MarkPaymentsPaid {

private List<OppPayment__c> selectedInstallments;
private String mark;

//have to instantiate with StandardSetController for list buttons
public ONEN_EXT_MarkPaymentsPaid(ApexPages.StandardSetController controller) {
//get the selected ids that were checked
this.selectedInstallments = (List<OppPayment__c>)controller.getSelected();
}

public pageReference markInstallmentsPaid() {
mark='paid';
PageReference p = markInstallments();
return p;
}

public pageReference markInstallmentsWrittenOff() {
mark='writeoff';
PageReference p = markInstallments();
return p;
}

pageReference markInstallments() {
//get all the installments that were selected
List<OppPayment__c> InstallmentsFromSelection = [select Id,paid__c from OppPayment__c where Id IN :selectedInstallments];
if (InstallmentsFromSelection.size()>0) {
for (OppPayment__c thisInstallment : InstallmentsFromSelection) {
//if we're passing in paid on the querystring, mark them paid
if(mark=='paid') {
thisInstallment.paid__c=true;
thisInstallment.Written_Off__c=false;
} else if(mark=='writeoff') {
thisInstallment.Written_Off__c=true;
thisInstallment.paid__c=false;
}
}

update InstallmentsFromSelection;
}
PageReference p = new PageReference(System.currentPageReference().getParameters().get('retURL'));
p.setRedirect(true);
return p;
}
}

 

 BTW, OppPayment__c is a custom object which is detail-master to Opportunity.  The button is being accessed from a related list on an Opportunity layout.

 

edit: I just discovered that this list button works fine when called from the Console or from an OppPayment__c list view.  So the error seems to only occur when it's called from a related list on the Opp layout.  (Hence the reference to Opportunity being the 'parent', I assume.)

 

BTW, we have unit tests, and they all still pass.  So whatever the issue here is, it seems to happen only in the SF UI.   Also, nothing shows up in the System Log.

 

Can anyone help here?  

 

Thanks much!

 

PS: here's another post that may be related that looks like it was never answered: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=12980

 

 

 

 

Message Edited by sparky on 07-06-2009 10:54 PM
Message Edited by sparky on 07-06-2009 11:06 PM
There have been a few posts about making fields show as required (little red bar):
* http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=2419
* http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=1254

in which SF folks say that in order to make the bar appear, just use an inputField element, and make the field required in your field definitions.

Fair enough, that seems to work most of the time.

However, in my current project I've got a custom object, and the Name field is included on a VF page.  And I'm using an inputField element, but it's not showing the red bar.  And moreover, if I leave the field blank, it gets filled in somehow with the ID of the record, rather than throwing an error.

I thought Name fields were required by definition.  If I edit the record in the standard layout, I get the red bar and leaving the Name blank throws an error.

I'm using the standard controller (with an extension).  Is this a bug?

Thanks much!
  • August 12, 2008
  • Like
  • 1
Hi, wondering if it's possible to create an s-control that:

* initiates creation of a record (let's say an Opportunity)
* sets the needed foreign keys
* sets the Record Type
* fills in certain fields in the form (amount and date, for example)
* leaves the user in Edit mode with option to complete/commit or cancel

If so, does anyone have an example they could point me to?

I've seen the technique where the record is created & committed via code, then pulled up in edit mode.  But I'd prefer to give control back to the user before the rec is committed.

Sorry if this is old hat - a quick search of the forum didn't turn up the answer.

Thanks!
Matthew
  • April 12, 2006
  • Like
  • 1

In the last few releases of the eclipse IDE, I find that attempting to refresh a folder (for example Objects) - done by right-clicking the folder and then choosing "Refresh from Server" - often fails to actually refresh the files in that folder.  The process appears to complete as normal, and I get no errors.  But even when  I have made changes in the browser and I know they should be pulled down, it fails to pull them down and the files remain as-is.

 

If I select the particular file, or multiple files, and do Refresh from Server, then it works.  But it fails at the folder level.

 

This is a pretty major problem w/ keeping our work straight, as you might expect.  Anyone else seeing this problem or have a way to fix it?  I just upgraded to the newest version of the IDE today, but was having the same problem w/ the previous version.

 

Thanks!

 

Hi, I'm trying to do Run All Tests from the SF web UI (setup > Classes > Run All Tests) and it's just waiting for response for a long time, and seems to have timed out.  I've tried it twice and both times, after at least 20 mins or more, no response from SF.  I assume by this time that it has timed out?

 

In the past I've had trouble with this timing out under Firefox and Chrome, but it always worked in IE.  This time I'm trying IE but getting no love.

 

I have to do this in the browser and not Eclipse, b/c I'm testing a 3rd-party managed package, and those classes don't appear in eclipse.  We have a lot of code in here, but it shouldn't take 20 minutes!

 

BTW, this is a developer account that has already been upgraded to Summer '10. 

 

Any remedies out there?

 

M.

Hi,

is it possbile to delete custom fields from a custom objects by using the metadata api in eclipse ? 

Currently when I do this, the .object files is refreshed with the previous content.

 

Thanks in advance

Hi,

In my apex script I make a copy of an original list with sObjects, to see at a later phase (eg when saving the objects) wether there has been a change of any of the fields by the user.

I use deepclone (clone(true,true)) to make the copy of the relevant objects which I add to the list. Immediately after the cloning, the objects are identical (assertequals of clone and original returns true), after showing them on a vf page with only outputfields they remain identical,

but after showing them in a vf page with inputfields they are seen different (assertequals of clone and original returns false), although all fields (including system fields like lastmodifieddate and id) are identical (assertequals of the individual fields returns true).

 

Anyone who recognizes this and could think of a way to handle this without having to compare each individual field to check for changes?

 

Is it possible to delete list custom settings records in code?  I'm getting an "invalid cross reference id" when I attempt to do this as part of a test.

 

Reason I'm doing this: the code I'm working on will be packaged and distributed to various clients.  It uses a list custom settings object to enable each client to use their own parameters.  But for the tests, I need to know what the parameters are so I know what to test for.  Since I can't know what the client will have put in for their custom settings, safest bet in the test is to delete whatever settings exist, and then replace them with  standard ones.

 

It's letting me insert new settings, but not delete existing ones.

  • December 04, 2009
  • Like
  • 0

Using the latest IDE for Eclipse, 

 

Starting yesterday, about every min' or so I get the message "Save error: Conflict found while preparing to save 'xxx.cls-meta.xml' to server.  Remote instance has been updated since last save or sync."

 

I can work around this by refreshing from the server, pasting in my changed code and re-saving, but having to constantly do this is getting tiresom. Any ideas? 

  • September 16, 2009
  • Like
  • 0

Hello,

 

I am trying to deploy some VF controller which has 89% of coverage.. The VF page runs fine on sandbox when I try to deploy the controller get blunt message "An error occurred on your page."

 

Has anyone seen the error before and have an idea of what could be wrong?

 

Thanks!

Pr@sh...

 

Hi fellow developers,

I'm trying to emulate the sample in the vf dev guide (Adding Custom List Buttons using Standard List Controllers), but with a twist: using a detail from a master-detail (Account = Master, detail = Flavor_Request__c).

I have both the Apex Class and controller similar to the example in the dev guide:

Code:
public class OpptyFlavorListButton
{
    public OpptyFlavorListButton(ApexPages.StandardSetController controller) {
            controller.setPageSize(10);
    }
}

<apex:page standardController="Flavor_Request__c" recordSetVar="flavors"
    tabStyle="Flavor_Request__c" extensions="OpptyFlavorListButton">
<apex:form >
    <apex:pageBlock title="Edit Status" mode="edit">
        <apex:pageMessages />
        <apex:pageBlockButtons location="top">
            <apex:commandButton value="Save" action="{!save}"/>
            <apex:commandButton value="Cancel" action="{!cancel}"/>
        </apex:pageBlockButtons>

        <apex:pageBlockTable value="{!selected}" var="f">
            <apex:column value="{!f.name}"/>
            <apex:column value="{!f.Request_Type__c}"/>
            <apex:column value="{!f.Sample_Size__c}"/>
            <apex:column headerValue="Status">
                <apex:inputField value="{!f.Status__c}"/>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>
</apex:page>

 



The buttons are added to the appropriate layouts, however, I keep getting the following errors:
1. Invalid variant 'parent': value 'Account'
2. Invalid variant 'parent': value 'Opportunity'

I get error #1 when trying this from the Account page (related list of flavors)
I get error #2 when trying this from the Opportunity page (related list of flavors)

I'm hitting these errors as the System Administrator who wrote the code...

Any feedback/suggestions would greatly be appreciated.

Thanks,
Larry


Message Edited by Legerdemain on 12-04-2008 08:38 PM

Message Edited by Legerdemain on 12-04-2008 08:39 PM
I'm creating events in an apex routine, and also need to create some "group events" (with multiple users invited.)

So my code creates an event, gets the id, then adds child EventAttendee records.  It works- so far so good. 
The problem is that it seems to always cause emails to get sent to the users invited.  When adding invitees via the UI, there's two options - SAVE, and SAVE AND SEND UPDATE.  The latter seems to send an email while the former doesn't.

With Apex/API I don't see how to make the same thing happen.  Is there a field in either object I can set to avoid sending the email?

Thanks much!


  • December 12, 2007
  • Like
  • 0