• MWelch_WT
  • NEWBIE
  • 50 Points
  • Member since 2009

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 5
    Replies

Has anyone else noticed that line number scrolling broken in Eclipse 3.4 on Mac OS? I did read one blog post that identifies the issue. This makes it EXTREMLY hard to track down errors by line number. Eclipse 3.5 is rumored to work fine.

 

Can anyone comment on when the Force.com IDE might work with Eclipse 3.5?

  • October 11, 2009
  • Like
  • 0

I'm sending a text email with a custom object, ObjectX__c, as the related to object, from a Workflow rule. I'd like to include some information from a parent lookup contact, ObjectY__c, in this email. I also have ANOTHER parent lookup contact, ObjectZ__c on ObjectX__c.

 

I was thinking I could use this syntax:

 

{!ObjectX__c.ObjectY__c.fieldname__c}

 

or maybe

 

{!ObjectX__c.ObjectY__r.fieldname__c} (note the __r instead of __c)

 

Neither works. Both just result in a blank. The odd thing is, if I do merely

 

{!ObjectX__c.ObjectY__c.}

 

I get the contact name for the related ObjectY__c as I would expect.

 

Any ideas?

I need to determine whether a user has write access to a given SObject record. There are a couple ways I know to do this, both with distinct downsides. First, I can simply do a try/catch update on the record, but that changes the last-modified date, and has some other issues with security in a managed package.

 

Second, I can crawl the SObject__Share object, and figure things out from there. The problem there, I discovered, is that once you reference an xxx__Share object in Apex, you can no longer change the sharing rules for that xxx object. It complains "Unable to change sharing model because sharing objects are referenced by the following components: Apex.cls"

 

I saw in a thread from over a year ago that SF recognized a need for this. Has it been included in the platform yet?

 

Thanks. 

I've got a trigger that potentially updates hundreds of opportunity records, with input from possibly thousands of records from other objects. So I've resorted to a future call to get around the query limits.

 

I thought this was a good solution, until I got an UNABLE_TO_LOCK_ROW error during the execution of one of these triggers. I'm assuming that this is because, when the @future call got to the record in question, it was, by an amazing coincidence, being updated by another user or trigger.

 

My two questions:

 

1: How do I get around this problem? This trigger's only been in place for a day, and I've already gotten the error, so I expect to see it again. More broadly, is @future the right route for my situation?

 

2: Was only the one opportunity update not executed, or did the entire @future call fail? The text of the failure ("Failed to invoke future method 'public static void acctBasedUpdate(LIST:String, LIST:String)" ) makes it seem like the entire @future call failed.

 

Thanks. 

Message Edited by MWelch_WT on 03-09-2010 07:18 AM

I need to get the the site-wide URL for Sites (xxxxxx.force.com) in Apex, in order to send and email with a link to a Sites site. Is there a way to do this? I could hard code it, but this will be for a managed package.

 

Bonus points if you  can tell me how to get the server (na3, na6, na7, etc) from within a Sites site, so that a "contact us" form can send an email to a User.

I'd like to run a SOQL query based on a list of IDs somehow passed in to a VF email template controller. Something like this:

 

 

Opportunity Opps=[select Name from Opportunity where id in :IDList];

 


Problem is, I can't figure out how to pass in that previously populated IDList. The end goal here is to allow the customer to select a bunch of Opportunities about which to send some emails, while at the same time giving him the ability to modify the template to his liking.

 

Any input? 

I've got a VF datatable displaying about 35-40 rows, iterating over a list of a wrapper class, which contains a custom object.  The resulting table has about 450-550 inputtext fields and 450-550 hidden input fields.  I know it sounds like a user interface nightmare, but for this application, it actually works pretty well.

 

The problem is that, once we do get up to the 35 or 40 rows, the performance is terrible.  Adding another row takes 5-10 seconds.  Same with deleting a row.  I've got some AJAX-y stuff happening onchange on each inputtext field, as well, and that's brutally slow, too.

 

I think I've got the controller pretty tight, as, if I comment out all the inputtext and hidden fields, and just let the vf and controller iterate over the table, performance is pretty good.

 

Are there any techniques I can employ, on the VF or Apex side, that'll increase the performance?  I've tried messing with actionRegion, but that doesn't seem to have any effect.

 

Worse case is I have to rewrite to present much less editable content at once, but that really will get in the way of the end-users' workflow.

 

Thanks for any input. 

There's either a bug with the platform, or with the developer (me).  The following code yields a system crash:

 

	public ApexPages.StandardSetController leadSet {		get {			if(leadSet == null) {				leadSet = new ApexPages.StandardSetController(Database.getQueryLocator([select  id, name from Account where id=null]));				List<SelectOption> lvl=leadSet.getListViewOptions();				system.debug('size: '+lvl.size()); // Fail is here			}			return leadSet;		}		set;	}

 

What I'm trying to do is fetch a list of possible filter IDs, and set the filter ID to something, just so there's some initial valid value.  However, anytime I try to do any list-type things to my SelectOption list returned from getListViewOptions, I get a crash.  I can't call size() or for-loop iterate.  I can't even do lvl[0].  Just shuts the whole thing down with the "Internal Server Error."

 

Am I doing something completely wrong here? 

I need to allow the user to perform an operation on any number of records of a specific object.  Rather than building a whole custom list view VF page and controller, I though I'd see if I could leverage the enhacnedList VF element first.

 

I note that the enhancedList has checkboxes next to each entry, as well as a "select all" checkbox at the top.  Is there any way to get the list of selected records back to the controller to be operated on?  I can't see what other purpose the checkboxes might have, unless I'm missing something obvious. 

 

Thanks for any input. 

On some VF pages I build, the collapsible functionality of a pageBlockSection doesn't work.  Looking in to it, I find that the js code with the twisty functions (stuff like twistsection() and the like) is not inserted on these failing pages.

 

It generally happens on my more complex VF pages, with nested pageblock elements.  Is this a known bug, and are there things I can do to avoid it?

Hello,

 

I'm trying to show a page containing a bunch of pageblocks  generated from a controller List.  I'd like each pageblock to be individually identifiable, by doing something like this:

 

 

<apex:repeat value="{!controllerVariable}" var="cv"> <apex:pageBlock id="pb{!cv.cvid}"> ... ... ...

 

The problem is, that I get the following error when I try to save a VF page with this kind of code in it:

 

Error: id="mp{!cv.cvid}" core.apexpages.el.adapters.exceptions.UnknownPropertyException: Unknown property 'cv'

 

You might expect that my "cv" var isn't being generated correctly, but that's not the case.  If I change the code as follows:

 

 

<apex:repeat value="{!controllerVariable}" var="cv"> <apex:pageBlock id="pb"> This is the expected id: {!cv.cvid} ... ... ...

 

The page saves just fine, and the correct cvid is displayed when I navigate to that page.

 

I've looked around, but didn't see anything similar.  Does the platform support  using controller variables in id attributes?  And, if not, how else might I go about making repeating sections of the page individually identifiable?

 

 

I've got the basics coded for uploading a photo from a VF page into Document, associating it with an sObject (through the hack of putting the sObject's id in the "keyword" field of the document object).  This is all working more-or-less OK.

The problem is all the "clutter" that accumulates in the documents tab for the end user.  I've put the uploaded images in a folder that we will instruct our users to leave alone, but these images show up under "Recent Documents" in the Documents tab, pushing other "real" documents off.

Is there a way to manipulate the "Recent Documents" listing to ignore my uploaded images?  Or, am I completely missing a much more elegant way of uploading images and associating them with an sObject.

Thanks for any input.

I'm trying to massage a VF email template a little bit in Apex, and am seeing some strange behavior with the emailTemplate standard object.  I use the following Apex code to grab the id, body, and markup of a VF template:

 

 

emailTemplate et = [SELECT id, body, markup, htmlvalue, templatestyle, templatetype from emailtemplate where name='Basic Inquiry Template']; templateBody=et.id+'<br>'+et.body+'<br>'+et.markup;

 

On the following VF email template:

 

 

<messaging:emailTemplate subject="Test Subject" recipientType="Contact" relatedToType="Account" > <messaging:plainTextEmailBody > Test plain Text Body. </messaging:plainTextEmailBody> </messaging:emailTemplate>

 

 When I look at the result, et.id is correct, and et.markup is correct, but et.body, which I would expect to read "Test plain Text Body." instead reads "Congratulations! This is your new Visualforce Email Template." which is the default text from when you first create a new VF email template.  I deleted that long ago!

 

One added data point is that the template, when invoked from a "Send an Email" page, works as expected, inserting "Test plain Text Body" in the body of the email.

 

Any ideas what's going on here?

 

 

 

I'm trying to come up with a way to edit and send email from a custom object.  This topic was addressed briefly in this thread from last summer: Email page with Template but at the time there didn't seem to be any solution.

 

I'm OK with building my own VF page and accompanying class, which wouldn't be too hard.  Where the problem arises, though, is when trying to use templates.  It seems to me that I'd have to rebuild some kind of template parser if I wanted to be able to edit the email after a template has been applied.  (This is assuming I could even read in the raw template source to begin with.)  Needless to say, the complexity scales significantly at this point.

 

I was wondering if any more elegant solution had been discovered or introduced since then.

 

Thanks for any help.

I need to get the the site-wide URL for Sites (xxxxxx.force.com) in Apex, in order to send and email with a link to a Sites site. Is there a way to do this? I could hard code it, but this will be for a managed package.

 

Bonus points if you  can tell me how to get the server (na3, na6, na7, etc) from within a Sites site, so that a "contact us" form can send an email to a User.

Has anyone else noticed that line number scrolling broken in Eclipse 3.4 on Mac OS? I did read one blog post that identifies the issue. This makes it EXTREMLY hard to track down errors by line number. Eclipse 3.5 is rumored to work fine.

 

Can anyone comment on when the Force.com IDE might work with Eclipse 3.5?

  • October 11, 2009
  • Like
  • 0

Hello,

 

I'm trying to show a page containing a bunch of pageblocks  generated from a controller List.  I'd like each pageblock to be individually identifiable, by doing something like this:

 

 

<apex:repeat value="{!controllerVariable}" var="cv"> <apex:pageBlock id="pb{!cv.cvid}"> ... ... ...

 

The problem is, that I get the following error when I try to save a VF page with this kind of code in it:

 

Error: id="mp{!cv.cvid}" core.apexpages.el.adapters.exceptions.UnknownPropertyException: Unknown property 'cv'

 

You might expect that my "cv" var isn't being generated correctly, but that's not the case.  If I change the code as follows:

 

 

<apex:repeat value="{!controllerVariable}" var="cv"> <apex:pageBlock id="pb"> This is the expected id: {!cv.cvid} ... ... ...

 

The page saves just fine, and the correct cvid is displayed when I navigate to that page.

 

I've looked around, but didn't see anything similar.  Does the platform support  using controller variables in id attributes?  And, if not, how else might I go about making repeating sections of the page individually identifiable?

 

 

I've got the basics coded for uploading a photo from a VF page into Document, associating it with an sObject (through the hack of putting the sObject's id in the "keyword" field of the document object).  This is all working more-or-less OK.

The problem is all the "clutter" that accumulates in the documents tab for the end user.  I've put the uploaded images in a folder that we will instruct our users to leave alone, but these images show up under "Recent Documents" in the Documents tab, pushing other "real" documents off.

Is there a way to manipulate the "Recent Documents" listing to ignore my uploaded images?  Or, am I completely missing a much more elegant way of uploading images and associating them with an sObject.

Thanks for any input.

I'm trying to mimic creating a New Event from the related list section (Open Activities) on Opportunity page through a custom button (called "New Event X"). This custom button, on clicking, should open a visualpage in edit mode. This visualpage is based on a standard controller for Event, has fields from Event and a few other objects.

Here's the problem- I have the visualpage created, but can't attach it to the custom button because the button type is "List Button" and the page is based on a standard controller for Event. If I change the button type to Detail Page Button then I can attach the visualpage to it, but Salesforce requires the custom button to be of "List Button" type in order for it to appear on the related list section of Opportunity page.

I don't want to override the standard button "New Event". It seems like a pretty common requirement, and I'm wondering how others have done it.

Any help would be much appreciated. Thanks in advance.

 

Vas

  • February 05, 2009
  • Like
  • 0