• JimPDX
  • NEWBIE
  • 25 Points
  • Member since 2006
  • Disruptive Technology Evangelist
  • Innersanctum Inc / GreatVines

  • Chatter
    Feed
  • 1
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 31
    Replies
Would you please help me to display Notes & Attachments on a Visual Force page having CUSTOM controller ?
Is there any tag for it ?

I have seen similar issues posted to this board but the answers have not yet answered my question. Getting this error:

 

Error: Compile Error: Illegal assignment from LIST<Task> to SOBJECT:Account at line 9 column 13

 

from this trigger code:

 

trigger Update_Attachment_Parent on Attachment (after insert, after update) {
    //Create a List to store the Ids of Attachments to be deleted
    List<Id> forDeletionIds = new List<Id>();
    for (Attachment a : trigger.new){
        //Check to see if the Attachment has a Task as the Parent Record
        String parentIdString = String.valueof(a.parentId);
        if (parentIdString.substring(0,3) == '00T'){
            //Select the AccountId from the Task
            Account parent = [SELECT AccountId FROM Task WHERE WhatId = :a.parentId];
            //Check to see if the Account exists
            if (parent.AccountID != null){
                //Select the Attachment body (it isn't in memory for an update)
                Attachment body = [SELECT Body FROM Attachment WHERE Id = :a.Id];
                //Create a new Attachment, preserving as much as is possible
                Attachment newA = New Attachment(
                    Name = a.Name,
                    Body = body.Body,
                    ContentType = 'image/jpeg',
                    Description = 'Account Photo',
                    OwnerId = a.OwnerId,
                    ParentId = parent.AccountId
                );
                //Insert the new Attachment
                insert newA;
                //Add the now duplicate Attachment ID to a list
                forDeletionIds.add(a.Id);
            }
        }
    }
    //List and then delete all duplicate Attachments
    List<Attachment> forDeletion = [SELECT Id FROM Attachment WHERE Id IN :forDeletionIds];
    delete forDeletion;
}

 Any help would be appreciated. I'm sure it is a simple tweak that I am overlooking but I need to roll these updates into this org ASAP. Thanks!

We are doing a massive upgrade of an org with a managed package. The package must be switched out with a new version (since managed packages can't be changed). Unfortunately we have about 200 custom fields on top of a managed package component. I can't seem to find the meta-data in the IDE. I know that there is a section for "Referenced Packages" which shows the schema of the packaged object only, no customizations. Also I can't see the customizations under src -> objects either. I would really like to copy and paste the XML and not recreate these 200 fields from scratch. Any ideas??

  • March 12, 2011
  • Like
  • 3

I could use the help of a report guru here. In our Force.com package we have a simple field that allows us to compare sales data from prior years with a "this year to date vs last year to date". Essentially we don't count any volume data for a month prior to this month. Seems easy enough.

 

 

IF(MONTH( DATEVALUE(gvn__Order_Date__c) ) <= (MONTH(TODAY()) + 12),  
gvn__Extended_Price__c , 0)

Now we have a customer whose Fiscal year starts on July 1st. This means that data for December should count in April but data in April shouldn't count in December. Does that make sense? I thought it would be as easy as adding 12 to the month or something but that fails pretty quickly.

 

This seems like it should be extremely basic. I have a VF template both relatedToType and recipientType = "Lead". I have two simple apex components to provide style sheets and signature (personalized to the user). When I preview the template within Setup, and specify a Lead record, it shows the customized text and personalized signature.

 

When my user started testing it, she complained that the "Send Email" button on the Lead (after selecting the template) was not inserting the field from the object. It had worked for me previously. So I tested it and am now having the same problem. Previews fine but when I send it, the merge data ("Lead.Email_Text__c") does not appear and the field "Program__c" is not being sent to the component as an attribute either. Again both merge fields work fine in Preview mode.

 

We must be overlooking something obvious here? The components and attributes are global. The lead records are shared publicly (not that it should matter if I am using the template on an object I own).

 

Any ideas? Thanks. 

  • September 27, 2009
  • Like
  • 0

I have been testing my VF pages in the updated sandbox. On two different VF pages (standard controllers) I am getting warning messages which don't pertain to my code at all... e.g. referencing an apex:component tag which doesn't exist. Is anyone else noticing issues? There is not a single <th> tag in my code at all, nor is there a component. Ideas?

 

 

Warning

 
 
  • Open quote is expected for attribute "colspan" associated with an element type "th". at line 8
  • The element type "apex:component" should be terminated by the matching end-tag "</apex:component>". at line 2
  • The element type "apex:component" should be terminated by the matching end-tag "</apex:component>". at line 12

 

  • September 23, 2009
  • Like
  • 0

Hello. We are using a Visualforce page to store HTML in a field called "Email_Text__c" using this:

 

 

<apex:inputTextarea value="{!Lead.Email_Text__c}" richText="true" cols="40" rows="8"/>

 

 In my email template I insert this value as follows:

 

 

<body><p class="style11">{!Lead.Email_Text__c}</p>

 

When we send an email and select the template containing this value we see the escaped HTML in the body of the email itself. Can anyone think of ways to address this? It is important that our users be able to leverage the embedded wysiwyg editor on the field itself.

 

 

Dear Frank,Hello there. Nice <strong>meeting</strong> you.<br /> <br /> I would like to discuss X, Y and Z. Let's get together <em>soon</em>.<br type="_moz" />

 

 

 

 

 

  • September 21, 2009
  • Like
  • 0

My users LOVE our new custom UI we just rolled out (a custom Lead UI with embedded tabs and extra logic, etc.) but the one thing they miss is the "<- Back to (prior)" which they often use to go back to the Lead list view. We can't simply do a javascript back because we reload the page when it saves, etc. Any advice? I searched the VF docs for a simple call which I could use to replicate this handy feature of the native page layouts.

 

Help appreciated. 

Message Edited by jimson on 09-09-2009 01:50 PM
  • September 09, 2009
  • Like
  • 0

We have run into an inconsistency between the same page being served within the app (c.na6.visual.force blah blah) and the live Sites page. Here is the output followed by the code.... The page on the Sites URL is not showing the related product (wine) Name...

https://c.na6.visual.force.com/apex/test [^]

a0G80000001H0hHEAS ---- IX04RED750
a0G80000001HDntEAG ---- HL93CAB750
a0G80000001HDnpEAG ---- IX02CAB750
a0G80000001HDnoEAG ---- HL92CAB750

http://colgin.force.com/test [^]

a0G80000001H0hHEAS ----
a0G80000001HDntEAG ----
a0G80000001HDnpEAG ----
a0G80000001HDnoEAG ----


The basic join is as follows:


[Select Wine__r.Id, Wine__r.Name, Id From Offering_Wine__c]
Wine__r.Name. Wine__r.Id

 



Here is the page which produces it (ugly test code obviously)

<apex:page cache="true" showHeader="false" sidebar="false" controller="testclass">
<br><br><br><br>
<apex:form >
<apex:commandButton action="{!invite_email}" value="Save" id="theButton"/>
</apex:form>
{!TestAcc.Id} ---- {!TestAcc.Wine__r.Name}
<br><br><br>
<apex:repeat value="{!TestAcc2}" var="Te">
{!Te.Id} ---- {!Te.Wine__r.Name}
<br/>
</apex:repeat>
NM-{!TestAcc3}
</apex:page>

 

 

Ideas? At first I suspected "Public Access Settings" but I don't believe that is it? They have read perms on all the objects involved.

Message Edited by jimson on 03-05-2009 03:47 PM
  • March 05, 2009
  • Like
  • 0

Hoping someone has some ideas on how to handle this easily.

 

We are developing an application which consists of two packages. We have separated them for important, strategic reasons. We are making improvements to both packages (in two DE orgs) and now I need to upgrade the lower-level package in the DE org of the higher-level package. Because they are both managed "Beta" I can not upgrade but rather need to remove the lower-level package (uninstall) and install again. But I can't do that because my apex code requires the low-level package.

 

Help!? 

  • February 20, 2009
  • Like
  • 0

Sorry for what might be a stupid question here. I would like the file reference within my URLFOR($Resource) to be dynamic - either a variable set in my controller or in the VF page itself. Can this be done? I am trying to show dynamic images within a page based on which page you are on. Thx.

 

  • January 31, 2009
  • Like
  • 0

So I had this all working a week ago but I had to remove my VF code so I could uninstall a managed package. For some reason I can NOT choose my VisualForce page to be used to override the New button on a custom object. Again this was working one week ago before I moved my code out and back in. Can anyone give me reasons why a valid, VisualForce page (one that runs fine when attached to a custom Tab) would not be select-able in the button override function?

 

Thanks! 

  • January 22, 2009
  • Like
  • 0
So I have decided that I need to encrypt some custom fields. Unfortunately I have already made them part of a managed released package. One of the fields I want to encrypt was set as an "External ID" so of course it can not be encrypted and therefore needs to be replaced with another field with a similar or same name but not external ID. Unfortunately from my limited experience this seems to take a LONG time, since you can't delete a referenced field.

So it seems that I have to:
1- Completely remove any references to this field from ALL apex classes (commenting out won't work)
2- Delete the old field entirely
3- Create a new field
4- Add code back into the classes to reference the new field.

Is there an easier way? If not, will I be OK if the new field also has the same field name?
  • January 14, 2009
  • Like
  • 0
http://ideas.salesforce.com/article/show/74529/Lookup_Fields_for_other_objects (Link)

Not my idea but would be incredibly useful (per my comment) on Sites related projects when attempting to link "Document" records to other objects. The new storage pricing encourages customers to utilize document storage for things like site images (high-res, not structural like GIFs which would likely be static resources). This would help link images stored in documents directly to objects (articles) or linking objects which map images to pages for example. Would eliminate the need for lots of complex APEX to connect one to the other. Thoughts?

Message Edited by jimson on 01-06-2009 12:01 AM

Message Edited by jimson on 01-06-2009 12:01 AM
  • January 06, 2009
  • Like
  • 0
I am trying to move an older site (table-based) with a heavy include structure (php) into my developer org as VF pages and later a full Site implementation. I am using a combination of static resources for structural images and starting to utilize VF components for the larger blocks of code such as a tradition header include, navigation include and footer. Each of these needs to be dynamic which won't be a problem with APEX, although I seem to be unable to reference Static Resources from within other resource files such as CSS and JavaScript. Obviously I don't want to hard-code image paths into CSS url attributes. Am I missing an obvious workaround to include dynamic references within other static resources?

That was not even the main question I intended to post... In creating my larger includes, I have begun getting save errors on open tags, such as a container table (did I mention this was a site from 2000?) or the BODY tag itself. Is there a way to use APEX tags in VisualForce to open the body element without it causing compile errors?

Appreciate any advice folks may have.
  • December 16, 2008
  • Like
  • 0
We are trying to create a dashboard component using GViz (Google Visualizations). However this component does not appear on the Mobile edition (BlackBerry). Since the code requires client-side processing, is there any other way to accomplish this?

A separate but related question, assuming the answer above is "No" - can you programatically update dashboard component settings (like gauge breakpoints) over the API or with Apex?
  • November 10, 2008
  • Like
  • 0
I am excited about the possibilities of what Force.com Sites will bring to the world of platform software development and web marketing. Having a much deeper knowledge of web technology, SEO and marketing than I do with even CRM, I see infinite possibilities. I connected with the Product Managers at Dreamforce and hope to feed them some good ideas as to how to shape this new capability to include general best practices. I am curious to hear what others think about the possibilities.

In the meantime, I have posted the first of hopefully many ideas in this space relating to URL structures and how they might map to Apex pages. Please take a moment to read and vote if you agree. Anyone who has built a commercial site lately with dynamic data will agree with the critical nature of this feature. Afterall who wants to go back to www.mysite.com/controllerPage?id=0034000000PZ9B2 when our Force.com sites could look like www.mysite.com/pages/support.

IDEA:
http://ideas.salesforce.com/article/show/10093787/URL_Rewrites_for_Salesforce_Sites
  • November 06, 2008
  • Like
  • 0

We decided to build a highly customized AJAX front-end to our Leads data, which we renamed to Inquiries. The reason was that we have about 180 custom fields and the built-in UI would have been a pain to work with and train my users on. Coming from a custom development background, I really had a very specific UI in mind and wanted certain fields to always be present on the screen rather than scrolling away.



We opted for an AJAX methodology so that we could eliminate the need for a submit button, create some auto-save and onunload() save functionality, and update certain fields based upon other field selections. Dependent picklists would not have given us enough flexibility.



So we rolled out this massive sforce control last week and the biggest problem we are having is load time. It takes a few seconds for Salesforce to load the control and display it to the browser (we have optimized for Firefox) and then it can take anywhere between 4 and 10 seconds to load all the necessary data. When this is done on a typical user's computer, it can take 15 seconds or more before they can begin interacting with the data.



Here is a link to the code. If you have any suggestions of ways to speed it up, please let me know or post it here. I appreciate any insight that any of you could give. My user's are pulling their hair out waiting to edit a "Lead" or create a new one. It is a call center for drug and alcohol treatment and we handle tons of calls per day.



http://marketingcrc.com/salesforce/ajax_060109.txt



AJAX Toolkit Beta 2

  • January 10, 2006
  • Like
  • 0

We are doing a massive upgrade of an org with a managed package. The package must be switched out with a new version (since managed packages can't be changed). Unfortunately we have about 200 custom fields on top of a managed package component. I can't seem to find the meta-data in the IDE. I know that there is a section for "Referenced Packages" which shows the schema of the packaged object only, no customizations. Also I can't see the customizations under src -> objects either. I would really like to copy and paste the XML and not recreate these 200 fields from scratch. Any ideas??

  • March 12, 2011
  • Like
  • 3

I have seen similar issues posted to this board but the answers have not yet answered my question. Getting this error:

 

Error: Compile Error: Illegal assignment from LIST<Task> to SOBJECT:Account at line 9 column 13

 

from this trigger code:

 

trigger Update_Attachment_Parent on Attachment (after insert, after update) {
    //Create a List to store the Ids of Attachments to be deleted
    List<Id> forDeletionIds = new List<Id>();
    for (Attachment a : trigger.new){
        //Check to see if the Attachment has a Task as the Parent Record
        String parentIdString = String.valueof(a.parentId);
        if (parentIdString.substring(0,3) == '00T'){
            //Select the AccountId from the Task
            Account parent = [SELECT AccountId FROM Task WHERE WhatId = :a.parentId];
            //Check to see if the Account exists
            if (parent.AccountID != null){
                //Select the Attachment body (it isn't in memory for an update)
                Attachment body = [SELECT Body FROM Attachment WHERE Id = :a.Id];
                //Create a new Attachment, preserving as much as is possible
                Attachment newA = New Attachment(
                    Name = a.Name,
                    Body = body.Body,
                    ContentType = 'image/jpeg',
                    Description = 'Account Photo',
                    OwnerId = a.OwnerId,
                    ParentId = parent.AccountId
                );
                //Insert the new Attachment
                insert newA;
                //Add the now duplicate Attachment ID to a list
                forDeletionIds.add(a.Id);
            }
        }
    }
    //List and then delete all duplicate Attachments
    List<Attachment> forDeletion = [SELECT Id FROM Attachment WHERE Id IN :forDeletionIds];
    delete forDeletion;
}

 Any help would be appreciated. I'm sure it is a simple tweak that I am overlooking but I need to roll these updates into this org ASAP. Thanks!

I have an ok understanding of apex and I am new to VPM (Flow Designer).

 

I am trying to get "Apex Callout" to work with a class i have but am not getting anywhere. After opening the flow designer pdf i came across the following statement:

 

"The visual Apex callout element allows you to call an Apex class with the Process.Plugin interface"

What is the process.plugin interface? because i am getting the following error when uploading the flow into Salesforce

"ErrorWe had trouble uploading the flow. Apex class does not exist or is not a plugin class: FlowDesignerISA.GetISAamount"

Can anyone help?
Thanks in-advance.

  • March 08, 2011
  • Like
  • 0

I could use the help of a report guru here. In our Force.com package we have a simple field that allows us to compare sales data from prior years with a "this year to date vs last year to date". Essentially we don't count any volume data for a month prior to this month. Seems easy enough.

 

 

IF(MONTH( DATEVALUE(gvn__Order_Date__c) ) <= (MONTH(TODAY()) + 12),  
gvn__Extended_Price__c , 0)

Now we have a customer whose Fiscal year starts on July 1st. This means that data for December should count in April but data in April shouldn't count in December. Does that make sense? I thought it would be as easy as adding 12 to the month or something but that fails pretty quickly.

 

Hello. We are using a Visualforce page to store HTML in a field called "Email_Text__c" using this:

 

 

<apex:inputTextarea value="{!Lead.Email_Text__c}" richText="true" cols="40" rows="8"/>

 

 In my email template I insert this value as follows:

 

 

<body><p class="style11">{!Lead.Email_Text__c}</p>

 

When we send an email and select the template containing this value we see the escaped HTML in the body of the email itself. Can anyone think of ways to address this? It is important that our users be able to leverage the embedded wysiwyg editor on the field itself.

 

 

Dear Frank,Hello there. Nice <strong>meeting</strong> you.<br /> <br /> I would like to discuss X, Y and Z. Let's get together <em>soon</em>.<br type="_moz" />

 

 

 

 

 

  • September 21, 2009
  • Like
  • 0

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 !

I am using an outputText tag along with a param tag to format a date file.  This works quite well in the sprin'09 release.  I get compile errors in Summer '09.  Here is a simple page that works in spring'09 but gets an error on save in the summer '09 release.

<apex:page >
  <h1>Congratulations</h1>
  This is your new Page
            <apex:outputText value="{0,date, MMMM d', 'yyyy}">
                <apex:param value="{!NOW()}" />
            </apex:outputText>

</apex:page>

 

The error message I get in summer '09 is below.  Does anyone have any idea how to get around this?  I have opened a case on this - the number is 02709898

 

 

Error: The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.

 

 

 

 

Error 

 

Message Edited by dchasman on 06-08-2009 01:00 PM

We have run into an inconsistency between the same page being served within the app (c.na6.visual.force blah blah) and the live Sites page. Here is the output followed by the code.... The page on the Sites URL is not showing the related product (wine) Name...

https://c.na6.visual.force.com/apex/test [^]

a0G80000001H0hHEAS ---- IX04RED750
a0G80000001HDntEAG ---- HL93CAB750
a0G80000001HDnpEAG ---- IX02CAB750
a0G80000001HDnoEAG ---- HL92CAB750

http://colgin.force.com/test [^]

a0G80000001H0hHEAS ----
a0G80000001HDntEAG ----
a0G80000001HDnpEAG ----
a0G80000001HDnoEAG ----


The basic join is as follows:


[Select Wine__r.Id, Wine__r.Name, Id From Offering_Wine__c]
Wine__r.Name. Wine__r.Id

 



Here is the page which produces it (ugly test code obviously)

<apex:page cache="true" showHeader="false" sidebar="false" controller="testclass">
<br><br><br><br>
<apex:form >
<apex:commandButton action="{!invite_email}" value="Save" id="theButton"/>
</apex:form>
{!TestAcc.Id} ---- {!TestAcc.Wine__r.Name}
<br><br><br>
<apex:repeat value="{!TestAcc2}" var="Te">
{!Te.Id} ---- {!Te.Wine__r.Name}
<br/>
</apex:repeat>
NM-{!TestAcc3}
</apex:page>

 

 

Ideas? At first I suspected "Public Access Settings" but I don't believe that is it? They have read perms on all the objects involved.

Message Edited by jimson on 03-05-2009 03:47 PM
  • March 05, 2009
  • Like
  • 0

Hi,

 

   I am developing a web application through visualforce. I have added a static resource javascript file which 

requires an image file to be called. I have put the images into /img folder and the javascript file(yyyyy.js) into /js folder and zipped folders into (XXXXXXX.zip) and added as a static resource with the name XXXXXXXZip

and added the code in my page as

 

 <script type="text/javascript" src="{!URLFOR($Resource.XXXXXXXZip, 'yyyyy.js')}"/>

 

But still i am not able to display the images.

 

Regards,

Ravindra

Sorry for what might be a stupid question here. I would like the file reference within my URLFOR($Resource) to be dynamic - either a variable set in my controller or in the VF page itself. Can this be done? I am trying to show dynamic images within a page based on which page you are on. Thx.

 

  • January 31, 2009
  • Like
  • 0

How to display a specific format for a datetime field  on a Site page. I am a newbie in development of Force and Apex so I am not sure to know the best way to do it.

 

My date appear like this

 

Sun Jan 25 23:31:59 GMT 2009 english format however my guest web user local setting are french...

 

Thanks for your help

 

Regards,

 

Pascal

 

So I had this all working a week ago but I had to remove my VF code so I could uninstall a managed package. For some reason I can NOT choose my VisualForce page to be used to override the New button on a custom object. Again this was working one week ago before I moved my code out and back in. Can anyone give me reasons why a valid, VisualForce page (one that runs fine when attached to a custom Tab) would not be select-able in the button override function?

 

Thanks! 

  • January 22, 2009
  • Like
  • 0
Would you please help me to display Notes & Attachments on a Visual Force page having CUSTOM controller ?
Is there any tag for it ?

I have run into this error message when trying to use dynamic SOQL for the first time. I am running the query in a managed package, but the object I am working with is in the same managed package, the package api is unrestricted, and my profile is system admin with full rights. Can anyone think of any other settings that would be causing restricted access?

-David
Hi Everyone,

I added a custom formula field to the cases object.  I want to show the account owner on the cases screen, but can't seem to get it right.

Here is what I am currently using for the formula:

Account.OwnerID

But, of course, this shows the ID, rather than the actual user name.  What can I do???

I'm banging my head against the wall.  This can't be so hard! :smileymad:

Thanks!

Joseph
Hello all !!

I have to do a find and replace a string on a variable (string). I know there is a matcher object but I couldnt find much documentation on the usage. Any one else used this object ? or is there any other simple function to get this done. Pls help

Thanks
Raghu


Message Edited by Raghu_dev on 05-14-2008 05:45 PM
This question seems incredibly basic, but I've been searching for hours trying to find the answer.

I want a report that calculates the Lead conversion percentage, that I can further break down into lead conversion percentage by (whatever custom lead field).

Do I start with a custom formula that calculates the total lead count?

Is it possible that this isn't an obvious calculation that already exists?

thanks for any help,

dave