• gliu
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
Reference message:
 
I can't display a Histories related list in a VF page.  I used Ron Hess's method of using a pageBlock to get the related list items except one, "Field" (i.e. without the last column in the code below, the VF page displays without an error message).  The error message in the Subject is what is created when I try and access that field.  The WDSL has
 
 <element name="Field" nillable="true" minOccurs="0" type="xsd:string" /> 
 
Code:
<apex:pageBlockTable value="{!SCRB_SalesOrder__c.Histories}" var="h">
      <apex:column headerValue="Date" value="{!h.createddate}"/>
      <apex:column headerValue="User" value="{!h.CreatedById}"/>
      <apex:column headerValue="Action" value="{!h.Field}"/>
</apex:pageBlockTable>


 The normal View page displays the following after I created the record and then I made a change to the "Status Code" field.

DateUserAction
9/18/2008 7:04 PM    xxxxxxxxxxx   Changed Status Code from Draft to Pre-build.
9/13/2008 2:22 PM    xxxxxxxxxxx  

   Created.

The VF page generated the following error messages:
After the record was created:
Changed Field: bad value for restricted picklist field: created
 
Here is another error message on the VF page when "Status Code" field was changed:
Changed Field: bad value for restricted picklist field: StatusCode__c

Thanks for any help.
  • September 19, 2008
  • Like
  • 0

Folks,

 

I've run into a strange quirk with folders and am looking for some ideas/input. 

 

If one were to create a few email templates that do not belong to any particular folder, those templates would be filed under the "public" folder. Querying via SOQL or IDE schema browser would then return the templates with what looks like valid "folderid" values. The problem is, that folder Id (I'm assuming it's the default public one) doesn't seem to be query-able via SOQL or IDE browser. Creating any number of any other folders and filing email templates under them works fine and the email templates point to folders that are query-able.

 

Is there something I'm missing here? What's the trick to querying for the default, public folder?

 

Thanks,

Grant

  • March 20, 2010
  • Like
  • 0

Folks,

 

I've run into some problems while trying to work with email templates and visualforce/apex. We're trying to build a step-by-step wizard interface that uses emails and templates, but it looks like if a template is applied to an Apex Email Object, the merge fields are only evaluated after the email is sent. Furthermore, the template body and subject replaces any body and subject specified, which means one is not allowed to edit anything in the template before sending out.

 

For the latter problem (how to allow users to edit templates before sending), we've found a way to present the subject and body to the user, take that text in as input, and create a  temporary email template from it to apply to an email and send it. It'd be nice to have a cleaner solution to this, though.

 

For the first problem, we still have no good solution, short of parsing merge fields ourselves. Is there some secret solution for this that I'm not seeing? Some sort of way to ask the system "evaluate merge fields given a template and any necessary who/what Ids"?

 

The standard salesforce interface allows both of the behaviors above.

 

Thank,

Grant

 

 

  • March 20, 2010
  • Like
  • 0

There must be something subtle I'm missing here. Component documentation states that attributes in custom components can be custom types, yet, the component (snippet) below simply refuses to acknowledge a public method in a custom type. The attribute in red below gives a null pointer exception. If I call the "getter" directly, it doesn't recognize the method name.

 

Ideas, folks? Oh, and the reason I need this is I'm testing out ways to write my own object layouts, since Apex doesn't have access to layout info (yet).

 

Thanks!

Grant

 

public class CaseLayout {

public List<ApexPages.Action> m_actions;

public List<ApexPages.Action> getM_actions() {
if (m_actions == null) {
m_actions = new List<ApexPages.Action>();
m_actions.add(new ApexPages.Action('{!Save}'));
m_actions.add(new ApexPages.Action('{!Case.Edit}'));
}
return m_actions;
}

public void setM_actions(List<ApexPages.Action> actions) {
m_actions = actions;
}
}

 

 

 

<apex:component>
<apex:attribute name="case" description="Incoming case object" type="Case"/>
<apex:attribute name="layout" description="Incoming Case Layout object" type="CaseLayout"/>
<apex:form >
<apex:pageBlock title="{!$ObjectType.case.label}">
<apex:pageBlockButtons >
<apex:repeat value="{!layout.m_actions}" var="v_action">
<apex:commandButton action="{!URLFOR(v_action)}" value="Edit"/>
</apex:repeat>

 

etc

etc

 

  • March 28, 2009
  • Like
  • 0

I've done enough research to suspect the following is not possible, but thought I'd check here first before performing major customizations.

 

Does anybody know if there is a straightforward way to replace the default salesforce page css with custom ones? For instance, if I wanted to completely re-style the case 'edit' page. I'm looking for a nice cofiguration field somewhere that lets me say "use this css instead of salesforce css". Thus far, the best way I can see to re-style things significantly is a custom visualforce page that overrides the actions/links/buttons that looks something like so:

 

 

 

<apex:page showHeader="false" standardStylesheets="false" standardcontroller="Case"> <apex:stylesheet value="your own css here"/> ....... Recreate the edit page for cases here ......

 

But that involves recreating many of the standard pages, which is non-trivial for everything but detail pages.

 

Thanks in advance for the input,

Grant

  • March 23, 2009
  • Like
  • 0

I'm having a problem when i try to rerender a specific pageblock section as opposed to the entire page. Here's a snippet of the code:

 

The idea is that I only want a specific section to show, when certain criteria are met. So on the onchange event, i want to rerender that specific pageblock section. But it's not working correctly. It works if i try to rerender the entire page. But i can't do that because then i loose all the values that have been input into all the fields on the form. Any ideas on what i'm doing wrong?

 

 

<apex:page standardController="case" sidebar="false"> <apex:sectionHeader title="Sponsor: {!$User.FirstName} {!$User.LastName}" subtitle="New Badge Request" /> <apex:form > <apex:pageBlock title="Edit Case" id="thePageBlock" mode="edit"> <apex:actionRegion > <apex:pageBlockSection title="Initiation Information" columns="1" collapsible="false" > <apex:pageBlockSectionItem > <apex:outputLabel value="Is Initiation Required for this Applicant?"/> <apex:outputPanel > <apex:inputField value="{!case.E_Initiation_Required__c}" required="true"> <apex:actionSupport event="onchange" rerender="something" status="status2"/> </apex:inputField> <apex:actionStatus startText="Updating required fields..." id="status2"/> </apex:outputPanel> </apex:pageBlockSectionItem> </apex:pageblocksection> </apex:actionRegion> <apex:pageBlockSection id="something" rendered="{!case.E_Initiation_Required__c == 'Yes'}"> <apex:inputField value="{!case.Requesting_Organization__c}" /> <apex:inputField value="{!case.Sub_Agency__c}" /> <apex:inputField value="{!case.Region_Num__c}" /> <apex:inputfield value="{!case.Central_Office__c}" /> <apex:inputField value="{!case.Applicant_s_Supervisors_Name__c}" /> <apex:inputField value="{!case.Applicant_s_Supervisor_Phone_Number__c}" /> </apex:pageBlockSection>

 

</apex:pageblock>
</apex:form>
</apex:page>

 

 

 

 

For the Note & attchment Related Link, it possiblt to remove Attach File button?

Or have any idea or suggestion not let the user to attach the file?

 Thanks.

 

Best Regrds:

May

There must be something subtle I'm missing here. Component documentation states that attributes in custom components can be custom types, yet, the component (snippet) below simply refuses to acknowledge a public method in a custom type. The attribute in red below gives a null pointer exception. If I call the "getter" directly, it doesn't recognize the method name.

 

Ideas, folks? Oh, and the reason I need this is I'm testing out ways to write my own object layouts, since Apex doesn't have access to layout info (yet).

 

Thanks!

Grant

 

public class CaseLayout {

public List<ApexPages.Action> m_actions;

public List<ApexPages.Action> getM_actions() {
if (m_actions == null) {
m_actions = new List<ApexPages.Action>();
m_actions.add(new ApexPages.Action('{!Save}'));
m_actions.add(new ApexPages.Action('{!Case.Edit}'));
}
return m_actions;
}

public void setM_actions(List<ApexPages.Action> actions) {
m_actions = actions;
}
}

 

 

 

<apex:component>
<apex:attribute name="case" description="Incoming case object" type="Case"/>
<apex:attribute name="layout" description="Incoming Case Layout object" type="CaseLayout"/>
<apex:form >
<apex:pageBlock title="{!$ObjectType.case.label}">
<apex:pageBlockButtons >
<apex:repeat value="{!layout.m_actions}" var="v_action">
<apex:commandButton action="{!URLFOR(v_action)}" value="Edit"/>
</apex:repeat>

 

etc

etc

 

  • March 28, 2009
  • Like
  • 0
Reference message:
 
I can't display a Histories related list in a VF page.  I used Ron Hess's method of using a pageBlock to get the related list items except one, "Field" (i.e. without the last column in the code below, the VF page displays without an error message).  The error message in the Subject is what is created when I try and access that field.  The WDSL has
 
 <element name="Field" nillable="true" minOccurs="0" type="xsd:string" /> 
 
Code:
<apex:pageBlockTable value="{!SCRB_SalesOrder__c.Histories}" var="h">
      <apex:column headerValue="Date" value="{!h.createddate}"/>
      <apex:column headerValue="User" value="{!h.CreatedById}"/>
      <apex:column headerValue="Action" value="{!h.Field}"/>
</apex:pageBlockTable>


 The normal View page displays the following after I created the record and then I made a change to the "Status Code" field.

DateUserAction
9/18/2008 7:04 PM    xxxxxxxxxxx   Changed Status Code from Draft to Pre-build.
9/13/2008 2:22 PM    xxxxxxxxxxx  

   Created.

The VF page generated the following error messages:
After the record was created:
Changed Field: bad value for restricted picklist field: created
 
Here is another error message on the VF page when "Status Code" field was changed:
Changed Field: bad value for restricted picklist field: StatusCode__c

Thanks for any help.
  • September 19, 2008
  • Like
  • 0