• DMF96
  • NEWBIE
  • 40 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 11
    Replies
I don't think this is posible but is there any workaround that anybody is aware of?

I've created a report which contains multiple rich text fields. As per the Saleforce Documentation, they display as plaint text. Is there any way I can export the report into Excel with the actual formatting? (e.g. Font Colour etc.)
  • October 26, 2023
  • Like
  • 0
Is it possible to mass update the font colour of Rich Text fields within a flow/apex? 

Scenario
I have a flow which creates a Parent Record with lots of Child Records (Similar to a Clone Function but it Clones the Child Records too). The Child Records contain multiple Rich Text Fields that may have different coloured fonts.When the Flow is run, and the records are duplicated (via a Loop), I want all Rich Text Fields to have Black Font.

I have tried using a SUBSTITUTE Formula within the Flow but it doesn't work - possibly because of the wildcard?
SUBSTITUTE({!CurrentItem.Child_Record__c}, "color: rgb(*)", "color: rgb(0, 0, 0)")
Is there any way to achieve this?
  • October 18, 2023
  • Like
  • 0
I have a form on a Visualforce Page that includes the inputting into a RichText Field. However, on the Visualforce Page, the formatting options are different to those on the Record Details Page. I need users to have the ability to change Font Colour - is this possible within a Visualforce Page?

Visualforce Page:
User-added image

Record Page Layout:
User-added image
  • October 09, 2023
  • Like
  • 0
I have the Apex Code below which returns Risks related to a Log and orders them so the Highest Risk Rating is first.
List<Risks__c> AllRisks;

public List<Log__c> getAllRisks() {
if(AllRisks == null) AllRisks = [SELECT  Name,
					                        Risk_Details__c,
					                        Risk_Rating__c                                    
                                                   FROM  Risks__c
                                                WHERE  Log__c = :currentRecord.Id
                                           ORDER BY  Risk_Rating__c DESC];
        return AllRisks;
    }
On a Visualforce Page, I want to display the results of this query with each record being numbered. So the Hghest Risk appears as Number 1 and the Lowest Risk is 10 (if there were 10 records displayed)

Is this possible?
  • October 06, 2023
  • Like
  • 0
I have an Apex class to get certain records and within this, I get 2 Date/Time Fields, "Start Date/Time" and "End Date/Time". I then reference these fields on a Visualforce Page but the Times are 1 Hour Behind the field value. Does anyone know how I can show the Actual Field Value on the Visualforce Page?

Here's the part of the Visualforce Code relating to "Start Date/Time"
<apex:outputText value="{0,date,dd' 'MMM' 'yyyy HH:mm}">  <apex:param value="{!T.Start_Date_Time__c}" />

From a quick Google, it looks like Salesforce stores the values as GMT by default but I need the Visualforce Page to just show the Field Value otherwise when clocks go back at the end of October, it will cause confusion. 
  • October 02, 2023
  • Like
  • 0
I have the code below within a Visualforce Page. Is there a way to display the values on multiple lines instead of one line separated by commas?
<apex:outputPanel layout="block" > 

<apex:outputText value="{!CustomObject__c.Field1__c}, {!CustomObject __c.Field2__c}, {!CustomObject __c.Field3__c}"/>

</apex:outputPanel>
Current Output
Field 1 Value, Field 2 Value, Field 3 Value

Ideal Output
Field 1 Value
Field 2 Value
Field 3 Value

 
  • September 07, 2023
  • Like
  • 0
I have a custom button on a custom object with the URL below. It allows the user to create a Risk Record via the Risk Assessment and it defaults a lookup field value with the Risk Assessment ID.

Currently, when the user clicks Save to create the record, it takes them to the Risk. Is it possible to have keep the user on the Risk Assessment page intead of being taken to the Risk record? I've had a look online and I've seen the retURL and saveURL features of the URL but I've tried to add it to my URL below but it still takes the user to the Risk when clicking 'Save'.
 
/lightning/o/Risks__c/new?defaultFieldValues=RiskAssessment__c={!RiskAssessment__c.Id}&retURL=%2F{!RiskAssessment__c.
Id}&saveURL=%2F{!RiskAssessment__c.Id}

 
  • August 23, 2023
  • Like
  • 0
I have the code below within a Visualforce page but I keep getting the error "Error: Syntax error. Missing ')'". It works fine when I remove the row with the IF Statement (Row 8) but I can't see why I'm getting this error. Does anyone have any suggestions?
<apex:pageBlock >
      <apex:pageBlockTable value="{!AllTasks}" var="All" rendered="{!(AllTasks.size>0)}">
         <apex:column headerValue="Summary"> 
             <apex:outputLink value="/{!All.Id}">{!All.Subject}</apex:outputLink>
         </apex:column>
         <apex:column headerValue="Details" value="{!All.Description}"/>
         <apex:column headerValue="Due Date" value="{!All.ActivityDate}"/>
         <apex:column headerValue="Assigned To" value="{! IF( All.RecordTypeId = 'Staff Task', All.WhoId, All.OwnerId ) }"/>
         <apex:column value="{!All.Status}"/>
      </apex:pageBlockTable>
      <apex:outputLabel value="No Actions Recorded" rendered="{!(AllTasks.size=0)}" > </apex:outputLabel>
   </apex:pageBlock>

 
  • June 23, 2023
  • Like
  • 0
I want to display a visualforce page with a table of records with the following criteria:
  • "OwnerId" = Current User
  • OR
  • "Client__c" = "Contact" field on the User record of the Current User
I have part of the code so far but I am getting the error:
"Error: Invalid field Complaints__r for SObject Contact"

Parent Object: Contact
Child Object: ComplaintFeedback
Child Relationship Name: Complaints

Below is the code. Does anyone know how I can fix this error and also apply the filtes above?
<apex:page standardController="Contact">
   <apex:pageBlock >
      <apex:pageBlockTable value="{!Contact.Complaints__r}" var="Complaints">
         <apex:column headerValue="ID"> 
             <apex:outputLink value="/{!Complaints.Id}">{!Complaints.Name}</apex:outputLink>
         </apex:column>
         <apex:column value="{!Complaints.Service_Name__c}"/>
         <apex:column value="{!Complaints.Main_Complaint_Category__c}"/>
         <apex:column value="{!Complaints.Complaint_Sub_Category__c}"/>
         <apex:column value="{!Complaints.Complaint_Details_Complaint__c}"/>
         <apex:column value="{!Complaints.Complaint_Stage__c}"/>
         <apex:column value="{!Complaints.Complaint_Resolved__c}"/>
      </apex:pageBlockTable>
   </apex:pageBlock>
</apex:page>
  • May 17, 2022
  • Like
  • 0
I'm new to apex so this may be a simple answer...

I'm wanting to create a button on the Contact Page which launches a Visualforce page displaying all records from a certain object for a contact. 

How do I get all records from Object 1 and store certain fields (where LookupField1 = The Contact record I was on when clicking on the button)

I'd want the visual force page to display records in order they were created - similar to this:

Record ID: ABC123
Created Date: 01/01/2021
Notes: Notes go here

Record ID: ABC123
Created Date: 05/01/2021
Notes: Notes go here

etc.
  • June 23, 2021
  • Like
  • 0
I don't think this is posible but is there any workaround that anybody is aware of?

I've created a report which contains multiple rich text fields. As per the Saleforce Documentation, they display as plaint text. Is there any way I can export the report into Excel with the actual formatting? (e.g. Font Colour etc.)
  • October 26, 2023
  • Like
  • 0
Is it possible to mass update the font colour of Rich Text fields within a flow/apex? 

Scenario
I have a flow which creates a Parent Record with lots of Child Records (Similar to a Clone Function but it Clones the Child Records too). The Child Records contain multiple Rich Text Fields that may have different coloured fonts.When the Flow is run, and the records are duplicated (via a Loop), I want all Rich Text Fields to have Black Font.

I have tried using a SUBSTITUTE Formula within the Flow but it doesn't work - possibly because of the wildcard?
SUBSTITUTE({!CurrentItem.Child_Record__c}, "color: rgb(*)", "color: rgb(0, 0, 0)")
Is there any way to achieve this?
  • October 18, 2023
  • Like
  • 0
I have an Apex class to get certain records and within this, I get 2 Date/Time Fields, "Start Date/Time" and "End Date/Time". I then reference these fields on a Visualforce Page but the Times are 1 Hour Behind the field value. Does anyone know how I can show the Actual Field Value on the Visualforce Page?

Here's the part of the Visualforce Code relating to "Start Date/Time"
<apex:outputText value="{0,date,dd' 'MMM' 'yyyy HH:mm}">  <apex:param value="{!T.Start_Date_Time__c}" />

From a quick Google, it looks like Salesforce stores the values as GMT by default but I need the Visualforce Page to just show the Field Value otherwise when clocks go back at the end of October, it will cause confusion. 
  • October 02, 2023
  • Like
  • 0
I have the code below within a Visualforce Page. Is there a way to display the values on multiple lines instead of one line separated by commas?
<apex:outputPanel layout="block" > 

<apex:outputText value="{!CustomObject__c.Field1__c}, {!CustomObject __c.Field2__c}, {!CustomObject __c.Field3__c}"/>

</apex:outputPanel>
Current Output
Field 1 Value, Field 2 Value, Field 3 Value

Ideal Output
Field 1 Value
Field 2 Value
Field 3 Value

 
  • September 07, 2023
  • Like
  • 0
I have a custom button on a custom object with the URL below. It allows the user to create a Risk Record via the Risk Assessment and it defaults a lookup field value with the Risk Assessment ID.

Currently, when the user clicks Save to create the record, it takes them to the Risk. Is it possible to have keep the user on the Risk Assessment page intead of being taken to the Risk record? I've had a look online and I've seen the retURL and saveURL features of the URL but I've tried to add it to my URL below but it still takes the user to the Risk when clicking 'Save'.
 
/lightning/o/Risks__c/new?defaultFieldValues=RiskAssessment__c={!RiskAssessment__c.Id}&retURL=%2F{!RiskAssessment__c.
Id}&saveURL=%2F{!RiskAssessment__c.Id}

 
  • August 23, 2023
  • Like
  • 0
I have the code below within a Visualforce page but I keep getting the error "Error: Syntax error. Missing ')'". It works fine when I remove the row with the IF Statement (Row 8) but I can't see why I'm getting this error. Does anyone have any suggestions?
<apex:pageBlock >
      <apex:pageBlockTable value="{!AllTasks}" var="All" rendered="{!(AllTasks.size>0)}">
         <apex:column headerValue="Summary"> 
             <apex:outputLink value="/{!All.Id}">{!All.Subject}</apex:outputLink>
         </apex:column>
         <apex:column headerValue="Details" value="{!All.Description}"/>
         <apex:column headerValue="Due Date" value="{!All.ActivityDate}"/>
         <apex:column headerValue="Assigned To" value="{! IF( All.RecordTypeId = 'Staff Task', All.WhoId, All.OwnerId ) }"/>
         <apex:column value="{!All.Status}"/>
      </apex:pageBlockTable>
      <apex:outputLabel value="No Actions Recorded" rendered="{!(AllTasks.size=0)}" > </apex:outputLabel>
   </apex:pageBlock>

 
  • June 23, 2023
  • Like
  • 0
I want to display a visualforce page with a table of records with the following criteria:
  • "OwnerId" = Current User
  • OR
  • "Client__c" = "Contact" field on the User record of the Current User
I have part of the code so far but I am getting the error:
"Error: Invalid field Complaints__r for SObject Contact"

Parent Object: Contact
Child Object: ComplaintFeedback
Child Relationship Name: Complaints

Below is the code. Does anyone know how I can fix this error and also apply the filtes above?
<apex:page standardController="Contact">
   <apex:pageBlock >
      <apex:pageBlockTable value="{!Contact.Complaints__r}" var="Complaints">
         <apex:column headerValue="ID"> 
             <apex:outputLink value="/{!Complaints.Id}">{!Complaints.Name}</apex:outputLink>
         </apex:column>
         <apex:column value="{!Complaints.Service_Name__c}"/>
         <apex:column value="{!Complaints.Main_Complaint_Category__c}"/>
         <apex:column value="{!Complaints.Complaint_Sub_Category__c}"/>
         <apex:column value="{!Complaints.Complaint_Details_Complaint__c}"/>
         <apex:column value="{!Complaints.Complaint_Stage__c}"/>
         <apex:column value="{!Complaints.Complaint_Resolved__c}"/>
      </apex:pageBlockTable>
   </apex:pageBlock>
</apex:page>
  • May 17, 2022
  • Like
  • 0