• sfdc@isha.ax1814
  • NEWBIE
  • 75 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 75
    Questions
  • 50
    Replies
Hi Team,

I ahve a below process builder. When ever iam trying to fire process builder iam geeting below error . Please help me how to fix this issue.


AND(
ISPICKVAL([Case].Status , "Closed"),
NOT(ISPICKVAL([Case].Origin , "Satmetrix")),
ISCHANGED([Case].Status) , 
NOT(ISBLANK([Case].ContactID)),
[Case].RecordType.Name =  'Intel Request',
OR(
ISPICKVAL([Case].GiCa_Intel_Request_Subtype__c, "Threat"),
ISPICKVAL([Case].GiCa_Intel_Request_Subtype__c, "Technical")
),
AND(
NOT(ISBLANK([Case].Contact.Account.Name )),
NOT(ISNULL([Case].Contact.AccountId ))
),
NOT(BEGINS([Case].Account.Name, "FireEye")),
NOT(CONTAINS([Case].Contact.Email, '@mandiant.com')),
NOT(CONTAINS([Case].Contact.Email, 'FireEye')),
NOT(CONTAINS(TEXT([Case].Gica_OutCome__c) , 'Unable to Support') )
)


flow error:

Error element myDecision4 (FlowDecision).
The flow failed to access the value for myVariable_current.Account.Id because it hasn't been set or assigned.

Flow Details
Flow API Name: NPX_Case_Closure_Nomination
Type: Record Change Process
Version: 22
Status: Active
Org: FireEye Inc. (00D22000000DBIr)

Flow Interview Details
Interview Label: NPX_Case_Closure_Nomination-22_InterviewLabel
Current User: Nice User (00522000001NTRM)
Start time: 8/27/2019 1:03 AM
Duration: 0 seconds

How the Interview Started
Nice User (00522000001NTRM) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = Case (500220000035BNpAAM)
myVariable_current = Case (500220000035BNpAAM)

DECISION: myDecision
Skipped this outcome because its conditions weren't met: myRule_1
Outcome conditions:
{!formula_myRule_1} (false) Equals true

Default outcome executed.

Salesforce Error ID: 1861759023-21181 (-1729454283)
Error element myDecision4 (FlowDecision).
The flow failed to access the value for myVariable_current.Account.Id because it hasn't been set or assigned.

Flow Details
Flow API Name: NPX_Case_Closure_Nomination
Type: Record Change Process
Version: 22
Status: Active
Org: FireEye Inc. (00D22000000DBIr)

Flow Interview Details
Interview Label: NPX_Case_Closure_Nomination-22_InterviewLabel
Current User: Nice User (00522000001NTRM)
Start time: 8/27/2019 1:03 AM
Duration: 0 seconds

How the Interview Started
Nice User (00522000001NTRM) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = Case (500220000035BNpAAM)
myVariable_current = Case (500220000035BNpAAM)

DECISION: myDecision
Skipped this outcome because its conditions weren't met: myRule_1
Outcome conditions:
{!formula_myRule_1} (false) Equals true

Default outcome executed.

Salesforce Error ID: 1861759023-21181 (-1729454283)



Regards,
Isha
Hi Team,

I need help on testclass for below lightning componnet apex class.
Can anyone help me on this .


public class LightningTabComponentController {
/* Method to fetch the parameters used for framing the URL*/ 
    
   @AuraEnabled
    public static OpptyRelatedData getCustomsettingValue()
    {
       OpptyRelatedData returnrelateddata = new  OpptyRelatedData ();
        
       string cusseturl= SMX_URL__c.getInstance().SMX_URL__c;
       returnrelateddata.SMX = cusseturl;
        
       string cusseturl1 = SFDC_URL__c.getInstance().SFDC_URL__c;
       returnrelateddata.SFDCURL = cusseturl1;
        
       String username = UserInfo.getUsername();
       returnrelateddata.username=username;
        
       String sessionId = UserInfo.getsessionId();
       returnrelateddata.sessionId=sessionId;
        
        
       String npxaccview = SFDC_URL__c.getInstance().NPX_Account_View_Embed__c;
       returnrelateddata.npxaccview=npxaccview;
        
        String npxconview = SFDC_URL__c.getInstance().NPX_Contact_View_Embed__c;
       returnrelateddata.npxconview=npxconview;
        
         string urler = URL.getSalesforceBaseUrl().toExternalForm();
        returnrelateddata.urler=urler;
           
       system.debug('returnrelateddatareturn======>'+returnrelateddata); 
       return returnrelateddata;
    }
    
    public class OpptyRelatedData{
        @AuraEnabled 
        Public string SMX{get;set;}
        @auraEnabled
        public string SFDCURL{get;set;}
        @auraEnabled
        public string username{get;set;}
        @auraEnabled
        public string sessionId{get;set;}
        @auraEnabled
        public string npxaccview{get;set;}
        @auraEnabled
        public string npxconview{get;set;}
        @auraEnabled
        public string urler{get;set;}
        
        
    } 
    
}


Regards,
Isha
Hi Everyone.

I need topass the Current Account id in the URL . The problem here is when iam passing accId  into the URL Outside brases Value is coming but not inside brases.Pleas efind screenshot for reference.


<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:hasSObjectName,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" controller="LightningTabComponentController" access="global">
   
    <aura:attribute name="recordId" type="Id"/>
</aura:component>

js controller:

var accId = component.get("v.recordId");
                        alert(accId);
                        
                        var embedChartUrl='/main/embed?'+embeddedLink+'&urlParams={"INTEGRATION_COMPANY_CODE":"{accId}"}'+accId;
                        alert(embedChartUrl);


Canyou please someone help me how to get accId in {"INTEGRATION_COMPANY_CODE":"{accId}"}'  here in between bases value.



User-added image


Regards,
Isha
Helo Everyone,

I have to convert below vf page to Lightning component. 
SMX_URL__c and SFDC_URL__c is custom settings. Can you please help me on creating the Lightning component. 

Iam new to Lightning component. Please help me on this.


<apex:page sidebar="false">
 <apex:iframe id="NPXDashboardFrame" height="600px" scrolling="true"/>
  
  <!-- <iframe  id="NPXDashboardFrame" style="overflow: auto!important; -webkit-overflow-scrolling: touch!important;position:absolute; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;"/>-->
  
  
       <script type="text/javascript">
    var enterpriseIdfier = 'TEST';//this need to change as per enterprise

    var smxServer = '{!$Setup.SMX_URL__c.SMX_URL__c}'; 
    var varSessionID = '{!$Api.Session_ID}';
     alert(varSessionID);
  var Server ='{!$Setup.SFDC_URL__c.SFDC_URL__c}';
  //var Server ='{!$Api.Partner_Server_URL_330}';
    var varOwner = '{!$User.Id}';
    var varUsername = '{!$User.Username}';
    var embedChartUrl='/main/WebUI.html';
    var url = smxServer + '/app/core/j_satmetrix_security_check?session='+ varSessionID + '&server="'+Server+'"&owner='+varOwner+'&username='+varUsername+'&version=3&enterpriseIdfier='+enterpriseIdfier+'&requestTokenType=SALES_FORCE&requestToken=NONE&targetUrl='+embedChartUrl;
    
    alert(url);
  
    
     document.getElementById('NPXDashboardFrame').src = url;
   
    </script>
</apex:page>

Regards,
Isha
Hi,

I have below vf page where iam calling the values from Custom setting directly.

My requirement is to implement Lightning component i staed of the above page. As Iam new to lightning Can some one help me on creating of lightning component.
Custom setting:SFDC_URL__C
                       SMX_URL__C



VF page:

<apex:page lightningStylesheets="true" showHeader="false">
    <apex:iframe id="NPXDashboardFrame" height="1000px" scrolling="true"/>
   <!-- <iframe  id="NPXDashboardFrame" style="overflow: auto!important; -webkit-overflow-scrolling: touch!important;position:absolute; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;"/>-->


 <script type="text/javascript">
    var enterpriseIdfier = 'RASMITHA';//this need to change as per enterprise

    var smxServer = '{!$Setup.SMX_URL__c.SMX_URL__c}'; 
    var varSessionID = '{!$Api.Session_ID}';
     alert(varSessionID);
  var Server ='{!$Setup.SFDC_URL__c.SFDC_URL__c}';
  //var Server ='{!$Api.Partner_Server_URL_90}';
    var varOwner = '{!$User.Id}';
    var varUsername = '{!$User.Username}';
    var embedChartUrl='/main/WebUI.html';
    var url = smxServer + '/app/core/j_satmetrix_security_check?session='+ varSessionID + '&server="'+Server+'"&owner='+varOwner+'&username='+varUsername+'&version=3&enterpriseIdfier='+enterpriseIdfier+'&requestTokenType=SALES_FORCE&requestToken=NONE&targetUrl='+embedChartUrl;
      
   
    </script>
</apex:page>


Regards,
Isha
Hi I have Below Vf page and i created a VF tab with URL . The URL is loading in Classic and lightning but not in mobile. I am suspecting the problem with the targetURL parameter which iam passing. Can you please help me solve this.

I tried with some other vfpage passing Accountid it is loading properly. 

Vfpage:



<apex:page lightningStylesheets="true" showHeader="false">
    <apex:iframe id="NPXDashboardFrame" height="1000px" scrolling="true"/>
   <!-- <iframe  id="NPXDashboardFrame" style="overflow: auto!important; -webkit-overflow-scrolling: touch!important;position:absolute; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;"/>-->


 <script type="text/javascript">
    var enterpriseIdfier = 'ISHA';//this need to change as per enterprise

    var smxServer = '{!$Setup.SMX_URL__c.SMX_URL__c}'; 
    var varSessionID = '{!$Api.Session_ID}';
     alert(varSessionID);
  var Server ='{!$Setup.SFDC_URL__c.SFDC_URL__c}';
  //var Server ='{!$Api.Partner_Server_URL_90}';
    var varOwner = '{!$User.Id}';
    var varUsername = '{!$User.Username}';
    var embedChartUrl='/main/WebUI.html';
    var url = smxServer + '/app/core/j_satmetrix_security_check?session='+ varSessionID + '&server="'+Server+'"&owner='+varOwner+'&username='+varUsername+'&version=3&enterpriseIdfier='+enterpriseIdfier+'&requestTokenType=SALES_FORCE&requestToken=NONE&targetUrl='+embedChartUrl;
    
    alert(url);
    document.getElementById('NPXDashboardFrame').src = url;
    
       
   
    </script>
</apex:page>
User-added image

Can comeone help me on this.


Regards,
Isha
Hi team,

I have a vfpage design which holds the logic of based on the case status change new fields should be displayed and once value will be given and click on save values will be saved and fields should be non edit mode and should hike the save button as well


vfpage:

<apex:page standardController="Case" extensions="caseextension">
    
    <apex:form id="theForm">
        
        <apex:pageBlock mode="inlineEdit">
            <apex:pageblockSection >
                <apex:outputField value="{!Case.Status}">
                    <apex:actionSupport event="onchange" reRender="theForm"/>
                </apex:outputField>
            </apex:pageblockSection>
        </apex:pageBlock>
        
        <apex:pageblock mode="inlineEdit">
       
            <apex:pageblockSection rendered="{!IF(Case.Status = 'Working' && rend,TRUE,FALSE)}">
                <apex:inputField value="{!Case.Working_1__c}"/>
                <apex:inputField value="{!Case.Working_2__c}"/>
            </apex:pageblockSection>
            
            <apex:pageblockSection rendered="{!Case.Status = 'Escalated' && rend}">
                <apex:inputField value="{!Case.NewText1__c}"/>
                <apex:inputField value="{!Case.New_Text2__c}"/>
           
            </apex:pageblockSection>
            
            <apex:pageblockSection rendered="{!Case.Status = 'Working' && rend1}">
                <apex:outputField value="{!Case.Working_1__c}"/>
                <apex:outputField value="{!Case.Working_2__c}"/>
            </apex:pageblockSection>
            
            <apex:pageblockbuttons>
                 <apex:commandButton value="Save" action="{!save}"/>
                 
            </apex:pageblockbuttons>
            
        </apex:pageblock>
    </apex:form>
</apex:page>


Class:

public class caseextension {

    private final Case caseObj;
    public boolean rend{get;set;}
    public boolean rend1{get;set;}

    // get Case record from the standard controller and putting it in a member variable
    public caseextension (ApexPages.StandardController stdController) {
        this.caseObj = (Case)stdController.getRecord();
        rend=true;
        rend1=false;
    }

    public  PageReference save(){
        // TO DO
        rend=false;
        rend1=true;
        
        insert caseObj;
           
        
        
     return null;

    }

}

Iam getting below error User-added image
Regards,
Isha
Hi ,


I need clarification on difference between login via Oauth/login via Password Authentication.


With out Uername/Password can we login to data loader [Using accesstoiken]?
 Apart from securitytoken is there any difference between Oauth/Password Authentication.


Can someone explain me little bit clealry.



Regards,
Isha
Hi Team,

I have a Req that on cas estandard page based on the status value need to display the different fieds.

Status='Working'--> Text1 Text 2 fields should display.
Status='Escalate'--> Text3 Text4 fields should display.

On save of this values it should be saved on the case . Please suggest me how can acheive this.

My Current page:

<apex:pageBlock >
<apex:pageblockSection >
  <apex:inputfield value="{!Case.Status}">
    <apex:actionSupport event="onchange" reRender="theForm" />
</apex:inputField>

  <apex:inputField value="{!Case.NewText1__c}" rendered="{!IF(Case.Status == 'Escalated',true,false)}"/>
  <apex:inputField value="{!Case.New_Text2__c}" rendered="{!IF(Case.Status == 'Escalated',true,false)}" />
  
  <apex:inputField value="{!Case.Working_1__c}" rendered="{!IF(Case.Status == 'Working',true,false)}" />
  <apex:inputField value="{!Case.Working_2__c}" rendered="{!IF(Case.Status == 'Working',true,false)}" />
  
   </apex:pageblockSection>
<apex:pageblockbuttons >
<apex:commandButton value="save" action="{!save}"/>

</apex:pageblockbuttons>
</apex:pageBlock>
</apex:form>

</apex:page>


Please help me on save and any changes on the code.


Regards,
Isha 

 
Hi I have a requirement that , ihava a object called survey record and field called folowupowner lookup to Survey record
My req is when ever sttaus on survey record is nominated we ahve to send the email to followup owner.

Condition: If there are multiple records with same followupowner email should send once.

I thoughtit can be done via flows and can be used in process buildr. But iam new to flow and not understand what can be done. If some one help me on this it will be very helpful.


Regards,
Isha
Hello Everyone,

I have a webtab called "Custom dashboards". But that i can not find it out in mobile[salesforce 1] app. How we can see the tabs in mobile view.


Can any one help me on this.


Regards,
Isha
HI team,


I have my below vfpage . which is working on both lighting and classic with mobile. but in mobile scroll bar is not working kindly any help on this.


<apex:page standardController="Account" tabStyle="Account">
 <!--<apex:includeLightning />-->
 <apex:slds >
   <apex:iframe src="" scrolling="true" height="650px" id="NPXAccountChartFrame"/>
  

   <!--if you embed mutiple chart add some index to id-->
   <script>
    document.getElementById("NPXAccountChartFrame").style.overflow:auto; 
   
    var embeddedLink = '{!$Setup.SFDC_URL__c.NPX_Account_View_Embed__c}';
    var embedChartUrl = '/main/embed?'+embeddedLink;//this need to change as per chart/view embed link
    //var enterpriseIdfier = 'SMXCONNECTORS';//this need to change as per enterprise
    var enterpriseIdfier = 'RASMITHA';//this need to change as per enterprise
    console.log('Account.Id = {!Account.Id}');
    var smxServer = '{!$Setup.SMX_URL__c.SMX_URL__c}'; 
    var varSessionID = '{!$Api.Session_ID}';
    var saleforceServer = '{!$Setup.SFDC_URL__c.SFDC_URL__c}';
    var varOwner = '{!$User.Id}';
    var varUsername = '{!$User.Username}';
    embedChartUrl = embedChartUrl + '&urlParams={"INTEGRATION_COMPANY_CODE":"{!Account.Id}"}';
    
    var url = smxServer + '/app/core/j_satmetrix_security_check?session='+ varSessionID + '&server="'+saleforceServer+'"&owner='+varOwner+'&username='+varUsername+'&version=3&enterpriseIdfier='+enterpriseIdfier+'&requestTokenType=SALES_FORCE&requestToken=NONE&targetUrl='+embedChartUrl;
    
    document.getElementById('NPXAccountChartFrame').src = url;
    
    <!--if you embed mutiple chart add some index to id-->
   </script>
    </apex:slds>   
</apex:page>


Regards,
Isha
Hi,

I In process builder criteria i have to put multipleconditions like below . I have choosen the criteria that "conditions met" how can we use beow higlightedconditions in formula

Case.ContactID IS NOT NULL 
AND RecordType EQUALS  'Customer Support' OR 'Customer Portal' OR 'Intel Request'
AND AccountID NOT LIKE 'test%'
AND Contact.Email NOT LIKE '%@mandiant.com'

AND Case.Gica_OutCome__c  NOT LIKE '%Unable to Support%'
ANDSurvey Record Not Created for Same Contact in LAST_90_DAYS
AND Contact.Email NOT LIKE 'test'
AND Case.SubCategory NOT LIKE 'Remove From Field Notices'


Reards,
Isha
Hi Team,

Iam new to lightning. i hae a requirement that i have a existed vfpage and that need to be converted as a Lightning componnet.

My vfpage code below:

<apex:page standardController="Account" tabStyle="Account">
   <apex:iframe src="" scrolling="true" height="650px" id="NPXAccountChartFrame" />
   <!--if you embed mutiple chart add some index to id-->
   <script>
   
    var embeddedLink = '{!$Setup.SFDC_URL__c.NPX_Survey_Responses_Embed__c}';
    var embedChartUrl = '/main/embed?'+embeddedLink;//this need to change as per chart/view embed link
    var enterpriseIdfier = 'testttttt';//this need to change as per enterprise
    console.log('Account.Id = {!Account.Id}');
    var smxServer = '{!$Setup.SMX_URL__c.SMX_URL__c}'; 
    var varSessionID = '{!$Api.Session_ID}';
    var saleforceServer = '{!$Setup.SFDC_URL__c.SFDC_URL__c}';
    var varOwner = '{!$User.Id}';
    var varUsername = '{!$User.Username}';
    embedChartUrl = embedChartUrl + '&urlParams={"INTEGRATION_COMPANY_REF_ID":"{!Account.Id}"}';
    var url = smxServer + '/app/core/j_satmetrix_security_check?session='+ varSessionID + '&server="'+saleforceServer+'"&owner='+varOwner+'&username='+varUsername+'&version=3&enterpriseIdfier='+enterpriseIdfier+'&requestTokenType=SALES_FORCE&requestToken=NONE&targetUrl='+embedChartUrl;
    
    document.getElementById('NPXAccountChartFrame').src = url;
    <!--if you embed mutiple chart add some index to id-->
   </script>
       
</apex:page>


Regards,
Isha
Hi , Iam writing belowtest class . But Iam getting below error.

"System.QueryException: List has no rows for assignment to SObject ".


@isTest 
private class SMXNPXSurveyBLTest {     

static testMethod void testNPXsurveycasecreation(){   
  
User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
       // Insert account as current user
        
            Profile p = [SELECT Id FROM Profile WHERE Name='Standard User'];
            UserRole r = [SELECT Id FROM UserRole WHERE Name='COO'];
          user u = new User(alias = 'jsmith', email='jsmith@acme.com', 
                emailencodingkey='UTF-8', lastname='Smith', 
                languagelocalekey='en_US', 
                localesidkey='en_US', profileid = p.Id, userroleid = r.Id,
                timezonesidkey='America/Los_Angeles', 
                username='jsmith@acme.com');
                
                System.RunAs(thisUser){
            insert u;
            
       
      Account a = new Account(Name='SMX Test Account', Industry='Test Industry',BillingPostalCode='211212',BillingStreet='TestStreet',BillingCity='TestCity',BillingCountry='Japan');
      insert a;
        
     Contact c = new Contact(FirstName='SMX TestFName1', LastName='SMX TestLName1', AccountID=a.id, Email='this.is.a.smx.test@acmedemo.com', Phone='9999999');
     insert c;  
        
  
 Workgroup__c wg=New Workgroup__c();
 wg.Name='test';
 insert wg;
 
 
 Workgroup_User_Role__c WUR = new Workgroup_User_Role__c();
 WUR.Workgroup__c=wg.Id;
 WUR.Case_type__c='Admin SR';
 WUR.Product_Series__c='PULSE ONE';
 WUR.Role_Name__c=r.id;
 insert WUR;
 

 case ca= new case();
 ca.Accountid=a.id;
 ca.contactid=c.id;
 ca.subject='testsubject';
 ca.Description='testdescription';
 ca.status='submitted';
 ca.Priority='High';
 ca.Severity__c='test';
 ca.origin='Email';
 ca.Transaction_Type__c='Admin SR';
 ca.Product_Series__c='PULSE ONE';
 ca.Platform__c='PUSE ONE CONSOLE';
 ca.Release__c ='2.0';
 ca.Category__c='AAA';
 ca.SR_Category1__c='Question';
 ca.SR_Category2__c='Other';
 Test.starttest();
 insert ca;
 Test.stoptest();

 
NPX_Survey_Record__c npx = new NPX_Survey_Record__c();
npx.Account__c=a.id;
npx.contact__c=c.id;
npx.case__c=ca.id;
npx.name='test';
npx.Primary_Score__c=10;
npx.primary_comment__c='test comment';
npx.Survey_ID__c='PULSESECURE_127771';
npx.Nomination_Process__c='Case Closure Nomination';
npx.Status__c='Nominated';
npx.Survey_Name__c='Technical Support Survey';
npx.Product_Series__c='CONNECT-SECURE';
npx.Survey_Details_URL__c='';
npx.Status_Description__c='test description';
Test.starttest();
insert npx;

test.stoptest();
npx.Primary_Score__c=6;
update npx;


}

}
}


Apex class:


public with sharing class SMXNPXSurveyBL
{  
  
    /*
     * Method which takes a set of NPX Survey records and check for the primary score lessthan or equal to 6 and 
     *then create case if there is no case existed on the NPX Survey record.  
   */
  public static void createCase(List<NPX_Survey_Record__c> newRecords)
    {
    
    String severity;
    String IsAlert = 'N';
    
    Set<Id> nPXIds = new Set<Id>();    
    for(NPX_Survey_Record__c npx:newRecords){
    
        nPXIds.add(npx.id);
    }
    List<case> caseList = new  List<case>();
    List<Case> ListCases = new List<Case>();
    
     caseList=[select id,Casenumber,NPX_Survey_Record__c from Case where NPX_Survey_Record__c in :nPXIds];
     
         if(!nPXIds.isEmpty()){
         
             for(NPX_Survey_Record__c npx:newRecords){                            
                 
                 if(npx.Primary_Score__c <= 6 && npx.Survey_ID__c =='PULSESECURE_127771'){
                      
                         severity='High';
                         
                         IsAlert = 'Y';
                    }
                                       
                  if(caseList.isEmpty() && (IsAlert == 'Y')){
                    Case c=new Case();
                    c.OwnerId=npx.OwnerID;
                    c.parentid=npx.case__c;
                    c.Subject='CPSE Negative Survey for '+npx.Account__r.Name;
                    c.Survey_Details__c ='Primary Score: '+ npx.Primary_Score__c+ '\n Primary Comment: '+npx.Primary_Comment__c;
                    //c.Status=status;
                    c.Priority=severity;
                    c.AccountId=npx.Account__c;
                    c.ContactId=npx.Contact__c;
                    c.Origin='Satmetrix';
                    //c.RecordTypeId=recType.Id;
                    c.NPX_Survey_Record__c=npx.id;
                    c.SurveyDetailsURL__c = npx.Survey_Details_URL__c;
                    ListCases.add(c);
                    
                }
                
                 
             }  
              
              insert ListCases;
        }
    }
    
}


Can you please help me out on this . how to pass this one


Regards,
Isha
Hi Everyone,

I have beow scenario to implement.

Based on the conditions on case[like casestatus=''closed'] create a Customoject record with values of case.

this scenario i want to implement through Flow. Can you please help me to implement this.

Note: Currently implemented through process builder workflow. But need to change it to flow.


Regards,
Isha
Hi Everyone,

I ha ve below code. Iam trying to delete the customteammember based on the inactive users(User is a lookup field on customteammember object).  Iam getting below error.


System.SObjectException: DML statement cannot operate on trigger.new or trigger.old: Class.CustomTeamMemberTriggerBL.DeleteInactiveMembers: line 26, column 1


Code:

public class CustomTeamMemberTriggerBL{

 public static void DeleteInactiveMembers(Map<id,CustomTeamMember__c> newRecords){
 
    set<Id> cmIDs = new set<Id>();
    for(CustomTeamMember__c cm:newRecords.values()){
       cmIDs.add(cm.Distribution_List__c);
    }
    
    List<CustomTeams__c> cus = new List<CustomTeams__c>();
    List<CustomTeamMember__c> cus1 = new List<CustomTeamMember__c>();
      
    cus = [SELECT Id,Name FROM CustomTeams__c WHERE id IN: cmIDs];
    
      for(CustomTeams__c ct: cus){
     
        for(CustomTeamMember__c cm: newRecords.values()){
        
                
            if( ct.id == cm.Distribution_List__c && cm.User__r.IsActive == false){
                cus1.add(cm);
            }                   
        }        
     }  
      
    Delete cus1;
     
   }
   
  }

Please help me on this code and any changes please let me know.

Regards,
Isha
 
Hi ,

below is my vfcomponnet which is displaying in the vfpage.
<apex:page stadanrdcontroller="Account">
<apex:form>
<div> <apex:outputPanel layout="block" styleClass="chart-panel slds-scrollable" id="feedbackpane9"> <c:TrendingFeedbackIcon reportCompUniqName="AccountRelatedActivities" recId="{!Account.Id}" reRenderFeedbackCompId="feedbackpane9" reportPageName="AccountRelatedActivities"/> </apex:outputPanel> </div>
</apex:form>
</apex:page>

i have created List custom settings with active checkbox. Active__c is true the  vf componnet should be displayed orelse it should hide.


Please some one help me on this.














 
Hi Everyone,

i am using juery datepicker and onclick ofthe daterange below method iam using and in alert iam getting the value on click of the daterange picker. but i see weired funcionality that sometimes value is paaing to controller but not sometimes.
please help me how to send the values from page to controller. onclick savesettings iam saving the daterangevalue to one of the field on the
contact setting__C object. 

Issue: Sometimes value is passing and not sometimes not sure why. Please help me and let me know if you need any inormation

User-added image
<apex:commandLink status="renderLightningSpinner" action="{!saveSettings}" value="Save" reRender="pgMsgPnl" title="Save Setting" style="width:25px;height:25px;"/>
                                             <apex:actionFunction action="{!paramsave}" name="daterangemethod" rerender="">
                                                <apex:param value="" name="param1" assignTo="{!daterangevalue}"/>
                                                </apex:actionFunction>
<input name="dateRangeSelect" id="dateRangeSelect"/>
                                              Daterange:<output id="outputid" type="text" value="">{!daterangevalue} </output>                                                                                 
                                              
                                              <script>
                                               $("#dateRangeSelect").daterangepicker({
                                                   open: function(event, data) {},
 
                                                 change: function(event, data) { 
                                                 $("li.ui-menu-item").click(function(){
                                                       console.log($(this).text());
                                                      //$("#outputid").val("Date range : "+$(this).text());
                                                      $("#outputid").val($(this).text());
                                                      var dtr=  ($(this).text());                                                      
                                                      alert(dtr);                                                        
                                                       daterangemethod(dtr);
                                                    });  
public string daterangevalue {get;set;}
public void paramsave(){
        string value = apexpages.currentPage().getParameters().get('param1');
    
    }
    public void saveSettings(){
    paramsave();
        if(views.selectedView == null ||  views.selectedView.isEmpty()){
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Business unit is Required');
            ApexPages.addMessage(myMsg);
            return;
 for(string s : views.selectedView){
            if(defaultViewCS.value__c != ''){
                defaultViewCS.value__c = defaultViewCS.value__c + ';';
            }
            if(s == views.myBusinessUnit){
                 defaultViewCS.value__c =  defaultViewCS.value__c + AccountRelatedActivitiesHelper.MY_BUSINESS_UNIT;
            } else{
                 if(s == views.myDivison){
                    defaultViewCS.value__c =  defaultViewCS.value__c + AccountRelatedActivitiesHelper.MY_DIVISON;
                } else{
                    defaultViewCS.value__c =  defaultViewCS.value__c + s;
                }
            }
        }
        contactSettingToUpsert.add(defaultViewCS);
        system.debug('@@'+defaultViewCS);

        }
Hi Team,
I have below vfpage code. iam getting value of daterangevalue onclick action in jquery. i need to send this value to controller after click on save . they are already using the commandlink in the code.
i tried with param but iam geeting blank  value in the controller

   <input name="dateRangeSelect" id="dateRangeSelect">                                 
                                            <img src="{!$Resource.Downarrowimage}" width="8" height="8" style="margin-left:-16px;margin-top:-2px;position: relative;"/>
                                            </input>
                                            <output id="outputid" type="text" value="daterangevalue1"/>
                                             
                                              <script>
                                               $("#dateRangeSelect").daterangepicker({
                                                 open: function(event, data) {  },
                                                 change: function(event, data) {
                                                    $("li.ui-menu-item").click(function(){
                                                        console.log($(this).text());
                                                      $("#outputid").val("Date range : "+$(this).text());
                                                       var dtr=  ($(this).text());
                                                        alert(dtr);
                                                    });
                                                   
                                                  
                                                  
<apex:commandLink status="renderLightningSpinner" action="{!saveSettings}" value="Save" reRender="pgMsgPnl" title="Save Setting" style="width:25px;height:25px;" />
                                            
                                            
                                            
 regards,
Isha
Hi Team,

I ahve a below process builder. When ever iam trying to fire process builder iam geeting below error . Please help me how to fix this issue.


AND(
ISPICKVAL([Case].Status , "Closed"),
NOT(ISPICKVAL([Case].Origin , "Satmetrix")),
ISCHANGED([Case].Status) , 
NOT(ISBLANK([Case].ContactID)),
[Case].RecordType.Name =  'Intel Request',
OR(
ISPICKVAL([Case].GiCa_Intel_Request_Subtype__c, "Threat"),
ISPICKVAL([Case].GiCa_Intel_Request_Subtype__c, "Technical")
),
AND(
NOT(ISBLANK([Case].Contact.Account.Name )),
NOT(ISNULL([Case].Contact.AccountId ))
),
NOT(BEGINS([Case].Account.Name, "FireEye")),
NOT(CONTAINS([Case].Contact.Email, '@mandiant.com')),
NOT(CONTAINS([Case].Contact.Email, 'FireEye')),
NOT(CONTAINS(TEXT([Case].Gica_OutCome__c) , 'Unable to Support') )
)


flow error:

Error element myDecision4 (FlowDecision).
The flow failed to access the value for myVariable_current.Account.Id because it hasn't been set or assigned.

Flow Details
Flow API Name: NPX_Case_Closure_Nomination
Type: Record Change Process
Version: 22
Status: Active
Org: FireEye Inc. (00D22000000DBIr)

Flow Interview Details
Interview Label: NPX_Case_Closure_Nomination-22_InterviewLabel
Current User: Nice User (00522000001NTRM)
Start time: 8/27/2019 1:03 AM
Duration: 0 seconds

How the Interview Started
Nice User (00522000001NTRM) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = Case (500220000035BNpAAM)
myVariable_current = Case (500220000035BNpAAM)

DECISION: myDecision
Skipped this outcome because its conditions weren't met: myRule_1
Outcome conditions:
{!formula_myRule_1} (false) Equals true

Default outcome executed.

Salesforce Error ID: 1861759023-21181 (-1729454283)
Error element myDecision4 (FlowDecision).
The flow failed to access the value for myVariable_current.Account.Id because it hasn't been set or assigned.

Flow Details
Flow API Name: NPX_Case_Closure_Nomination
Type: Record Change Process
Version: 22
Status: Active
Org: FireEye Inc. (00D22000000DBIr)

Flow Interview Details
Interview Label: NPX_Case_Closure_Nomination-22_InterviewLabel
Current User: Nice User (00522000001NTRM)
Start time: 8/27/2019 1:03 AM
Duration: 0 seconds

How the Interview Started
Nice User (00522000001NTRM) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = Case (500220000035BNpAAM)
myVariable_current = Case (500220000035BNpAAM)

DECISION: myDecision
Skipped this outcome because its conditions weren't met: myRule_1
Outcome conditions:
{!formula_myRule_1} (false) Equals true

Default outcome executed.

Salesforce Error ID: 1861759023-21181 (-1729454283)



Regards,
Isha
Hi I have Below Vf page and i created a VF tab with URL . The URL is loading in Classic and lightning but not in mobile. I am suspecting the problem with the targetURL parameter which iam passing. Can you please help me solve this.

I tried with some other vfpage passing Accountid it is loading properly. 

Vfpage:



<apex:page lightningStylesheets="true" showHeader="false">
    <apex:iframe id="NPXDashboardFrame" height="1000px" scrolling="true"/>
   <!-- <iframe  id="NPXDashboardFrame" style="overflow: auto!important; -webkit-overflow-scrolling: touch!important;position:absolute; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;"/>-->


 <script type="text/javascript">
    var enterpriseIdfier = 'ISHA';//this need to change as per enterprise

    var smxServer = '{!$Setup.SMX_URL__c.SMX_URL__c}'; 
    var varSessionID = '{!$Api.Session_ID}';
     alert(varSessionID);
  var Server ='{!$Setup.SFDC_URL__c.SFDC_URL__c}';
  //var Server ='{!$Api.Partner_Server_URL_90}';
    var varOwner = '{!$User.Id}';
    var varUsername = '{!$User.Username}';
    var embedChartUrl='/main/WebUI.html';
    var url = smxServer + '/app/core/j_satmetrix_security_check?session='+ varSessionID + '&server="'+Server+'"&owner='+varOwner+'&username='+varUsername+'&version=3&enterpriseIdfier='+enterpriseIdfier+'&requestTokenType=SALES_FORCE&requestToken=NONE&targetUrl='+embedChartUrl;
    
    alert(url);
    document.getElementById('NPXDashboardFrame').src = url;
    
       
   
    </script>
</apex:page>
User-added image

Can comeone help me on this.


Regards,
Isha
Hi team,

I have a vfpage design which holds the logic of based on the case status change new fields should be displayed and once value will be given and click on save values will be saved and fields should be non edit mode and should hike the save button as well


vfpage:

<apex:page standardController="Case" extensions="caseextension">
    
    <apex:form id="theForm">
        
        <apex:pageBlock mode="inlineEdit">
            <apex:pageblockSection >
                <apex:outputField value="{!Case.Status}">
                    <apex:actionSupport event="onchange" reRender="theForm"/>
                </apex:outputField>
            </apex:pageblockSection>
        </apex:pageBlock>
        
        <apex:pageblock mode="inlineEdit">
       
            <apex:pageblockSection rendered="{!IF(Case.Status = 'Working' && rend,TRUE,FALSE)}">
                <apex:inputField value="{!Case.Working_1__c}"/>
                <apex:inputField value="{!Case.Working_2__c}"/>
            </apex:pageblockSection>
            
            <apex:pageblockSection rendered="{!Case.Status = 'Escalated' && rend}">
                <apex:inputField value="{!Case.NewText1__c}"/>
                <apex:inputField value="{!Case.New_Text2__c}"/>
           
            </apex:pageblockSection>
            
            <apex:pageblockSection rendered="{!Case.Status = 'Working' && rend1}">
                <apex:outputField value="{!Case.Working_1__c}"/>
                <apex:outputField value="{!Case.Working_2__c}"/>
            </apex:pageblockSection>
            
            <apex:pageblockbuttons>
                 <apex:commandButton value="Save" action="{!save}"/>
                 
            </apex:pageblockbuttons>
            
        </apex:pageblock>
    </apex:form>
</apex:page>


Class:

public class caseextension {

    private final Case caseObj;
    public boolean rend{get;set;}
    public boolean rend1{get;set;}

    // get Case record from the standard controller and putting it in a member variable
    public caseextension (ApexPages.StandardController stdController) {
        this.caseObj = (Case)stdController.getRecord();
        rend=true;
        rend1=false;
    }

    public  PageReference save(){
        // TO DO
        rend=false;
        rend1=true;
        
        insert caseObj;
           
        
        
     return null;

    }

}

Iam getting below error User-added image
Regards,
Isha
Hi Team,

I have a Req that on cas estandard page based on the status value need to display the different fieds.

Status='Working'--> Text1 Text 2 fields should display.
Status='Escalate'--> Text3 Text4 fields should display.

On save of this values it should be saved on the case . Please suggest me how can acheive this.

My Current page:

<apex:pageBlock >
<apex:pageblockSection >
  <apex:inputfield value="{!Case.Status}">
    <apex:actionSupport event="onchange" reRender="theForm" />
</apex:inputField>

  <apex:inputField value="{!Case.NewText1__c}" rendered="{!IF(Case.Status == 'Escalated',true,false)}"/>
  <apex:inputField value="{!Case.New_Text2__c}" rendered="{!IF(Case.Status == 'Escalated',true,false)}" />
  
  <apex:inputField value="{!Case.Working_1__c}" rendered="{!IF(Case.Status == 'Working',true,false)}" />
  <apex:inputField value="{!Case.Working_2__c}" rendered="{!IF(Case.Status == 'Working',true,false)}" />
  
   </apex:pageblockSection>
<apex:pageblockbuttons >
<apex:commandButton value="save" action="{!save}"/>

</apex:pageblockbuttons>
</apex:pageBlock>
</apex:form>

</apex:page>


Please help me on save and any changes on the code.


Regards,
Isha 

 
HI team,


I have my below vfpage . which is working on both lighting and classic with mobile. but in mobile scroll bar is not working kindly any help on this.


<apex:page standardController="Account" tabStyle="Account">
 <!--<apex:includeLightning />-->
 <apex:slds >
   <apex:iframe src="" scrolling="true" height="650px" id="NPXAccountChartFrame"/>
  

   <!--if you embed mutiple chart add some index to id-->
   <script>
    document.getElementById("NPXAccountChartFrame").style.overflow:auto; 
   
    var embeddedLink = '{!$Setup.SFDC_URL__c.NPX_Account_View_Embed__c}';
    var embedChartUrl = '/main/embed?'+embeddedLink;//this need to change as per chart/view embed link
    //var enterpriseIdfier = 'SMXCONNECTORS';//this need to change as per enterprise
    var enterpriseIdfier = 'RASMITHA';//this need to change as per enterprise
    console.log('Account.Id = {!Account.Id}');
    var smxServer = '{!$Setup.SMX_URL__c.SMX_URL__c}'; 
    var varSessionID = '{!$Api.Session_ID}';
    var saleforceServer = '{!$Setup.SFDC_URL__c.SFDC_URL__c}';
    var varOwner = '{!$User.Id}';
    var varUsername = '{!$User.Username}';
    embedChartUrl = embedChartUrl + '&urlParams={"INTEGRATION_COMPANY_CODE":"{!Account.Id}"}';
    
    var url = smxServer + '/app/core/j_satmetrix_security_check?session='+ varSessionID + '&server="'+saleforceServer+'"&owner='+varOwner+'&username='+varUsername+'&version=3&enterpriseIdfier='+enterpriseIdfier+'&requestTokenType=SALES_FORCE&requestToken=NONE&targetUrl='+embedChartUrl;
    
    document.getElementById('NPXAccountChartFrame').src = url;
    
    <!--if you embed mutiple chart add some index to id-->
   </script>
    </apex:slds>   
</apex:page>


Regards,
Isha
Hi , Iam writing belowtest class . But Iam getting below error.

"System.QueryException: List has no rows for assignment to SObject ".


@isTest 
private class SMXNPXSurveyBLTest {     

static testMethod void testNPXsurveycasecreation(){   
  
User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
       // Insert account as current user
        
            Profile p = [SELECT Id FROM Profile WHERE Name='Standard User'];
            UserRole r = [SELECT Id FROM UserRole WHERE Name='COO'];
          user u = new User(alias = 'jsmith', email='jsmith@acme.com', 
                emailencodingkey='UTF-8', lastname='Smith', 
                languagelocalekey='en_US', 
                localesidkey='en_US', profileid = p.Id, userroleid = r.Id,
                timezonesidkey='America/Los_Angeles', 
                username='jsmith@acme.com');
                
                System.RunAs(thisUser){
            insert u;
            
       
      Account a = new Account(Name='SMX Test Account', Industry='Test Industry',BillingPostalCode='211212',BillingStreet='TestStreet',BillingCity='TestCity',BillingCountry='Japan');
      insert a;
        
     Contact c = new Contact(FirstName='SMX TestFName1', LastName='SMX TestLName1', AccountID=a.id, Email='this.is.a.smx.test@acmedemo.com', Phone='9999999');
     insert c;  
        
  
 Workgroup__c wg=New Workgroup__c();
 wg.Name='test';
 insert wg;
 
 
 Workgroup_User_Role__c WUR = new Workgroup_User_Role__c();
 WUR.Workgroup__c=wg.Id;
 WUR.Case_type__c='Admin SR';
 WUR.Product_Series__c='PULSE ONE';
 WUR.Role_Name__c=r.id;
 insert WUR;
 

 case ca= new case();
 ca.Accountid=a.id;
 ca.contactid=c.id;
 ca.subject='testsubject';
 ca.Description='testdescription';
 ca.status='submitted';
 ca.Priority='High';
 ca.Severity__c='test';
 ca.origin='Email';
 ca.Transaction_Type__c='Admin SR';
 ca.Product_Series__c='PULSE ONE';
 ca.Platform__c='PUSE ONE CONSOLE';
 ca.Release__c ='2.0';
 ca.Category__c='AAA';
 ca.SR_Category1__c='Question';
 ca.SR_Category2__c='Other';
 Test.starttest();
 insert ca;
 Test.stoptest();

 
NPX_Survey_Record__c npx = new NPX_Survey_Record__c();
npx.Account__c=a.id;
npx.contact__c=c.id;
npx.case__c=ca.id;
npx.name='test';
npx.Primary_Score__c=10;
npx.primary_comment__c='test comment';
npx.Survey_ID__c='PULSESECURE_127771';
npx.Nomination_Process__c='Case Closure Nomination';
npx.Status__c='Nominated';
npx.Survey_Name__c='Technical Support Survey';
npx.Product_Series__c='CONNECT-SECURE';
npx.Survey_Details_URL__c='';
npx.Status_Description__c='test description';
Test.starttest();
insert npx;

test.stoptest();
npx.Primary_Score__c=6;
update npx;


}

}
}


Apex class:


public with sharing class SMXNPXSurveyBL
{  
  
    /*
     * Method which takes a set of NPX Survey records and check for the primary score lessthan or equal to 6 and 
     *then create case if there is no case existed on the NPX Survey record.  
   */
  public static void createCase(List<NPX_Survey_Record__c> newRecords)
    {
    
    String severity;
    String IsAlert = 'N';
    
    Set<Id> nPXIds = new Set<Id>();    
    for(NPX_Survey_Record__c npx:newRecords){
    
        nPXIds.add(npx.id);
    }
    List<case> caseList = new  List<case>();
    List<Case> ListCases = new List<Case>();
    
     caseList=[select id,Casenumber,NPX_Survey_Record__c from Case where NPX_Survey_Record__c in :nPXIds];
     
         if(!nPXIds.isEmpty()){
         
             for(NPX_Survey_Record__c npx:newRecords){                            
                 
                 if(npx.Primary_Score__c <= 6 && npx.Survey_ID__c =='PULSESECURE_127771'){
                      
                         severity='High';
                         
                         IsAlert = 'Y';
                    }
                                       
                  if(caseList.isEmpty() && (IsAlert == 'Y')){
                    Case c=new Case();
                    c.OwnerId=npx.OwnerID;
                    c.parentid=npx.case__c;
                    c.Subject='CPSE Negative Survey for '+npx.Account__r.Name;
                    c.Survey_Details__c ='Primary Score: '+ npx.Primary_Score__c+ '\n Primary Comment: '+npx.Primary_Comment__c;
                    //c.Status=status;
                    c.Priority=severity;
                    c.AccountId=npx.Account__c;
                    c.ContactId=npx.Contact__c;
                    c.Origin='Satmetrix';
                    //c.RecordTypeId=recType.Id;
                    c.NPX_Survey_Record__c=npx.id;
                    c.SurveyDetailsURL__c = npx.Survey_Details_URL__c;
                    ListCases.add(c);
                    
                }
                
                 
             }  
              
              insert ListCases;
        }
    }
    
}


Can you please help me out on this . how to pass this one


Regards,
Isha
Hi Everyone,

I ha ve below code. Iam trying to delete the customteammember based on the inactive users(User is a lookup field on customteammember object).  Iam getting below error.


System.SObjectException: DML statement cannot operate on trigger.new or trigger.old: Class.CustomTeamMemberTriggerBL.DeleteInactiveMembers: line 26, column 1


Code:

public class CustomTeamMemberTriggerBL{

 public static void DeleteInactiveMembers(Map<id,CustomTeamMember__c> newRecords){
 
    set<Id> cmIDs = new set<Id>();
    for(CustomTeamMember__c cm:newRecords.values()){
       cmIDs.add(cm.Distribution_List__c);
    }
    
    List<CustomTeams__c> cus = new List<CustomTeams__c>();
    List<CustomTeamMember__c> cus1 = new List<CustomTeamMember__c>();
      
    cus = [SELECT Id,Name FROM CustomTeams__c WHERE id IN: cmIDs];
    
      for(CustomTeams__c ct: cus){
     
        for(CustomTeamMember__c cm: newRecords.values()){
        
                
            if( ct.id == cm.Distribution_List__c && cm.User__r.IsActive == false){
                cus1.add(cm);
            }                   
        }        
     }  
      
    Delete cus1;
     
   }
   
  }

Please help me on this code and any changes please let me know.

Regards,
Isha
 
Hi Everyone,

I have below vfpage code. iam getting value of daterangevalue onclick action in jquery. i need to send this value to controller after click on save . they are already using the commandlink in the code.
i tried with param but iam geeting blank  value in the controller
 
 
 i need help on to pass "daterangevalue" variable from controller to page . 


         <input name="dateRangeSelect" id="dateRangeSelect">                                 
                                            <img src="{!$Resource.Downarrowimage}" width="8" height="8" style="margin-left:-16px;margin-top:-2px;position: relative;"/>
                                            </input>
                                            <output id="outputid" type="text" value="daterangevalue1"/>
                                             
                                              <script>
                                               $("#dateRangeSelect").daterangepicker({
                                                 open: function(event, data) {  },
                                                 change: function(event, data) {
                                                    $("li.ui-menu-item").click(function(){
                                                        console.log($(this).text());
                                                      $("#outputid").val("Date range : "+$(this).text());
                                                       var daterangevalue=  ($(this).text());
                                                        alert(daterangevalue);
                                                    });
                                                   var a = '{!daterangevalue}';
                                                   alert(a);
                                                  
                                                  
<apex:commandLink status="renderLightningSpinner" action="{!saveSettings}" value="Save" reRender="pgMsgPnl" title="Save Setting" style="width:25px;height:25px;" onclick={} >
                                            <apex:param name="daterangevalue" value="" assignTo="{!daterangevalue}"/>
                                            </apex:commandLink>
                                            
        controller:
        public string daterangevalue{get;set;}
        public void saveSettings(){
    
    string value=Apexpages.currentPage().getParameters().get('daterangevalue');

    system.debug('@@test:'+value);



result:  @@test:[blank]
Regards,
Isha
Hi everyone,

i am trying to write the testclass on below class.  some one help me on the test class. I have tried the below given test class but got 0% coverage



public class Trendingfeedbackiconextension{
 
    
    public Id RecordId{get;set;}       
    public String param1 { get; set; }
    public String buttonText{get;set;}
    public string reportComponentName{get;set;}
    public string reportComponentUniqueName{get; 
            set {
            reportComponentUniqueName = value;
            Trendingfeedbackhelperextensionmethod();
            }}
              
    Map<String,Integer> likedislikeCountMap = new Map<String,Integer>();
     
    public pagereference likeDislikemethod(){
     likedislikeCountMap.clear();
    RecordId= Apexpages.currentPage().getParameters().get('id');
    
    System.debug('@@'+RecordId);   
         system.debug('reportComponentUniqueName==>'+reportComponentUniqueName );
        system.debug('reportComponentName==>'+reportComponentName);
        string value= Apexpages.currentPage().getParameters().get('param1');
        system.debug('param1==>'+param1);  
        string componentName = param1.split('-')[0];
        string actionName = param1.split('-')[1];  
        system.debug('componentName==>'+componentName);    
        system.debug('actionName==>'+actionName);    
        //sentdata= Userinfo.getUserId();
        system.debug('@@'+value);
        list<Feedback__c> flist= new list<Feedback__c>();
        Feedback__c f=new Feedback__c();
        flist=[select id,Name,Action__c,User__c,Comment__c from Feedback__c where Name=:componentName And ((Action__c='Like' Or Action__c='Dislike') And User__c=:Userinfo.getUserId()) And AccountId__c=:RecordId];
        system.debug('@@'+flist);
        if(flist.size()== 0){
            system.debug('@@'+flist.size());
            f.Action__c = actionName;
            //sendAction = f.Action__c;
            f.Name = componentName;
            f.AccountId__c=RecordId;
            f.Comment__c=buttonText;
            f.User__c = UserInfo.getUserId();
            system.debug('f===>'+f);
            insert f;

        }
        else {
            system.debug('elseenter');
            for(Feedback__c f2:flist){
                f2.Action__c = actionName;
                f2.Comment__c= buttonText;
              /*  if(f2.Action__c == 'Like'){
                    system.debug('@@'+likedata);
                    system.debug('@@'+dislikedata);
                    likedata =True;
                    dislikedata = false;

                }
                else if(f2.Action__c == 'Dislike'){
                    likedata =false;
                    dislikedata = true;

                }*/

            }
            update flist;
            Trendingfeedbackhelperextensionmethod();
        }
         buttonText='';
        return null;

    }


    

    public void Trendingfeedbackhelperextensionmethod(){ 

     RecordId= Apexpages.currentPage().getParameters().get('id');   
     System.debug('@@'+RecordId);   
       
        system.debug('method enter');
        system.debug('reportComponentUniqueName==>'+reportComponentUniqueName );
        system.debug('reportComponentName==>'+reportComponentName);
        system.debug('@@'+RecordId);
        //list<AggregateResult> results = [select count(Id) Quantity,Action__c FROM Feedback__c WHERE Name In('AORT1','AORT2') GROUP BY  Action__c];        
        list<AggregateResult> results = [select count(Id) Quantity,Action__c FROM Feedback__c WHERE Name =:reportComponentUniqueName and AccountId__c=:RecordId GROUP BY  Action__c having Action__c='Like' OR Action__c='Dislike'];        

        system.debug('@@'+results);
        for(AggregateResult ar : results){
            system.debug('@@'+results);            
            likedislikeCountMap.put((string)ar.get('Action__c'), (integer)ar.get('Quantity'));
            system.debug('@@'+likedislikeCountMap); 
        
       getLikeCount();
       getDislikeCount();
        

        }              

    }
   
    public Trendingfeedbackiconextension(){
   Trendingfeedbackhelperextensionmethod();    
       //system.debug('method enter');
    }
        
/*

        //list<AggregateResult> results = [select count(Id) Quantity,Action__c FROM Feedback__c WHERE Name In('AORT1','AORT2') GROUP BY  Action__c];        
        list<AggregateResult> results = [select count(Id) Quantity,Action__c FROM Feedback__c WHERE Name ='AccountOrganizationRevenueTrend' GROUP BY  Action__c];        

        system.debug('@@'+results);
        for(AggregateResult ar : results){
            system.debug('@@'+results);            
            likedislikeCountMap.put((string)ar.get('Action__c'), (integer)ar.get('Quantity'));
            system.debug('@@'+likedislikeCountMap); 
        }
    
    }*/

     public Integer getLikeCount(){
        if(likedislikeCountMap.get('Like') == null) {
        system.debug('like');
            return 0;
        } 
        return likedislikeCountMap.get('Like');
        
        
    }  
    public Integer getDislikeCount(){
    
        if(likedislikeCountMap.get('Dislike') == null) {
        system.debug('Dislike');
            return 0;
        }
        return likedislikeCountMap.get('Dislike');
    }


    public PageReference Save() {
    string value2= Apexpages.currentPage().getParameters().get('param2');
        string componentName = value2.split('-')[0];
        string actionName = value2.split('-')[1];
        list<Feedback__c> f=new list<Feedback__c>();
        Feedback__c fb=new Feedback__c();
        fb.Action__c=actionName;
        fb.Name=componentName;    
        fb.Comment__c=buttonText;
        fb.AccountId__c=Apexpages.currentPage().getParameters().get('id');
        fb.User__c=userinfo.getuserid();
        f.add(fb);
        insert f; 

        buttonText='';
        return null;
       }




}

Test class:

@isTest
public class TrendingfeedbackiconextensionTest {
    
private static testMethod void trendingfeedbacktest() {

    //list<Feedback__c> f1 = new list<Feedback__c>();
    Feedback__c f2 = new Feedback__c();
    f2.AccountId__c = 'testid';
    f2.Action__c = 'Like';
    f2.Comment__c = 'testcomment';
    f2.User__c = UserInfo.getUserId();
   // f1.add(f2);
    insert f2;
    
    f2.Action__c= 'Dislike';
    
    Update f2;
  
   
    
}
}


Regards,
Isha
Hello Eevryone,

If i click on the quickaction i need to display the below URL in case object.Can you help me how to do this.


http://compass/trainer/mycompass/patients?pageaction=search&mrn=\{!Account.Mrn__pc}


Regards,
Isha

Hi,

I have below formuls.Getting the below error that "Compiled formula is too big to execute (6,846 characters). Maximum size is 5,000 characters".

Can you please help on this?

IF (OR ((Initial_Engagement_Date__c>Contract_Provided_Date__c),
          (Initial_Engagement_Date__c>Contract_Signed_Date__c),
          (Initial_Engagement_Date__c>Latest_Implementation_Date__c),
          (Initial_Engagement_Date__c>Go_Live_Date__c)),"Engaged",          
IF(OR ((Contract_Provided_Date__c>= Initial_Engagement_Date__c),
          (Contract_Provided_Date__c>Contract_Signed_Date__c),
          (Contract_Provided_Date__c>Latest_Implementation_Date__c),
          (Contract_Provided_Date__c>Go_Live_Date__c)),"Contract Provided",                    
IF(OR ((Contract_Signed_Date__c>= Initial_Engagement_Date__c),
          (Contract_Signed_Date__c>=Contract_Provided_Date__c),
          (Contract_Signed_Date__c>Latest_Implementation_Date__c),
          (Contract_Signed_Date__c>Go_Live_Date__c)),"Contract Signed",
IF(OR ((Latest_Implementation_Date__c>= Initial_Engagement_Date__c),
          (Latest_Implementation_Date__c>=Contract_Provided_Date__c),
         (Latest_Implementation_Date__c>= Contract_Signed_Date__c),
          (Latest_Implementation_Date__c>Go_Live_Date__c)),"Implementation",
IF(OR ((Go_Live_Date__c>= Initial_Engagement_Date__c),
          (Go_Live_Date__c>=Contract_Provided_Date__c),
          (Go_Live_Date__c>=Latest_Implementation_Date__c)), "Live",
IF(ISPICKVAL(CL360_Status__c, "Declined"), "Declined",NULL))))))



Regards,
Isha
Hi Everyone,

I Have one urgent issue.can anybody help me on this?

Can you enable this access quickly for testuser?  Profile1  profile need the ability to login as Profile2 profile.


Regards,
Isha