• System Admin19
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hello, I am displaying a rich text area (specifically, the body of chatter notes) on a VF page. The issue is that the html tags are showing on the page, e.g. if the note says "hello", my page shows: "<p> hello</p>". How can I get rid of those tags?

Here are the relevent snippets from the PAGE:

  <apex:pageBlockTable value="{!listofNotes}" var="noteslist">
   <apex:column >
       <apex:facet name="header">Note</apex:facet>
    <apex:outputText value="{!noteslist.Body}"/>
   </apex:column>

and from the Controller:
listofNotes = [SELECT ID, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body
                      FROM feeditem 
                      WHERE  Parentid IN (Select id from Discharge__c where Name =: discharge.name AND Date_of_Birth__c =: discharge.date_of_birth__c)];
Hi, 

  I want to add a condition to by pass the case assignment rule for below trigger is working as expected only this I want to add by pass case assignement rule. 
Trigger
======

trigger CaseTrigger on Case (Before Insert, Before Update,After Insert, After Update){
   
   if(Trigger.isAfter ) { 
      if(AvoidRecursion.isFirstRun()) {
         CaseTriggerUtils.processInsert(Trigger.newMap);
         CaseTriggerUtils.processUpdate(Trigger.newMap, Trigger.oldMap);     
      }
    } 
}


Class
=====
public class CaseTriggerUtils {
    
    public static void processInsert(Map<id, Case> newMap) {
        processUpdate(newMap,newMap);
    }   
    
    public static void processUpdate(Map<id, Case> newMap, Map<id, Case> oldMap) {
        String FWSubject;
        String RWSubject;
        String CaseSubject;
        list<Case> caseLst=new list<Case>();
        boolean isExecuted = True;
        
        for (Case c : newMap.values()) {
            
            // Remove FW and RW from case subject to get exact string
            if(c.subject.Contains('FW:')){
                FWSubject = c.subject.replaceAll('FW:','');
                System.debug('FQ Trim String :' + FWSubject);
                CaseSubject = FWSubject;     
            } else if(c.subject.Contains('RW:')){ 
                RWSubject = c.subject.replaceAll('RW:','');
                System.debug('RW Trim String :' + RWSubject);   
                CaseSubject = RWSubject;
            }  else {
                CaseSubject = c.subject;
            }    
            
        }
        
        // Query to get list of all case subject values
        list<case> ctendays = [select id, casenumber,subject,createddate,ownerid,owner.name from case where CreatedDate = this_year and  subject like :('%' + CaseSubject + '%') order by createddate asc limit 100];
        for(case ctndays : ctendays){
            system.debug('Existing Cases :'  + ctndays.casenumber + ' ' + ctndays.subject + ' ' + ctndays.createddate + ' ' + ctndays.owner.name);      
            system.debug('Latest Case Owner ' + ctendays[0].owner.name); 
            
            // If case subject is more than 18 character
            if(ctndays.subject != null &&  ctndays.subject.length() > 18){
                if(FWSubject <> null){
                    ctndays.subject = FWSubject; 
                } else if (RWSubject <> null){
                    ctndays.subject = RWSubject; 
                }
            } 
            
            // Get the latest owner to assign ownership. 
            ctndays.ownerid = ctendays[0].ownerid;
            ctndays.Duplicate_With__c = ctendays[0].casenumber;
            caseLst.add(ctndays);
        }  
        
        if(caseLst.size()>0){
            update caseLst;
        } 
    }
    
}

 
  • February 20, 2019
  • Like
  • 0
Hey everyone,

I want to grab the value of my label for a dynamic picklist but I am not sure how it is to be done and I have scoured the Internet and have not found anything that works for myself. Right now I am using the value field to grab the ID of an Account from the picklist but I also need to grab the name. I figured I would be able to grab it from the selected option's label but I haven't been able to do it.

Here is the lightning:select in my new lightning component:
<lightning:select aura:id="accountSelect"
    name="account"
    label="Select Account"
    required="true"
     value="{!v.acctId}"
    onchange="{!c.changeAccount}">
        <aura:iteration items="{!v.lstAccount}" var="acct" >
            <option value="{!acct.Id}" >{!acct.Name}</option>
        </aura:iteration>
</lightning:select>

And here is my controller:
changeAccount: function(component,event,helper){
		console.log('Account changed.'); 
        var label = component.find("accountSelect").get("v.label");
        
        console.log('log that it changed, new account name: ' + label);
}

Thanks for any help!