• Paul Ginther
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Based on the value of a picklist field I need to render a static message in a small VF page at the top of the record in Classic UI.  I have created an Apex controller as well as the VF page, but I have not been able to make this work.  I am new to this level of development so any assistance you might be able to give would be greatly appreciated.  Basically, if a picklist field called Frequency contains one of three different values, I want to display a static text message.  Below is the code I have written so far:

Apex Class – “ContentMessageInlineCtrl”
public with sharing class ContentMessageInlineCtrl {
  public Content__c cov {get;set;}
 
  public ContentMessageInlineCtrl(ApexPages.StandardController controller) {
    if(!Test.isRunningTest()) {
      controller.addFields(new List<String>{'Frequency__c'});
    }
        cov = (Content__c) controller.getRecord();
    }
}
 
VisualForce Page = “ContentMessageInline”
<apex:page standardController="Content__c" extensions="ContentMessageInlineCtrl">
    <style type="text/css">
        .redAlert {
            font-weight: bold;
            color: #FF0000;
            font-size : 22px;
            text-decoration: none;
        }
       
    </style>
   
    <apex:form >
        <apex:outputPanel rendered="{if(!(Frequency__c == “Weekly”||Frequency__c == “Semi Monthly (Twice a month)”||
        Frequency__c == “Bi Weekly (Every Other week)”)true,false)}">          
            <center>
               <apex:outputText styleClass="redAlert" value="THIS IS WHERE THE STATIC MESSAGE WILL RESIDE"/> <br/>
            </center>
        </apex:outputPanel>
    </apex:form>
</apex:page>
 
I have two buttons that trigger an update on two fields each.  Acknowledged updates the Status to "Acknowledged" and the Completed updates the Status field field to "Completed".  Once the status is updated, a Workflow rule then runs to update the other fields (Acknowledged_By, Acknowledged_On, Completed_By and Completed_On). I am using Java in each button to perform this task.  Here is the code that manages the Completed update:

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
var ca = new sforce.SObject('Case_Assignment__c');
ca.id = "{!Case_Assignment__c.Id}";
ca.Status__c = "Completed";
result = sforce.connection.update([ca]);
location.reload(true);

I need to know if there is any way to create an error trap in this code to stop the update and throw an error if the user clicks this button before the Acknowledged_By and Acknowledge_On fields have been populated.  I tried managing this with a validation rule, but the validation runs before the Workflow rule so the criteria in the Validation never evaluates to TRUE (Acknowledged_By = '' and Completed_By <> '')  Any ideas would be greatly appreciated.
In our call center, Agents open new cases and select the appropriate Account and Contact at the beginning of each call.  They then review the complete contact information that is brought into the case on Save.  If any of the three PC Configuration fields on the Contact Record need to be updated, they can run a Flow from the Case record that prompts them to select the correct options.  The Flow then updates this information directly on the Contact record.  All of this is working perfectly.  However, I really need to update the current Case with the new information after the Contact update is complete.  Can anyone point me in the right direction to manage the Case update?  Is that something that should be done as part of the Flow?  Thanks in advance for any assistance you can provide.
Based on the value of a picklist field I need to render a static message in a small VF page at the top of the record in Classic UI.  I have created an Apex controller as well as the VF page, but I have not been able to make this work.  I am new to this level of development so any assistance you might be able to give would be greatly appreciated.  Basically, if a picklist field called Frequency contains one of three different values, I want to display a static text message.  Below is the code I have written so far:

Apex Class – “ContentMessageInlineCtrl”
public with sharing class ContentMessageInlineCtrl {
  public Content__c cov {get;set;}
 
  public ContentMessageInlineCtrl(ApexPages.StandardController controller) {
    if(!Test.isRunningTest()) {
      controller.addFields(new List<String>{'Frequency__c'});
    }
        cov = (Content__c) controller.getRecord();
    }
}
 
VisualForce Page = “ContentMessageInline”
<apex:page standardController="Content__c" extensions="ContentMessageInlineCtrl">
    <style type="text/css">
        .redAlert {
            font-weight: bold;
            color: #FF0000;
            font-size : 22px;
            text-decoration: none;
        }
       
    </style>
   
    <apex:form >
        <apex:outputPanel rendered="{if(!(Frequency__c == “Weekly”||Frequency__c == “Semi Monthly (Twice a month)”||
        Frequency__c == “Bi Weekly (Every Other week)”)true,false)}">          
            <center>
               <apex:outputText styleClass="redAlert" value="THIS IS WHERE THE STATIC MESSAGE WILL RESIDE"/> <br/>
            </center>
        </apex:outputPanel>
    </apex:form>
</apex:page>
 
I have two buttons that trigger an update on two fields each.  Acknowledged updates the Status to "Acknowledged" and the Completed updates the Status field field to "Completed".  Once the status is updated, a Workflow rule then runs to update the other fields (Acknowledged_By, Acknowledged_On, Completed_By and Completed_On). I am using Java in each button to perform this task.  Here is the code that manages the Completed update:

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
var ca = new sforce.SObject('Case_Assignment__c');
ca.id = "{!Case_Assignment__c.Id}";
ca.Status__c = "Completed";
result = sforce.connection.update([ca]);
location.reload(true);

I need to know if there is any way to create an error trap in this code to stop the update and throw an error if the user clicks this button before the Acknowledged_By and Acknowledge_On fields have been populated.  I tried managing this with a validation rule, but the validation runs before the Workflow rule so the criteria in the Validation never evaluates to TRUE (Acknowledged_By = '' and Completed_By <> '')  Any ideas would be greatly appreciated.
In our call center, Agents open new cases and select the appropriate Account and Contact at the beginning of each call.  They then review the complete contact information that is brought into the case on Save.  If any of the three PC Configuration fields on the Contact Record need to be updated, they can run a Flow from the Case record that prompts them to select the correct options.  The Flow then updates this information directly on the Contact record.  All of this is working perfectly.  However, I really need to update the current Case with the new information after the Contact update is complete.  Can anyone point me in the right direction to manage the Case update?  Is that something that should be done as part of the Flow?  Thanks in advance for any assistance you can provide.