• ease u
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
HI, when i am previewing my lightning component the page become unresponsive.Actually my apex class return --Vehicle Arranged,,,1110000077,Vehicle Arranged,,        1,1110000077--
and i want to add the value at position 1,5 and the added value to the lightning component:(
This is my apex class returning the string:
public class ordercall {
        public static List<String> t =new List<String>() ;
    public static String[] tmp1 = New String[]{};
        public static String idString;
  @AuraEnabled 
    public static String call(){
        
        orderStatuswsdl.MI_Order_Status_sfdcPort Mobile= new orderStatuswsdl.MI_Order_Status_sfdcPort();
       String Username='dlskv';
        String Password='sapabap1';
        Blob auth = Blob.valueOf(Username+':'+Password);
        String AuthorizationHeader ='Basic '+EncodingUtil.Base64Encode(auth);
        Mobile.inputHttpHeaders_x= new Map<String,String>();
        Mobile.inputHttpHeaders_x.put('Authorization', AuthorizationHeader );
        Mobile.inputHttpHeaders_x.put('Content-Type', 'text/xml;charset=UTF-8;');
        Mobile.timeout_x=119999;
          orderStatuswsdl.ROW_element element= new orderStatuswsdl.ROW_element();
        
        
           element.CUSTOMER='1110000077';
          element.SALES_ORDER='';
        
         element.Sales_Org='1000';
     //   element.SALES_OFFICE='1702';
        
         orderStatuswsdl.ROW_element[] req= new orderStatuswsdl.ROW_element[]{element};
             system.debug(req);
             
             
             
             orderStatuswsdl.ROW_element[] res = new orderStatuswsdl.ROW_element[]{};
           res= Mobile.MI_Order_Status_sfdc(req);
        for(orderStatuswsdl.ROW_element reqq: res){
          system.debug(reqq.LR);
             tmp1.add(reqq.LR);
             tmp1.add(reqq.QUANTITY );
            tmp1.add(reqq.SALES_ORDER);
               tmp1.add(reqq.CUSTOMER);
            
        }
       
        idString = string.join(tmp1,',');
       system.debug(idString);
        return idString;
    }
      
    }
my js controller code:

 mycomp : function(component, event, helper) {
        var action=component.get("c.call");
        action.setCallback(this, function(response){
            var state=response.getState(); 
            if(state === "SUCCESS"){
                 var qm=response.getReturnValue();
                 var arr = qm.split(',');
                var penquantity;
                var quantity;
               var size=arr.length;
                 
              for(var i=0;i<size+1;i+4)
                {
                     if(arr[i]==="Vehicle Arranged" || arr[i]==="Vehicle Entered Plant" || arr[i]==="Order Processed Date & Time")
                    {
                           var penquantity=arr[i+2];
                   } 
               else
                {
                   if(arr[i]==="Dispatched")
                   {
                      quantity=arr[i+1];
                   }
                }
                }
            var underprg = component.get("v.underprg");       
                component.set("v.underprg",penquantity); 
            }
            });
        $A.enqueueAction(action);
        
    }
Hello,

I would like to create an apex class an the EmailMessage object to count the number of Email Feed on a case.
And then use a trigger.
I have done something similar to count the number of text post on a case but I struggle a bit to do the same for EmailMessage 
here is what I have done to count the number of textpost.
Apex class
public class FeedItemTriggerHandler {
    public static void countFeedItem(List<FeedItem> lstFeed){
        if(lstFeed.size() > 0){
            set<Id> setParentIds = new Set<Id>();
            for(FeedItem fd : lstFeed){
                setParentIds.add(fd.ParentId);
            }
            if(setParentIds.size() > 0){
                List<Case> lstCase = [Select caseNumber,All_Users_Feed_Count__c, (Select Id,body,Type,Visibility From Feeds where Type = 'TextPost' OR Type = 'EmailMessageEvent') From Case where Id In : setParentIds];
                if(lstCase.size() > 0){
                    for(Case cs : lstCase){
                        List<CaseFeed> feeds = cs.feeds;
                        Integer count = 0;
                        for(CaseFeed cf : feeds){
                            if(cf.Visibility == 'AllUsers'){
                                count+=1;    
                            }
                        }
                        System.debug(feeds.size());
                        cs.All_Users_Feed_Count__c = count;
                    }
                    update lstCase;
                }    
            }
        }
    }
}
Trigger
trigger FeedItemTrigger on FeedItem (after insert,before delete) {
    if(Trigger.isAfter){
        if(Trigger.isInsert){
          FeedItemTriggerHandler.countFeedItem(Trigger.new);    
        }
    } else if(Trigger.isBefore){
      if(Trigger.isDelete){
          FeedItemTriggerHandler.countFeedItem(Trigger.old);    
        }
    }
}
Could Someone help to do something similar to count the number of Email feed sent on a case.

Thanks
 
TCPIP vs external interrupt
Why running TCPIP inserts random delays into the external interrupt response time. External interrupt has priority 7 and uses SRS. Nothing else with priority 7.  The TCPIP server is a Harmony example.
If the server is not running, the external interrupt delay is constant  (1us).
After starting the server, it changes between 1 - 2 us.
I do not know what to try anymore.
Hi,

I'm currently working with the "Discover Built-in XSS Protections in Force.com" Unit of Developer Advanced Trail. The point of the challenge is to edit the comments below each use of "{!sampleMergeField1}" to determine if is vulnerable to XSS. 

Based on the criteria found within the unit and in the guidelines in the Secure Coding Cross Site Scripting page for Built in Auto Encoding (All merge-fields are always auto HTML encoded provided they: do not occur within a <style> or <script> tag, AND do not occur within an apex tag with the escape='false' attribute) I came up with the following answers:
<apex:page controller="Built_In_XSS_Protections_Challenge" sidebar="false" tabStyle="Built_In_XSS_Protections_Challenge__tab">
<apex:sectionHeader title="Built-In XSS Protections Challenge" />
<apex:form >
    <apex:pageBlock >
        <c:Classic_Error />
        <apex:pageMessages />      
        <apex:pageBlockSection title="Demo" columns="1" id="tableBlock">          
            
            <apex:outputText value="{!sampleMergeField1}"/>
            <!-- sampleMergeField1 is vulnerable to XSS: NO -->


            <apex:outputText value="{!sampleMergeField2}" escape="false"/>
            <!-- sampleMergeField2 is vulnerable to XSS: YES -->


            <apex:outputText >
                {!sampleMergeField3}
            </apex:outputText>
            <!-- sampleMergeField3 is vulnerable to XSS: NO -->
       
       
            <style>
                .foo {
                    color: #{!sampleMergeField4};
                }
            </style>
            <!-- sampleMergeField4 is vulnerable to XSS: YES -->
             
            
            {!sampleMergeField5}
            <!-- sampleMergeField5 is vulnerable to XSS: NO -->
            
            
            <script>
                var x = '{!sampleMergeField6}';
            </script>
            <!-- sampleMergeField6 is vulnerable to XSS: YES -->
            
            
            <apex:outputLabel value="{!sampleMergeField7}" escape="false"/>
            <!-- sampleMergeField7 is vulnerable to XSS: YES -->
            
       
        </apex:pageBlockSection>
        <apex:pageBlockSection title="Code links" columns="1">
            <apex:outputPanel >
                <ul>
                    <li><c:codeLink type="Visualforce" namespace="security_thail" name="Built_In_XSS_Protections_Challenge" description="Visualforce Page"/></li>            
                    <li><c:codeLink type="Apex" namespace="security_thail" name="Built_In_XSS_Protections_Challenge" description="Apex Controller"/></li>
                </ul>
            </apex:outputPanel>        
        </apex:pageBlockSection>        
    </apex:pageBlock>          
</apex:form>

But everytime y check the challenge, the same message is displayed:

User-added image

I already checked that I am pointing to the right playground. 

If you can check it and help find where I am going wrong I would be thankful.

Thanks