• icemft1976
  • NEWBIE
  • 70 Points
  • Member since 2007

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 40
    Replies

This is my first attempt at tweaking an APEX. It is a e-mail template for Invoice which is generated from "Send E-mail" within Opportunity. I am getting: " Error: Unknown property 'core.email.template.EmailTemplateComponentController.Opportunity' " when I am trying to save. What am I missing here?

 

 <messaging:emailTemplate subject="Your invoice" recipientType="Contact"  
relatedToType="Opportunity">
<messaging:htmlEmailBody >
 
<table border="0" cellspacing="0" cellpadding="10" width="700" id="table1" align="center">
<tr>
    <td width="230">
        <img src='{!URLFOR($Resource.PixLogo70pix)}' title=" Logo" />
    </td>
    <td align="right"><font face="Arial" size="2" color="#666666"> One Broadway<br />
    </font>
    </td>  
</tr> 
</table>
<center>
    <p style="font-family:Arial;font-size:22px;font-weight:bold;color:#666666;">INVOICE</p>
</center>
<br/>
 
<table border="0" cellspacing="0" cellpadding="5" width="800" id="table1" align="center">
<tr>    <td valign="top">
    <font face="Arial" size="2" color="#666666">
    Bill To:</font><br />
    <font face="Arial" size="2">
    {!Opportunity.Account.Name}<br/>
    {!Opportunity.Account.BillingStreet}<br/>
    {!Opportunity.Account.BillingCity}, {!Opportunity.Account.BillingState} {!Opportunity.Account.BillingPostalCode}<br/>
    {!Opportunity.Account.BillingCountry}<br/>
  </font>
</td> 
        <td>&nbsp;</td>
   <td valign="top">
     <font face="Arial" size="2">
   <font color="#666666">Account Name:</font> <br/>
   {!Opportunity.Account.Name}<br/>
   <font color="#666666">Invoice Number:</font> <br/>
   {!Opportunity.Project_number__c}<br/>
   <font color="#666666">Invoice Date:</font> <br/>
   {!Opportunity.CloseDate}<br />
   <font color="#666666">Payment Terms:</font> <br/>
   <font color="#FF3300">Due Upon Receipt</font></font></td>    
</tr>
</table>
<br/>
 
<table width="800" border="0" align="center" cellpadding="3" cellspacing="1" id="table4">
<tr bgcolor="#E5E5E5"><font face="Arial" size="2" color="#666666">
       <td>Product</td>
      <td>Description</td>
       <td>Quantity</td>
       <td>Unit Price</td>
       <td>Total Price</td>
       </font>
</tr>
<tr><font face="Arial" size="2" color="#000000">
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td>{!line.PricebookEntry.Name}</td>
             <td>{!line.Description}</td>           
             <td>{!line.Quantity}</td>
             <td><apex:OutputField value="{!line.UnitPrice}"/></td>
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
          </tr>
       </apex:repeat>  
       </font>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial" size="2">Sub-total:&nbsp;<apex:OutputField value="{!Opportunity.Sub_Total__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial" size="2">Discounts:&nbsp;<apex:OutputField value="{!Opportunity.Discount_amount__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial">Tax:&nbsp;<apex:OutputField value="{!Opportunity.Sales_Tax__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#E5E5E5" align="right" colspan="5">
       <font face="Arial"><b>Total:</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>
<br/>
 
<p align="center"><font face="Arial">Thank you very much for you business!<br />
{!Opportunity.CreatedBy.FirstName} {!Opportunity.CreatedBy.LastName}
</font></p>
</messaging:htmlEmailBody>
 
<messaging:attachment renderAs="pdf" filename="{!relatedTo.name}">  
<table border="0" cellspacing="0" cellpadding="10" width="700" id="table1" align="center">
<tr>
    <td width="230">
        <img src='{!URLFOR($Resource.PixLogo70pix)}' title="Pixability Logo" />
    </td>
    <td align="right"><font face="Arial" size="2" color="#666666"> One Broadway<br />
</font>
    </td>  
</tr>
</table>
<center>
    <p style="font-family:Arial;font-size:22px;font-weight:bold;color:#666666;">INVOICE</p>
</center>
<br/>
 
<table border="0" cellspacing="0" cellpadding="5" width="800" id="table1" align="center">
<tr>    <td valign="top">
    <font face="Arial" size="2" color="#666666">
    Bill To:</font><br />
    <font face="Arial" size="2">
    {!Opportunity.Account.Name}<br/>
    {!Opportunity.Account.BillingStreet}<br/>
    {!Opportunity.Account.BillingCity}, {!Opportunity.Account.BillingState} {!Opportunity.Account.BillingPostalCode}<br/>
    {!Opportunity.Account.BillingCountry}<br/>
  </font>
</td> 
        <td>&nbsp;</td>
   <td valign="top">
     <font face="Arial" size="2">
   <font color="#666666">Account Name:</font> <br/>
   {!Opportunity.Account.Name}<br/>
   <font color="#666666">Invoice Number:</font> <br/>
   {!Opportunity.Project_number__c}<br/>
   <font color="#666666">Invoice Date:</font> <br/>
   {!Opportunity.CloseDate}<br />
   <font color="#666666">Payment Terms:</font> <br/>
   <font color="#FF3300">Due Upon Receipt</font></font></td>    
</tr>
</table>
<br/>
 
<table width="800" border="0" align="center" cellpadding="3" cellspacing="1" id="table4">
<tr bgcolor="#E5E5E5"><font face="Arial" size="2" color="#666666">
       <td>Product</td>
      <td>Description</td>
       <td>Quantity</td>
       <td>Unit Price</td>
       <td>Total Price</td>
       </font>
</tr>
<tr><font face="Arial" size="2" color="#000000">
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td>{!line.PricebookEntry.Name}</td>
             <td>{!line.Description}</td>           
             <td>{!line.Quantity}</td>
             <td><apex:OutputField value="{!line.UnitPrice}"/></td>
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
          </tr>
       </apex:repeat>  
       </font>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial" size="2">Sub-total:&nbsp;<apex:OutputField value="{!Opportunity.Sub_Total__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial" size="2">Discounts:&nbsp;<apex:OutputField value="{!Opportunity.Discount_amount__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial">Tax:&nbsp;<apex:OutputField value="{!Opportunity.Sales_Tax__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#E5E5E5" align="right" colspan="5">
       <font face="Arial"><b>Total:</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>
<br/>
 
<p align="center"><font face="Arial">Thank you very much for you business!<br />
{!Opportunity.CreatedBy.FirstName} {!Opportunity.CreatedBy.LastName}
</font></p>
</messaging:attachment>      
</messaging:emailTemplate>

 

 

Hi,

 

I have a page that queries a list of accounts using a run time query ( i.e database.query(runtimestring); ) , this query contains a few subqueries as well as the LIKE operator on a text field.   It is calling up a list of accounts depending on the Client Services advisor Id passed in as well as any number of possible Company Division abbreviations (the page is part of a larger app that lets client services view their client book and filter acording to products their clients buy).

 

No matter if the page loads with a query that returns 2 results or 3000 (based on the passed in URL parameters) it takes upwards of 1 minute to load the first time its visited.  From there on out, the load time is about 5 seconds. 

 

The Developer Console timeline puts the delay squarely on the DB query. I'm wondering if there is a situation where the system is generating a sort of "view" on the iniital query construction at run time...and then its using the optimized view on subsequent queries?  I'm not sure i can rewrite the logic to make it a compiled query but I'm willing to try.

 

Again, regardless of the number of records returned or the post prcoessing that needs to happen based onthe returned records count and details.I'm looking for insight on known issues that might be contributing to this behavior. 

 

 I've seen a few people with similar issues but I'd like to sytstematically test this to identify the culprit. I'm as sure I can be its not an asset or Js or rights issue.

 

Thanks for your time.

AJ

 

 EDIT:  Ful disclaimner: the page I'm working on is being fetched by jquery ajax  call and the returned HTML is being inserted into a different main "dashboard" page. But I can recreate the DB delay issue by going directly to the page in question.

 

 

1) Is Force.com sites (the original 'site' building tool that is a component of our Unlimited Edition environment) being sunsetted? I realize the acquisistion of the company behind the  "sites.com" product superseded this product, and Sityes.com is being sold separately.....it feels like this product has been put to the side.

 

The reason i ask is that I use it as a way to integrate loosely with a number of our other saas tools. If I need to get on the Canvas bandwagon (or go to the more structured use of the rest toolkit) then fine. But I am dying to know if this capability is on its last legs. It often provides a really quick way to avoid having to spin up a webservers just to have a place host a few pages (so you can call the REST kit) and integrate with third party apps that don't support calling the kit locally. 

 

2) Has the infrastructure for Sites been moved to the same one that Heroku uses? I ask because I now see a pattern of slow initial load times on a few different Sites that previously were quick to load - even if they hadn't been visited in days. I've stripped out all stylesheets and assets, and even disabled any queries in the initial load methods for these pages - just local variable declarations. And the only thing I can make an analogy to is that it *appears* to be waking up the process....like Heroku apps do.

 

EDIT:  I should note this slowness only happens when visiting from the public facing URLS like "mycompany.force.com/sitename/pagename" and not when we're in the instance ("na6.salesforce.com/apex/pagename").

 

If any SF people have any insight on these I'd love to hear. I think the writing is on the wall....and I know innovation is often destructive :)  More ot the point there are better ways of doing things but sometimes us one man operations do whatever we can - vs doing isome things the optimal way (but not making half our other goals).

 

 

I have a custom "Project" object that has a few dependent picklists, in a couple of them one field controls multiple fields ( i.e. Division > Product ; Division > Stages )

 

Whenever i try to include these 3 fields on a pageBlockTable with inlineedit support, it always says "Divisions needs to be present"  - even though it is.

 

If I use an "apex:repeat" and build my own table, though it seems to work. And if I use a "apex:detail" component and set inlineedit to true, however, it works. Which is fine but I'm trying to enable mass edit of my Projects object via inlineidt and a set controller. So detail is not helpful.  Has this ever been documented by anyone? I can't find any references to it. 

 

I'm wondering if this is a bug/limitation of the inlineedit mechanism. I could see how it could complicate things too much given the fact the javascript for the dependent editable fields is built at runtime .

 

Thanks for any insight you might have. 

 

works: 

    <table>
    <apex:repeat value="{!projectsList}" var="proj">
    <tr>
        <td><apex:outputField value="{!proj.Divisions__c}" /></td> 
        <td><apex:outputField value="{!proj.Product__c}" /></td>   
        <td><apex:outputField value="{!proj.Programs__c}" /></td> 
        <td><apex:outputField value="{!proj.Stage__c}" /></td>   
        <td><apex:outputField value="{!proj.Project_Manager__r.name}" /></td> 
        <td><apex:outputField value="{!proj.Lead_Analyst__r.Name}" /></td> 
        <td><apex:outputField value="{!proj.Project_Reviewer__r.name}" /></td>           
        <td><apex:outputField value="{!proj.Name}" /></td> 
        <td><apex:outputField value="{!proj.Project_Type__c}" /></td> 
        <td><apex:outputField value="{!proj.Program_Family2__c}" /></td> 
        <td><apex:outputField value="{!proj.Account__r.Name}" /></td> 
        <td><apex:outputField value="{!proj.Urgent__c}" /></td> 
        <td><apex:outputField value="{!proj.Forecasted_Delivery_Date__c}" /></td> 
        <td><apex:outputField value="{!proj.Client_Services_Advisor__r.Name}" /></td> 
        <td><apex:outputField value="{!proj.Notes__c}" /></td> 
        <td><apex:outputField value="{!proj.Ranking__c}" /></td> 
    </tr>
    <apex:inlineEditSupport showOnEdit="saveButton, cancelButton"  hideOnEdit="editButton" event="ondblclick"  changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>  
    </apex:repeat>

 

 

does not work: 

Visualforce Error

The inline edit-enabled dependent picklist 'Product' requires its controlling field 'Division' to be present on the page.

 

    <apex:pageBlockTable value="{!projectsList}" var="proj">
        <apex:column value="{!proj.Divisions__c}" /> 
        <apex:column value="{!proj.Product__c}" />  
        <apex:column value="{!proj.Stage__c}" />  
        <apex:column value="{!proj.Project_Manager__r.name}" />
        <apex:column value="{!proj.Lead_Analyst__r.Name}" />
        <apex:column value="{!proj.Project_Reviewer__r.name}" />          
        <apex:column value="{!proj.Name}" />
        <apex:column value="{!proj.Project_Type__c}" />
        <apex:column value="{!proj.Program_Family2__c}" />
        <apex:column value="{!proj.Account__r.Name}" />
        <apex:column value="{!proj.Urgent__c}" />
        <apex:column value="{!proj.Forecasted_Delivery_Date__c}" />
        <apex:column value="{!proj.Client_Services_Advisor__r.Name}" />
        <apex:column value="{!proj.Notes__c}" />
        <apex:column value="{!proj.Ranking__c}" /> 
        <apex:inlineEditSupport event="ondblClick"  showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" /> 
    </apex:pageBlockTable> 

 

I'd like to throw something out there - some of the most helpful interactions I've had as a sf dev have been group discussions on other peoples complex issues with real world constraints ( budget, time, company culture limits). I would love to see a community monthly or weekly chat(ter?) where people wrote up brief test cases and the community tries to whiteboard approaches to the one people felt was
most interesting . If some of salesforces top guys could lurk and give their insight that would be an priceless ( well to me, it would surely cost sf developer time :p). Yes people are paid ig money to consult, I'm not trying to execute solutions but expand my mind for approaches. This would be the fastest way to get exposed to the numerous ( innumerable) approach angles. Inevitably in the real world, the approach options get whittled down quickly so the more in my tool belt the better. Also this is the longest board post ever. #boardblogging

I know there are JavaScript ways to try to replicate a user clicking a dashboard refresh everytime the home page loads) - but I wanted to know if the API exposes the ability to call a refresh directly against a known dashboard Id.

 

I know I  could schedule a job via the API  every 8 hours - so the missing piece is the Dashboard object/method access. 

 

Am I right in thinking it's not exposed?

 

Why?  We have about 7 Dashboard components on a home page and I don't want users to open SF everytime only to have to sit waiting while  everything spins. At that point they probably will navigate away before it ever completes (users' tolerance for delays decreases dramatically if its tied to a common repetitive action...no matter how valuable the updated data they are waiting on)

 

thanks for any information you can provide.

 

ps - yes, I would rather ALL our staff just be trained to refresh it themselves...but of all the adoption and training efforts we have, this is probably the lowest priority and would make a useful solution that was not a hack. It's merely extending the scheduling ability we already have (like how we can schedule multiple Apex runs via the API but not the UI).

This session is one of the top 3 videos I have seen put out by Salesforce staff to help developers. http://www.youtube.com/watch?v=gXj0djp2144  

 

I was wondering if anyone is aware of an updated version - or a similar discussion out in cyberspace that is related but more current. I know Stephan presented at DF2011 with a session about Blazing Fast pages ( http://developer.force.com/dreamforce/11/session/Blazing-Fast-Visualforce-Pages  ) but that video - while definitely worth the watch - doesn't cover the more explicit discussion of how some technologies blend well with specific approaches. 

 

Can we get Stephan on the Developer webinar series rotation?  Do we need to start a collection? :)

 

I'd love to see an updated version of the talk, though i know with all the updates and improvements to Apex/VF since this video  might be too much to cover in a free webinar. Even if he just revisted the content and only discussed the updates since then (addition of Custom Rest Services, optimizations, etc)  it would be useful.

 

Thanks!

I'm curious if anyone out there has any feedback, suggestions, dire warnings, on creating what would be, in effect, a custom 'analytic snapshot'.   Bear with me...

 

We have a strong need to compare snapshots in time of our project management, but the formulas managers use to come up with their metrics are fairly complex (arcane, even). We're  calculating data that doesn't exist at the individual record level - and is at times more complex than even the (very useful) 'formula field' reporting offers.

 

Up until now -  our 'best guess' solution has been using the Office connector to pull data from many reports into Excel, then developing formulas and pivot tables to process the data up to the point where it means something (so we think :smileywink ) 

 

But this results in dozens of tabs (if you're trying to save monthly data snapshots) and requires a person to open the spreadsheet on the 1st of the month in order to get the snapshot we need.

 

My first solution at improving this mess was to write an apex controller that calculated all the metrics at init(), then called a visualforce page to format the data and  then save the page result  (rendered as an xls file)  as an attachment inside salesforce. This solves the batching problem, and removed the need for creating tabs and formulas in excel (Pivot tables remain)...but then I thought: 

 

If I already have the data I need calculated, why not save the data to an object in salesforce...then I can keep everything in Salesforce and gain reporting capability i didn't have before .The hope being I could use standard salesforce reports/charts to do exactly what I was doing with spreadsheet formulas, tabs & pivot tables.

 

So I'm looking at basically modelling my own 'analytic snapshot' SObejct (basically a 'wrapper Sobject' ). If this concept works, we could transfer the majority of our remaining 'spreadsheet hell' into salesforce.  Dare I dream? Am i nuts? Or just trying to be too cute?

I'm overriding the Cases NEW button,and when people get to my visualforce page (after selecting the appropriate Case recordtype) the Type picklist in not filtered.

 

They see all the possible Types  even though the RecordTypeId parameter is being passed in the url and I can confirm it's there (by outputting the field value). 

 

Is there a trick with overriding New and retaining the Record Type field filtering? Common problem? If i use the same page and just make it an edit page, the Type values filter based on Record Type correctly.

 

Here's my code:

 

Page:

 

<apex:page standardController="Case" action="{!initialize}" extensions="CaseControllerExtension" >

   <style>
    textarea {width:100%;}
   </style>


    <apex:sectionHeader title="New Case" />
    <apex:form >
        <apex:pageBlock id="caseInputForm" mode="edit"  >   
        <apex:pageBlockButtons location="bottom">
                <apex:commandButton title="Continue" value="Continue" rendered="{! !continueTest}" action="{!continueForm}" reRender="caseInputForm" />
                <apex:commandButton value="Submit Ticket" action="{!save}" disabled="{! !continueTest}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>              
        </apex:pageBlockButtons>  
            <apex:pageBlockSection columns="1" rendered="{!CountOutstandingIssues != 0 && continueTest == false}">
                <apex:pageMessage escape="false" severity="INFO" strength="3" summary="ATTENTION! The IT Team is 
                currently working on a known problem, before you submit this case read the message(s) below and 
                then select 'continue' if your issue is different."  />
            </apex:pageBlockSection>
            <apex:pageBlockSection ><apex:pageMessages ></apex:pageMessages></apex:pageBlockSection>
            <apex:pageBlockSection columns="1" rendered="{!CountOutstandingIssues == 0 || continueTest == true}">
                <apex:inputField value="{!case.ContactId}" required="true"/>
                <apex:inputField value="{!case.Priority}"/>
                <apex:inputField value="{!case.Type}"/>
                <apex:inputField value="{!case.Problem_Detail__c}"/>
                <apex:inputField value="{!case.Description}"/>
            </apex:pageBlockSection>
               
            <apex:pageBlockSection title="IT Admin Section" rendered="{!continueTest && ($Profile.Name == 'System Administrator' || $Profile.Name == 'IT User')}">         
                <apex:inputField value="{!case.Status}"  />
                <apex:inputField value="{!case.Origin}"  />
                <apex:inputField value="{!case.Subject}"/>
                <apex:inputField value="{!case.Follow_Up_Date__c}"  />
                <apex:inputField value="{!case.Systemwide_Issue__c}"/>
                <apex:inputField value="{!case.Systemwide_Issue_Message__c}"/>
            </apex:pageBlockSection>             
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

Controller

 

public class CaseControllerExtension {
    
    public Map<String, String[]> details = new Map<String, String[]>();
    public Case newCase {get;set;}
    public Boolean continueTest = false;  
    
    public CaseControllerExtension (Case c)
    {
        newCase = c;
        init();
    }
        
    public CaseControllerExtension (ApexPages.StandardController stdController) {
        this.newCase = (Case)stdController.getRecord();
        init();  
    }
    
    private void init()
    {
        newCase.Status = 'New';
        newCase.Priority = 'Medium';
        newCase.Origin = 'Web';
    }

    public PageReference initialize() {
        
        if(newCase.RecordTypeId == null)
        {
            Map<String, String> params = ApexPages.currentPage().getParameters();
            String paramString = '/500/e?nooverride=1';
            
            for(String key: params.keySet())
            {
               paramString = paramString + '&' + key + '=' +  params.get(key);
            }             
            return new PageReference(paramString);
        }
        else if(newCase.RecordTypeId != '01230000000DMGk')
        {
            Map<String, String> params = ApexPages.currentPage().getParameters();
            String paramString = '/500/e?nooverride=1&RecordType=' + newCase.RecordTypeId;

            if(params.containsKey('sfdc.override'))
            {
                params.remove('sfdc.override');
            }
            
            if(params.containsKey('save_new'))
            {
                params.remove('save_new');
            }

            if(params.containsKey('save_new_url'))
            {
                params.remove('save_new_url');
            }

            for(String key: params.keySet())
            {
               paramString = paramString + '&' + key + '=' +  params.get(key);
            }        
            return new PageReference(paramString);
        }


        User u = [select Id,Email from User where Id = :UserInfo.getUserId()]; 
        if([select count() from Contact where Email = :u.Email] != 0)
        {
            Contact c = [select Id, Email from Contact where Email = :u.Email];  
            newCase.ContactId = c.Id;
        }
                        
        if(getCountOutstandingIssues() == 0 )
        {
            continueTest = true;
        }
        for (Case outstandingIssue: [Select Id, Subject, Systemwide_Issue__c,Systemwide_Issue_Message__c, Status from Case where Systemwide_Issue__c = true])
        {
            if(outstandingIssue.Systemwide_Issue_Message__c != null)
            {
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO, outstandingIssue.Systemwide_Issue_Message__c);
                ApexPages.addMessage(myMsg);
            }
        }
        return null;
    }
    
    public Boolean getcontinueTest() {
        return continueTest;
    } 

    public PageReference continueForm() {
        continueTest = true;
        return null;
    }
    
    public Integer getCountOutstandingIssues() {
        return [Select count() from Case where Systemwide_Issue__c = true];
    }
    
    public PageReference save()
    {
        
        //Logical actions
       database.DMLOptions dmo = new database.DMLOptions();
       dmo.AssignmentRuleHeader.useDefaultRule = true;
       dmo.EmailHeader.triggerUserEmail = true; 
       dmo.EmailHeader.triggerAutoResponseEmail = true;
       newCase.setOptions(dmo);
       
       try (
           Database.SaveResult MySaveResult = Database.Insert(newCase, false);
           return new PageReference( '/cases/casesavedjump.jsp');
       } catch Exception (e) {
           ApexPages.addMessages(e);
           return null;
       }
    }
}

 

 

 

 

 

I copied the example in the Visualforce documents directly from the webpage . The 'next/previous' links  don't work. No javascript errors, just a page refresh.  like it's not rerunning the query.

 

Am I missing something? I can't imagine the example is actually broken....Do I have to write my own paginig handlers?

 

thanks for any advice,

Al

Hi,

 

we're testing out Sites and want to provide a catalog of 'success stories'  where each 'story' consist of 4 parts

 

1) Title

2) Description

3) PDF for download

4) an associated image

 

Static resources will not provide what we need, CRM Content does (but the Sites Guest User can't be given a Content License)  - so how are people addressing this?

 

I thought about a custom object but there isn't a 'lookup field' so I can link the story to an image file. Looking at the catalogs on other Sites, they all seem to serve image files using "force.om/servlet/servlet.FileDownload?file=XXXX"  -

 

Does this mean that people are creatng custom objects and then using attachments to provide related docs/images ? I assume I'd just write controller logic to find attachments for a given record and then display them with standard visualforce components [i.e. apex:image, etc]

 

example: the cookbook http://thecookbook-developer-edition.na6.force.com/Home

 

thanks for any ideas you might have!

 

AJ

Is there any documentation or discussion on how to create a 'New Content'  button so we can add them to standard or custom object  page layouts?

 

My first solution was just to write a Visualforce page that redirects to a workspace based on some criteria of the retURL object. But then the user still has to click a second button (Contribute). 

 

Since $Action.Content.New is not valid, I assume this ability is not ready for primetime? Any ideas?

Can someone point me to the documentation of the proper way to query if a user (or the user's profile) has edit permission at an Object's field level?

 

example - "If the user's $Profile has permission to edit a Contact's email field, display this apex:outputText message on the visualforce page"



pseudocode - <apex:outputText render="$Profile.hasPermission(Contact.email, 'Edit')"> Important Message about Emails! </apex:outputText>

 


 I know I could hard code permission checks based on Profile Names/Ids (but I would like to avoid this practice - if I can).

 

I tried using getDescribe to traverse the Profile->Permissions relationships but I couldn't do it.

 

Thanks for any pointers!

Message Edited by icemft1976 on 03-16-2010 10:09 AM
Message Edited by icemft1976 on 03-16-2010 10:55 AM

I have a custom object (Letter_Of_Agreement) that has an Account record as it's master.

 

I was hoping to be able to leverage the existing related list mechanism to display the Account's contacts on a visualforce page (the page is using the LOA controller). 

 

 

Is it possible to reference the parent relationship of an object in a related list in some way?   i.e. <apex:relatedList list="Account__r.Contacts"  />

 

No matter the variation I use, I get an error "List attribute parent name 'account/account__r/etc' is an invalid field name for entity LOA"

 

 

Should I just recreate the related list functionality & look with a custom query and some visualforce?

Message Edited by icemft1976 on 03-03-2010 07:17 AM

My email template (below) works fine when using the "preview" function to populate the Recipient (WhoID) and RelatedTo (WhatID)  - but when a workflow rule triggers the emai lto be sent, it comes back blank as if it's not resolving the who or what correctly. .

Code:
<messaging:emailTemplate recipientType="Contact"
    relatedToType="Account"
    subject="Your website Access"
    replyTo="anaddress@us.com" >

    <messaging:htmlEmailBody >        
    <html>
        <body>
        <p>Hello {!recipient.name}--</p>
        <p>Here is a list of the website access you users currently have for account {!relatedTo.name}:</p>
    <apex:datatable cellpadding="5" var="cts" value="{!relatedTo.Contacts}">
        <apex:column value="{!cts.Name}" headerValue="Name"/>
        <apex:column value="{!cts.Seat_Holder__c}" headerValue="Website Program Access"/>
        <apex:column value="{!cts.Email}" headerValue="Email" />
        <apex:column value="{!cts.Phone}" headerValue="Phone" />
    </apex:datatable>
        </body>
    </html>
    </messaging:htmlEmailBody> 
</messaging:emailTemplate>



I created a simple workflow rule that's called whenever a contact is edited. The workflow rule uses an email alert. The email Alert uses this template. I've checked to make sure the email template is for Contact objects, and that the Recipient is specified as Email Field: Email.

I must be missing something obvious..... any ideas?




Message Edited by icemft1976 on 10-24-2008 09:28 AM

As a developer working side by side with a non-developer admin, I have a real need to be able to coordinate how new fields and validation rules will affect not only my Triggers and Classes, but also my test methods (a common oversight).

As it is - I have been keeping a matrix of our Objects, Custom Objects, Fields and Triggers on a spreassheet. Last night I suddenly thought - what if we could use VisualForce to let admins view our object relationships in a simpler away?

The data is all there, of course, the trick is making a tool that would be usable for my specific purpose. I don't need a change log or versioning system for my apex (that would be nice but overkill). I can see a need to have a usable way to browse SF objects & see what other things (objects, fields and APEX code) could be affected by changes to a given field/object.

I'm interested to see if anyone had thought of this?

Since the tool Im imaginig would by nature have to be able to deal with generic objects, it seems like something a group could contribute to and share the reward. Maybe it's too large of a task or not feisable based on the metadata exposed. If possible, I think the return would be worth it - especiialy for smaller companies like mine (who have limited staff but make lots of changes & additions as we slowly realize what SF can do for us).

Just curious.
I'd like to use an APEX String variable to form the 'where ID =' clause of a SOQL Select statement

I am parsing a salesforce ID out of an email body text then feeding it into this query (which returns no rows):

... String caseNo = email.plainTextBody.substring(email.plainTextBody.indexOf('CaseId:'), email.plainTextBody.indexOf('<caseid>'));
//System.debug(caseNo);
Case caseToUpdate = [ select id, status, subject, description from Case where Id =  :caseNo limit 1];
...

Am I misunderstanding the 'ID = ' comparison behavior? When I debug, the runtime variable 'caseNo' is a valid ID.

Any suggestions?


Message Edited by icemft1976 on 05-06-2008 11:29 AM
    I figured this would have been answered by doing a forum search but no luck:

How do I make a picklist field 'required' with a validation rule? 

I tried using both ISPICKVAL and CASE to detemrine when a picklist had not value selected, but either I get "invalid argument" (case) or no match (ISPICKVAL).

CASE example:

IF(  AND(Extension_Date__c <> null,   CASE(Extension_Reason__c, "Budget", false, "Org Change", false, true) ) , true, false)

ISPICKVAL example:

IF( AND(Extension_Date__c <> null,   ISPICKVAL(Extension_Reason__c, "" ***) ), true, false)

***[ also tried NULL, "NONE",etc]

Can this only be done using a NOT check on every picklist value? Seems cumbersome....   i.e.

IF AND(Extension_Date__c <> null,  NOT(ISPICKVAL(Extension_Reason__c, "Budget")), NOT(ISPICKVAL(Extension_Reason__c, "Org Change")) ), true, false)


Thanks,
ajd
I received an error in Eclipse about a week ago ("Test coverage of selected Apex Class and Trigger is 0%, at least 75% test coverage is required" ) because I had a problem with the first line of a  test method.  I've since fixed the issue that generated the error - but it won't go away from the Problems window.

It's weird, because other errors come and go as they are resolved, but this one stays. And I've verified that the production instance IS getting the changes & saves...so it appears to be a false error. Can it be due to the fact this code is unpackaged? Am I missing new testing requirements?

error details:

Message: Test coverage of selected Apex Class and Trigger is 0%, at least 75% test coverage is required
On Element: LiveSite (this is the overall Project Name)
Location: line 1

I noticed some odd behavior like this with the last version of Eclipse I used (3.2.2) but these persistent buggers usually would drop off after a program restart.

Of course, this could just be due to my ignorance...Any thoughts?

Can't wait for the APEX class next month! :smileywink:
I was just at the Tour de Force - I saw the "Build any UI for Any App Using Visualforce" demo and I'm wondering: how did the presenter store those code snippets? He was dragging and dropping them in, it looked like the library was inside Eclipse.

I've seen the Snippet window in Elicpse, but it looked like he was accessing a prebuilt library of snippets. I'd love to be able ot store my own code blocks, but I couldn't figure out how.

If anyone knows how to add them, I'd appreciate it (meanwhileI'll go search Eclipse's site)

Thanks

[Update]
Okay - I've managed to figure out that I needed to add a "category" to the Snippet window, then I can add items. I just added a new item and put the snippet code I want handy into the "template" text area and it seems to work.

Is there any reason to use the 'variables' options when adding a new 'template'? Thanks again!


Message Edited by icemft1976 on 04-24-2008 02:16 PM
Has anyone else experienced a situation where your Outbound Message queue is backing up and messages are not being attempted to be sent?

Our workflow rules are triggering the right outbound messages - and when they get sent they process fine - but we're seeing them sit in queue for hours (up to 24 ). It also happens to some outbound messages that get attempted, but fail the first time (i.e. we have messages sitting in queue that say "next delivery attempt" and list a time way in the past).

I've tried support but they have not been able to find a cause.

Today our queue was working fine in the AM, but after noon it stopped attempting all messages after it got this error (which looks like a server side issue to my ignorant eyes):  " Request timed out waiting for connection to ConnPool_2, Num waiting=10, Num Active RIs=45"

Are there any limits I might be overlooking? We have over 120 users on unlimited accounts.

Any anecdote or insight is appreciated! Especially considerting our new website we just launched relies on this integration.

Thanks,
AJD

Hi,

 

I have a page that queries a list of accounts using a run time query ( i.e database.query(runtimestring); ) , this query contains a few subqueries as well as the LIKE operator on a text field.   It is calling up a list of accounts depending on the Client Services advisor Id passed in as well as any number of possible Company Division abbreviations (the page is part of a larger app that lets client services view their client book and filter acording to products their clients buy).

 

No matter if the page loads with a query that returns 2 results or 3000 (based on the passed in URL parameters) it takes upwards of 1 minute to load the first time its visited.  From there on out, the load time is about 5 seconds. 

 

The Developer Console timeline puts the delay squarely on the DB query. I'm wondering if there is a situation where the system is generating a sort of "view" on the iniital query construction at run time...and then its using the optimized view on subsequent queries?  I'm not sure i can rewrite the logic to make it a compiled query but I'm willing to try.

 

Again, regardless of the number of records returned or the post prcoessing that needs to happen based onthe returned records count and details.I'm looking for insight on known issues that might be contributing to this behavior. 

 

 I've seen a few people with similar issues but I'd like to sytstematically test this to identify the culprit. I'm as sure I can be its not an asset or Js or rights issue.

 

Thanks for your time.

AJ

 

 EDIT:  Ful disclaimner: the page I'm working on is being fetched by jquery ajax  call and the returned HTML is being inserted into a different main "dashboard" page. But I can recreate the DB delay issue by going directly to the page in question.

 

 

I know there are JavaScript ways to try to replicate a user clicking a dashboard refresh everytime the home page loads) - but I wanted to know if the API exposes the ability to call a refresh directly against a known dashboard Id.

 

I know I  could schedule a job via the API  every 8 hours - so the missing piece is the Dashboard object/method access. 

 

Am I right in thinking it's not exposed?

 

Why?  We have about 7 Dashboard components on a home page and I don't want users to open SF everytime only to have to sit waiting while  everything spins. At that point they probably will navigate away before it ever completes (users' tolerance for delays decreases dramatically if its tied to a common repetitive action...no matter how valuable the updated data they are waiting on)

 

thanks for any information you can provide.

 

ps - yes, I would rather ALL our staff just be trained to refresh it themselves...but of all the adoption and training efforts we have, this is probably the lowest priority and would make a useful solution that was not a hack. It's merely extending the scheduling ability we already have (like how we can schedule multiple Apex runs via the API but not the UI).

I am working on a project that has a very large Visualforce page.  I'm breaking it down into more manageable chunks by using a "State" object that encapsulates information about a particuar state inside of smaller objects.  The base class is abstract, and each state extends that abstract class to provide different functionality.  Anyhow, one state manages a purchase order and has a method called getPO ().  I can access that method via an Apex expression like this:

 

{!curState['PO'].PO_Number__c}

 

In that object (which works perfectly).  Obviously I cannot access the getPO() method directly because the base class does not have that method and the Controller that maintains the state object returns the abstract State obejct, I also have a method called getLineItems() that returns a collection of objects (line items on a purchase order).  The collection is a "List."  I can actually test this such as:

 

<apex:outputText value="{!curState['LineItems']}"/>

 

Which shows the collection as having the correct number of elements.

 

When I attempt to iterate over that collection in a pageBlockTable such as:

 

<apex:pageBlockTable id="lineItems" value="{!curState['LineItems']}" var="t">


it will not compile.  The error message is:

    Save error: Cannot coerce from class core.apexpages.el.adapters.RuntimeTypeMetadataELAdapter to class java.lang.Boolean

 

Perhaps I'm misunderstanding what Datatable should take in the value.  However, if I put the exact same list in the controller class, it WORKS.  Any ideas on how I can fix this?

 

Thanks in advance.

 

  • October 05, 2011
  • Like
  • 0

I'm brand new to Apex and I'm having some trouble displaying aggregate results in a visualforce page. The extension isn't throwing any errors but the visualforce says "Error: Invalid field cv__Opportunity__c for SObject AggregateResult".

 

The way I read this is, either I'm not calling the fields properly in the visualforce page, or I'm not presenting the aggregate properly in the extension. Any help is of course greatly appreciated!

 

Here's the extension:

public class AccountDesignationHistoryExtension {
    
    Account CurrentAccount = null;
    List<AggregateResult> AccountDesignationHistory = null;
    
    public AccountDesignationHistoryExtension(ApexPages.StandardController controller) {
        CurrentAccount = (Account)controller.getRecord();
        AccountDesignationHistory = [SELECT COUNT(cv__Opportunity__c), Designation_Name__c, SUM(cv__Amount__c), MAX(Close_Date__c)
        From cv__Donation_Designation_Relationship__c
        WHERE cv__Opportunity__r.AccountId = :CurrentAccount.Id
        AND cv__Opportunity__r.StageName = 'Received'
        AND cv__Opportunity__r.cv__Posted__c = False
        GROUP BY Designation_Name__c];
    }
    
    public List<AggregateResult> getAccountDesignationHistory() { return AccountDesignationHistory; }
    
}

Here's the visualforce:

<apex:page standardController="Account" extensions="AccountDesignationHistoryExtension">
    <apex:pageBlock >
        <apex:pageBlockTable value="{!AccountDesignationHistory}" var="a">
            <apex:column value="{!a.cv__Opportunity__c}" headerValue="Number of Donations" />
            <apex:column value="{!a.Designation_Name__c}" headerValue="Designation Name" />
            <apex:column value="{!a.cv__Amount__c}" headerValue="Total Designated Amount" />
            <apex:column value="{!a.Close_Date__c}" headerValue="Most Recent Donation" />
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 

I have a query string that I am passing to a Batch Apex method.  I want to include a Set's values in the where clause of the string.  How do I include the set in the string so that it will be parsed correctly?  The example below results in an "unexpected token error" in the debug log when the batch executes.

 

Set<Id> oppIDs = new Set<Id>{id1, id2, id3. etc etc};
CalYearEndBatch cyBatch = new CalYearEndBatch();
cyBatch.query = 'select Role, Opportunity.Amount from OpportunityContactRole where Opportunity__c in:\'' + oppIDs + '\'';
Id batchprocessID = Database.executeBatch(cyBatch);

 

 

In my apex:pageMessages section, if an error message (from a Validation Rule) is displayed, it changes the quotes to their HTML entity, i.e. instead of ", it displays as &quot;

 

Is there a way to prevent this from happening?

This is my first attempt at tweaking an APEX. It is a e-mail template for Invoice which is generated from "Send E-mail" within Opportunity. I am getting: " Error: Unknown property 'core.email.template.EmailTemplateComponentController.Opportunity' " when I am trying to save. What am I missing here?

 

 <messaging:emailTemplate subject="Your invoice" recipientType="Contact"  
relatedToType="Opportunity">
<messaging:htmlEmailBody >
 
<table border="0" cellspacing="0" cellpadding="10" width="700" id="table1" align="center">
<tr>
    <td width="230">
        <img src='{!URLFOR($Resource.PixLogo70pix)}' title=" Logo" />
    </td>
    <td align="right"><font face="Arial" size="2" color="#666666"> One Broadway<br />
    </font>
    </td>  
</tr> 
</table>
<center>
    <p style="font-family:Arial;font-size:22px;font-weight:bold;color:#666666;">INVOICE</p>
</center>
<br/>
 
<table border="0" cellspacing="0" cellpadding="5" width="800" id="table1" align="center">
<tr>    <td valign="top">
    <font face="Arial" size="2" color="#666666">
    Bill To:</font><br />
    <font face="Arial" size="2">
    {!Opportunity.Account.Name}<br/>
    {!Opportunity.Account.BillingStreet}<br/>
    {!Opportunity.Account.BillingCity}, {!Opportunity.Account.BillingState} {!Opportunity.Account.BillingPostalCode}<br/>
    {!Opportunity.Account.BillingCountry}<br/>
  </font>
</td> 
        <td>&nbsp;</td>
   <td valign="top">
     <font face="Arial" size="2">
   <font color="#666666">Account Name:</font> <br/>
   {!Opportunity.Account.Name}<br/>
   <font color="#666666">Invoice Number:</font> <br/>
   {!Opportunity.Project_number__c}<br/>
   <font color="#666666">Invoice Date:</font> <br/>
   {!Opportunity.CloseDate}<br />
   <font color="#666666">Payment Terms:</font> <br/>
   <font color="#FF3300">Due Upon Receipt</font></font></td>    
</tr>
</table>
<br/>
 
<table width="800" border="0" align="center" cellpadding="3" cellspacing="1" id="table4">
<tr bgcolor="#E5E5E5"><font face="Arial" size="2" color="#666666">
       <td>Product</td>
      <td>Description</td>
       <td>Quantity</td>
       <td>Unit Price</td>
       <td>Total Price</td>
       </font>
</tr>
<tr><font face="Arial" size="2" color="#000000">
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td>{!line.PricebookEntry.Name}</td>
             <td>{!line.Description}</td>           
             <td>{!line.Quantity}</td>
             <td><apex:OutputField value="{!line.UnitPrice}"/></td>
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
          </tr>
       </apex:repeat>  
       </font>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial" size="2">Sub-total:&nbsp;<apex:OutputField value="{!Opportunity.Sub_Total__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial" size="2">Discounts:&nbsp;<apex:OutputField value="{!Opportunity.Discount_amount__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial">Tax:&nbsp;<apex:OutputField value="{!Opportunity.Sales_Tax__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#E5E5E5" align="right" colspan="5">
       <font face="Arial"><b>Total:</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>
<br/>
 
<p align="center"><font face="Arial">Thank you very much for you business!<br />
{!Opportunity.CreatedBy.FirstName} {!Opportunity.CreatedBy.LastName}
</font></p>
</messaging:htmlEmailBody>
 
<messaging:attachment renderAs="pdf" filename="{!relatedTo.name}">  
<table border="0" cellspacing="0" cellpadding="10" width="700" id="table1" align="center">
<tr>
    <td width="230">
        <img src='{!URLFOR($Resource.PixLogo70pix)}' title="Pixability Logo" />
    </td>
    <td align="right"><font face="Arial" size="2" color="#666666"> One Broadway<br />
</font>
    </td>  
</tr>
</table>
<center>
    <p style="font-family:Arial;font-size:22px;font-weight:bold;color:#666666;">INVOICE</p>
</center>
<br/>
 
<table border="0" cellspacing="0" cellpadding="5" width="800" id="table1" align="center">
<tr>    <td valign="top">
    <font face="Arial" size="2" color="#666666">
    Bill To:</font><br />
    <font face="Arial" size="2">
    {!Opportunity.Account.Name}<br/>
    {!Opportunity.Account.BillingStreet}<br/>
    {!Opportunity.Account.BillingCity}, {!Opportunity.Account.BillingState} {!Opportunity.Account.BillingPostalCode}<br/>
    {!Opportunity.Account.BillingCountry}<br/>
  </font>
</td> 
        <td>&nbsp;</td>
   <td valign="top">
     <font face="Arial" size="2">
   <font color="#666666">Account Name:</font> <br/>
   {!Opportunity.Account.Name}<br/>
   <font color="#666666">Invoice Number:</font> <br/>
   {!Opportunity.Project_number__c}<br/>
   <font color="#666666">Invoice Date:</font> <br/>
   {!Opportunity.CloseDate}<br />
   <font color="#666666">Payment Terms:</font> <br/>
   <font color="#FF3300">Due Upon Receipt</font></font></td>    
</tr>
</table>
<br/>
 
<table width="800" border="0" align="center" cellpadding="3" cellspacing="1" id="table4">
<tr bgcolor="#E5E5E5"><font face="Arial" size="2" color="#666666">
       <td>Product</td>
      <td>Description</td>
       <td>Quantity</td>
       <td>Unit Price</td>
       <td>Total Price</td>
       </font>
</tr>
<tr><font face="Arial" size="2" color="#000000">
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td>{!line.PricebookEntry.Name}</td>
             <td>{!line.Description}</td>           
             <td>{!line.Quantity}</td>
             <td><apex:OutputField value="{!line.UnitPrice}"/></td>
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
          </tr>
       </apex:repeat>  
       </font>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial" size="2">Sub-total:&nbsp;<apex:OutputField value="{!Opportunity.Sub_Total__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial" size="2">Discounts:&nbsp;<apex:OutputField value="{!Opportunity.Discount_amount__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#FFFFFF" align="right" colspan="5">
       <font face="Arial">Tax:&nbsp;<apex:OutputField value="{!Opportunity.Sales_Tax__c}"/></font></td>
</tr>
<tr>
       <td bgcolor="#E5E5E5" align="right" colspan="5">
       <font face="Arial"><b>Total:</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>
<br/>
 
<p align="center"><font face="Arial">Thank you very much for you business!<br />
{!Opportunity.CreatedBy.FirstName} {!Opportunity.CreatedBy.LastName}
</font></p>
</messaging:attachment>      
</messaging:emailTemplate>

 

 

I copied the example in the Visualforce documents directly from the webpage . The 'next/previous' links  don't work. No javascript errors, just a page refresh.  like it's not rerunning the query.

 

Am I missing something? I can't imagine the example is actually broken....Do I have to write my own paginig handlers?

 

thanks for any advice,

Al

I am using email services to process email-to-case. My code correctly creates the case and updates the case when a reply is received. However, even though I am using the DML options to trigger user email, the case owner does not receive a notification when a reply is received. Cases/emails sent through the email-to-case service notify correctly.

 

Ideas?

Hi,

 

we're testing out Sites and want to provide a catalog of 'success stories'  where each 'story' consist of 4 parts

 

1) Title

2) Description

3) PDF for download

4) an associated image

 

Static resources will not provide what we need, CRM Content does (but the Sites Guest User can't be given a Content License)  - so how are people addressing this?

 

I thought about a custom object but there isn't a 'lookup field' so I can link the story to an image file. Looking at the catalogs on other Sites, they all seem to serve image files using "force.om/servlet/servlet.FileDownload?file=XXXX"  -

 

Does this mean that people are creatng custom objects and then using attachments to provide related docs/images ? I assume I'd just write controller logic to find attachments for a given record and then display them with standard visualforce components [i.e. apex:image, etc]

 

example: the cookbook http://thecookbook-developer-edition.na6.force.com/Home

 

thanks for any ideas you might have!

 

AJ

The query below that returns everything I need to build a list of Content Documents for a given ContentWorkspace. What I can't seem to do is build a URL, using the ContentDocumentId, that will allow for downloading of the document in a Sites VF page.

 

Query

--------

Select Id, ContentWorkspaceId, ContentDocumentId, CreatedDate, SystemModstamp, IsOwner, IsDeleted,
ContentDocument.Id, ContentDocument.Title, ContentDocument.PublishStatus
From ContentWorkspaceDoc
Where contentWorkspaceId = '058500000004COF' and ContentDocument.PublishStatus ='P'
order by ContentDocument.Title

 

 

If I deliver the Content Document I get a URL that I can create a link with but I do NOT see that Id used in the link below in my query at all. The link looks like this.

<a href="https://na3.salesforce.com/sfc/p/300000000ETq0R76A1g2d65F.RjvA2za5BXBKZg=">My Doc</a>

 

Any help or pointers in the right direction would be greatly appreciated.

 

Thanks,
Phillip

Can someone point me to the documentation of the proper way to query if a user (or the user's profile) has edit permission at an Object's field level?

 

example - "If the user's $Profile has permission to edit a Contact's email field, display this apex:outputText message on the visualforce page"



pseudocode - <apex:outputText render="$Profile.hasPermission(Contact.email, 'Edit')"> Important Message about Emails! </apex:outputText>

 


 I know I could hard code permission checks based on Profile Names/Ids (but I would like to avoid this practice - if I can).

 

I tried using getDescribe to traverse the Profile->Permissions relationships but I couldn't do it.

 

Thanks for any pointers!

Message Edited by icemft1976 on 03-16-2010 10:09 AM
Message Edited by icemft1976 on 03-16-2010 10:55 AM

I have a custom object (Letter_Of_Agreement) that has an Account record as it's master.

 

I was hoping to be able to leverage the existing related list mechanism to display the Account's contacts on a visualforce page (the page is using the LOA controller). 

 

 

Is it possible to reference the parent relationship of an object in a related list in some way?   i.e. <apex:relatedList list="Account__r.Contacts"  />

 

No matter the variation I use, I get an error "List attribute parent name 'account/account__r/etc' is an invalid field name for entity LOA"

 

 

Should I just recreate the related list functionality & look with a custom query and some visualforce?

Message Edited by icemft1976 on 03-03-2010 07:17 AM

Hello,

 

I have a problem with the @Future in Apex and a VisualForce page.

 

Problem:
I need a function that can create PDF files out of a VF page and send this byEmail. And I want to processes many records (between 150 and 750 records) byclicking 1 button.

Tried this:
I have a APEX class that is executed @Future.
This Class will select some records (accounts) and then loop these records.
In this loop an existing VF page is "called"/"created" withthe record ID as parameter. This page is a VisualForce page withRenderAs="PDF".

So I just want to get a PDF file based on that VF page and the record ID.

Then I want to send out an email with some of these PDF files as attachments.

When I run this code on a selection with 1 record and I don't use @future,everything works. I recieve an email with a PDF attachment and the rightcontent is in the PDF.

When I run this code on many records and don't use @future, I get a time outerror in the browser.

When I run this code on many records and use @future, It seems to work becauseafter a while I recieve an email with many attachments, but I can not open theatatchments because they are no good PDF files and all of the same size : 2 kb. The normal PDF should be like 14 KB.

How can I fix this?

 

Kind regards,

 

Bart Caelen

Adapti 

Message Edited by AdaptiDev on 01-22-2010 05:33 AM
Message Edited by AdaptiDev on 01-22-2010 06:13 AM
I'm having a hard time finding any examples of this....is anyone using the sites technology to expose org information to internal employees that do not have SF licenses?  Specifically, I have a requirement for a group of users to view and update information coming in to SF from a web-to-lead form.  This is the only SF functionality they need, so it is cost prohibitive to buy licenses for them but I need more than email alerts.  If anyone can point me in the right direction I would greatly appreciate it!

Hello!

I just started using VF with Developer license, without any previous experience in Java and HTML and trying to create approval process with custom Objects and pages using standard (built in) approval setup.

I want to show Approval history on my VF page.

As I read on I-net, I need to extend standard controller (I think there should be some Approval controller) and now, for curiosity too, I am trying to extend any standard controller (as in example below - from the Internet), but I am always getting an error:

 

Compile Error: Method does not exist or incorrect signature: stdController.getRecord() at...

 

Is it related to my Developer license, or something wrong in this code (but from other posts, i see, that many people using same code)? 

Thank you. 

 

The following class is a simple example of a controller extension:

swfobject.registerObject("clippy.d3703e55", "9");
public class myControllerExtension {    private final Account acct;        // The extension constructor initializes the private member         // variable acct by using the getRecord method from the standard         // controller.         public myControllerExtension(ApexPages.StandardController stdController) {        this.acct = (Account)stdController.getRecord();    }    public String getGreeting() {        return 'Hello ' + acct.name + ' (' + acct.id + ')';    }}

The following Visualforce markup shows how the controller extension from above can be usedin a page:

swfobject.registerObject("clippy.d3703e64", "9");
<apex:page standardController="Account" extensions="myControllerExtension">    {!greeting} <p/>    <apex:form>        <apex:inputField value="{!account.name}"/> <p/>        <apex:commandButton value="Save" action="{!save}"/>    </apex:form></apex:page>