-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
91Questions
-
59Replies
testclass for custommetadata apexclass -urgent need help
Please help with testclass for below class.
public static void handleAfterUpdateUpdatedate(List<Product__c> listNewProducts, map<ID, Product__c> mapOldProducts){
List<Product__c> ProductList = new List<Product__c>();
Product__c pd = new Product__c();
public static map<String, Statute_Date_Update__mdt> mapstatueMetadata = Statute_Date_Update__mdt.getAll();
for(Product__c prod : listNewProducts){
Product__c prodOld12 = mapOldProducts.get(prod.Id);
if((prod.Last_Payment_Date__c != prodOld12.Last_Payment_Date__c) ||( prod.Open_Date__c != prodOld12.Open_Date__c) )
{
if(prod.Statute_Date__c > prod.Date_for_Stat_Barred_calculations__c){
if(prod.Date_for_Stat_Barred_calculations__c!=null){
Map<String, Statute_Date_Update__mdt> mtdMap = new Map<String, Statute_Date_Update__mdt>();
// List<Statute_Date_Update__mdt> mtData = [Select Id, MasterLabel, Months__c From Statute_Date_Update__mdt];
for(Statute_Date_Update__mdt m:mapstatueMetadata.values()){
mtdMap.put(m.MasterLabel, m);
}
system.debug('mtdMap## ' + mtdMap);
if(mtdMap.containsKey(prod.State__c) && prod.State__c !=prodOld12.State__c){
Integer i= Integer.valueof(mtdMap.get(prod.State__c).Months__c);
pd.Id = prod.Id;
pd.Statute_Date__c = prod.Date_for_Stat_Barred_calculations__c.addMonths(i);
ProductList.add(pd);
}
}
}
}
}
if(!ProductList.isEmpty()){
update ProductList;
}
}
public static void handleAfterUpdateUpdatedate(List<Product__c> listNewProducts, map<ID, Product__c> mapOldProducts){
List<Product__c> ProductList = new List<Product__c>();
Product__c pd = new Product__c();
public static map<String, Statute_Date_Update__mdt> mapstatueMetadata = Statute_Date_Update__mdt.getAll();
for(Product__c prod : listNewProducts){
Product__c prodOld12 = mapOldProducts.get(prod.Id);
if((prod.Last_Payment_Date__c != prodOld12.Last_Payment_Date__c) ||( prod.Open_Date__c != prodOld12.Open_Date__c) )
{
if(prod.Statute_Date__c > prod.Date_for_Stat_Barred_calculations__c){
if(prod.Date_for_Stat_Barred_calculations__c!=null){
Map<String, Statute_Date_Update__mdt> mtdMap = new Map<String, Statute_Date_Update__mdt>();
// List<Statute_Date_Update__mdt> mtData = [Select Id, MasterLabel, Months__c From Statute_Date_Update__mdt];
for(Statute_Date_Update__mdt m:mapstatueMetadata.values()){
mtdMap.put(m.MasterLabel, m);
}
system.debug('mtdMap## ' + mtdMap);
if(mtdMap.containsKey(prod.State__c) && prod.State__c !=prodOld12.State__c){
Integer i= Integer.valueof(mtdMap.get(prod.State__c).Months__c);
pd.Id = prod.Id;
pd.Statute_Date__c = prod.Date_for_Stat_Barred_calculations__c.addMonths(i);
ProductList.add(pd);
}
}
}
}
}
if(!ProductList.isEmpty()){
update ProductList;
}
}
- sfdc@isha.ax1814
- November 20, 2022
- Like
- 0
Rollupsummary Sum Agreate Triger error
REQUIREMENT: The developer has been mandated to use Apex to aggregate the hours on the projects whenever a timesheet entry is created or updated. 1. Create the custom objects in the org with these custom fields Object Project Timesheet Fields Total Billable Hours (Number (3,2)) Project (LOOKUP to Project) Total Non-Billable Hours (Number (3,2)) Hours (Number (3,2)) Billable (Boolean) 2. Create a trigger (“AFTER INSERT, AFTER UPDATE”) on TIMESHEET a. Update the parent project’s Total Billable Hours with the SUM of all related Timesheets hours where “billable=true” b. Update the parent project’s Total Non-Billable Hours with the SUM of all related Timesheets hours where “billable=false
trigger RollUpFromChildToParent on Timesheet__c (after insert, after update) {
Set<Id> prjtIds = new Set<Id>();
Map<Id,Project__c> projectMapToUpdate = new Map<Id,Project__c>();
if(Trigger.isInsert || Trigger.isUpdate){
for(Timesheet__c th : Trigger.new){
if(th.Project__c != null){
prjtIds.add(th.Project__c);
}
}
}
List<Project__c> PrjtList = new List<Project__c>();
List<AggregateResult> AggregateResultList= [select project__c,Sum(Hours__c)tbh from Timesheet__c where project__c in:prjtIds group by Billable__c];
if(AggregateResultList != null && AggregateResultList.size() > 0){
for(AggregateResult aggr:AggregateResultList){
if (String.valueOf(aggr.get('Billable__c'))=='True')
{
project__c pr1=new project__c();
pr1.Id = (Id)aggr.get('Project__c');
pr1.Total_Billable_Hours__c = (Decimal)aggr.get('tbh');
projectMapToUpdate.put(pr1.Id, pr1);
}
else{
project__c pr1=new project__c();
pr1.Total_Non_Billable_Hours__c = (Decimal)aggr.get('tbh');
projectMapToUpdate.put(pr1.Id, pr1);
}
// PrjtList.add(pr1);
}
try{
update projectMapToUpdate.values();
}catch(DmlException de){
System.debug(de);
}
}
}
My logic is not working. Please help me
Regards,
Isha
trigger RollUpFromChildToParent on Timesheet__c (after insert, after update) {
Set<Id> prjtIds = new Set<Id>();
Map<Id,Project__c> projectMapToUpdate = new Map<Id,Project__c>();
if(Trigger.isInsert || Trigger.isUpdate){
for(Timesheet__c th : Trigger.new){
if(th.Project__c != null){
prjtIds.add(th.Project__c);
}
}
}
List<Project__c> PrjtList = new List<Project__c>();
List<AggregateResult> AggregateResultList= [select project__c,Sum(Hours__c)tbh from Timesheet__c where project__c in:prjtIds group by Billable__c];
if(AggregateResultList != null && AggregateResultList.size() > 0){
for(AggregateResult aggr:AggregateResultList){
if (String.valueOf(aggr.get('Billable__c'))=='True')
{
project__c pr1=new project__c();
pr1.Id = (Id)aggr.get('Project__c');
pr1.Total_Billable_Hours__c = (Decimal)aggr.get('tbh');
projectMapToUpdate.put(pr1.Id, pr1);
}
else{
project__c pr1=new project__c();
pr1.Total_Non_Billable_Hours__c = (Decimal)aggr.get('tbh');
projectMapToUpdate.put(pr1.Id, pr1);
}
// PrjtList.add(pr1);
}
try{
update projectMapToUpdate.values();
}catch(DmlException de){
System.debug(de);
}
}
}
My logic is not working. Please help me
Regards,
Isha
- sfdc@isha.ax1814
- October 02, 2022
- Like
- 0
Can't save permission set Test Permission set, which is assigned to a user with user license Salesforce. The user license doesn't allow the permission:
Hi Team,
Iam facing below issue when ever iam trying to edit my permission set 'Test Permission set'. Please let me know how i can edit and make the chnages in permission set?
Error:
Can't save permission set Test Permission set, which is assigned to a user with user license Salesforce. The user license doesn't allow the permission:
Regards,
Isha
Iam facing below issue when ever iam trying to edit my permission set 'Test Permission set'. Please let me know how i can edit and make the chnages in permission set?
Error:
Can't save permission set Test Permission set, which is assigned to a user with user license Salesforce. The user license doesn't allow the permission:
Regards,
Isha
- sfdc@isha.ax1814
- July 29, 2021
- Like
- 0
Remove Html tags from text area
Hi Team,
I have below rich text area and long texta rea fields. We migrated data from one sandbox to another sandbox. After migrtaion We can see data mixed with html tags. I want to remove these html tags. Can you please help me how to solve this issue.
Summary of local treating provide treatment plan
summary of AH provider treatment plan
Regards,
Isha
I have below rich text area and long texta rea fields. We migrated data from one sandbox to another sandbox. After migrtaion We can see data mixed with html tags. I want to remove these html tags. Can you please help me how to solve this issue.
Summary of local treating provide treatment plan
summary of AH provider treatment plan
Regards,
Isha
- sfdc@isha.ax1814
- March 29, 2021
- Like
- 0
Display error message when we select the picklist value in vfpage
Hi Team,
I want to display error mesg when we select 'Other-Explain'.
<apex:page showHeader="false" action="{!InitMethod}" cache="false" controller="AH_HN_PhysicianAcceptnReject_CLS" tabStyle="Case">
<apex:includeScript value="/soap/ajax/36.0/connection.js"/>
<apex:includeScript value="/soap/ajax/36.0/apex.js"/>
<apex:includeLightning />
<apex:Pagemessages />
<head>
<apex:slds />
<div class="slds-align_absolute-center">
<apex:image url="{!$Resource.AH_Physician_Expert_Template_Logo}" />
</div>
</head>
<apex:form >
<div class="slds-align_absolute-center">
<apex:outputText rendered="{!ThanksmsgAccpt}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for accepting, the case has now been added to your dashboard. Please log into the physician portal to begin your review.</span>
</apex:outputText>
<!--
<apex:outputText rendered="{!ThanksmsgRejec}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/> </span>
</apex:outputText>
-->
<apex:outputText rendered="true">
<apex:pageBlock >
<!-- span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/><br/> </span -->
<p>Please select the reason:</p>
<apex:actionRegion >
<apex:selectList id="Pleaseselectthereason" size="1" label="caseRejectReason" value="{!caseRejectReason}">
<apex:selectoption itemLabel="Out of office-cannot complete due to existing workload" itemValue="Out of office-cannot complete due to existing workload"></apex:selectoption>
<apex:selectoption itemLabel="I recommend another physician more suitable for this case.Enter Name in Free Text Box" itemValue="I recommend another physician more suitable for this case.Enter Name in Free Text Box"></apex:selectoption>
<apex:selectoption itemLabel="Other - explain" itemValue="Other - explain"></apex:selectoption>
<!--<apex:actionSupport event="onchange" reRender="comments" />-->
</apex:selectList>
</apex:actionRegion>
<br/>
<p>Comments:</p>
<apex:inputTextarea label="Comments" style="width:550px;height:100px" id="comments" value="{!caseRejectComment}"/>
<br/><br/>
<div align="center" draggable="false" >
<apex:commandButton action="{!saveRejectInfo}" value="Save"/>
</div>
</apex:pageBlock>
</apex:outputText>
<apex:outputText rendered="{!rejectreasonmessage}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.</span>
</apex:outputText>
<apex:outputText rendered="{!Assignedtoothers}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">This case has already been assigned to some other physician.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyAccepted}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already accepted the case.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyRejected}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already rejected the case.</span>
</apex:outputText>
</div>
</apex:form>
</apex:page>
Regards,
Isha
I want to display error mesg when we select 'Other-Explain'.
<apex:page showHeader="false" action="{!InitMethod}" cache="false" controller="AH_HN_PhysicianAcceptnReject_CLS" tabStyle="Case">
<apex:includeScript value="/soap/ajax/36.0/connection.js"/>
<apex:includeScript value="/soap/ajax/36.0/apex.js"/>
<apex:includeLightning />
<apex:Pagemessages />
<head>
<apex:slds />
<div class="slds-align_absolute-center">
<apex:image url="{!$Resource.AH_Physician_Expert_Template_Logo}" />
</div>
</head>
<apex:form >
<div class="slds-align_absolute-center">
<apex:outputText rendered="{!ThanksmsgAccpt}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for accepting, the case has now been added to your dashboard. Please log into the physician portal to begin your review.</span>
</apex:outputText>
<!--
<apex:outputText rendered="{!ThanksmsgRejec}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/> </span>
</apex:outputText>
-->
<apex:outputText rendered="true">
<apex:pageBlock >
<!-- span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/><br/> </span -->
<p>Please select the reason:</p>
<apex:actionRegion >
<apex:selectList id="Pleaseselectthereason" size="1" label="caseRejectReason" value="{!caseRejectReason}">
<apex:selectoption itemLabel="Out of office-cannot complete due to existing workload" itemValue="Out of office-cannot complete due to existing workload"></apex:selectoption>
<apex:selectoption itemLabel="I recommend another physician more suitable for this case.Enter Name in Free Text Box" itemValue="I recommend another physician more suitable for this case.Enter Name in Free Text Box"></apex:selectoption>
<apex:selectoption itemLabel="Other - explain" itemValue="Other - explain"></apex:selectoption>
<!--<apex:actionSupport event="onchange" reRender="comments" />-->
</apex:selectList>
</apex:actionRegion>
<br/>
<p>Comments:</p>
<apex:inputTextarea label="Comments" style="width:550px;height:100px" id="comments" value="{!caseRejectComment}"/>
<br/><br/>
<div align="center" draggable="false" >
<apex:commandButton action="{!saveRejectInfo}" value="Save"/>
</div>
</apex:pageBlock>
</apex:outputText>
<apex:outputText rendered="{!rejectreasonmessage}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.</span>
</apex:outputText>
<apex:outputText rendered="{!Assignedtoothers}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">This case has already been assigned to some other physician.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyAccepted}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already accepted the case.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyRejected}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already rejected the case.</span>
</apex:outputText>
</div>
</apex:form>
</apex:page>
Regards,
Isha
- sfdc@isha.ax1814
- March 22, 2021
- Like
- 0
Make a field required dynamically based on picklist value using Visualforce
Hi Team,
I have below vf page. I want to make comment field required only when picklist vaue is 'Other - explain'.
can you please help me
<apex:page showHeader="false" action="{!InitMethod}" cache="false" controller="AH_HN_PhysicianAcceptnReject_CLS" tabStyle="Case">
<apex:includeScript value="/soap/ajax/36.0/connection.js"/>
<apex:includeScript value="/soap/ajax/36.0/apex.js"/>
<apex:includeLightning />
<head>
<apex:slds />
<div class="slds-align_absolute-center">
<apex:image url="{!$Resource.AH_Physician_Expert_Template_Logo}" />
</div>
</head>
<apex:form >
<div class="slds-align_absolute-center">
<apex:outputText rendered="{!ThanksmsgAccpt}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for accepting, the case has now been added to your dashboard. Please log into the physician portal to begin your review.</span>
</apex:outputText>
<!--
<apex:outputText rendered="{!ThanksmsgRejec}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/> </span>
</apex:outputText>
-->
<apex:outputText rendered="{!ThanksmsgRejec}">
<apex:pageBlock >
<!-- span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/><br/> </span -->
<p>Please select the reason:</p>
<apex:selectList id="Pleaseselectthereason" size="1" value="{!caseRejectReason}">
<apex:selectoption itemLabel="Out of office-cannot complete due to existing workload" itemValue="Out of office-cannot complete due to existing workload"></apex:selectoption>
<apex:selectoption itemLabel="I recommend another physician more suitable for this case.Enter Name in Free Text Box" itemValue="I recommend another physician more suitable for this case.Enter Name in Free Text Box"></apex:selectoption>
<apex:selectoption itemLabel="Other - explain" itemValue="Other - explain"></apex:selectoption>
</apex:selectList>
<br/>
<p>Comments:</p>
<apex:inputTextarea label="Comments" style="width:550px;height:100px" id="comments" value="{!caseRejectComment}"/>
<br/><br/>
<div align="center" draggable="false" >
<apex:commandButton action="{!saveRejectInfo}" value="Save"/>
</div>
</apex:pageBlock>
</apex:outputText>
<apex:outputText rendered="{!rejectreasonmessage}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.</span>
</apex:outputText>
<apex:outputText rendered="{!Assignedtoothers}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">This case has already been assigned to some other physician.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyAccepted}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already accepted the case.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyRejected}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already rejected the case.</span>
</apex:outputText>
</div>
</apex:form>
</apex:page>
Regards,
Isha
I have below vf page. I want to make comment field required only when picklist vaue is 'Other - explain'.
can you please help me
<apex:page showHeader="false" action="{!InitMethod}" cache="false" controller="AH_HN_PhysicianAcceptnReject_CLS" tabStyle="Case">
<apex:includeScript value="/soap/ajax/36.0/connection.js"/>
<apex:includeScript value="/soap/ajax/36.0/apex.js"/>
<apex:includeLightning />
<head>
<apex:slds />
<div class="slds-align_absolute-center">
<apex:image url="{!$Resource.AH_Physician_Expert_Template_Logo}" />
</div>
</head>
<apex:form >
<div class="slds-align_absolute-center">
<apex:outputText rendered="{!ThanksmsgAccpt}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for accepting, the case has now been added to your dashboard. Please log into the physician portal to begin your review.</span>
</apex:outputText>
<!--
<apex:outputText rendered="{!ThanksmsgRejec}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/> </span>
</apex:outputText>
-->
<apex:outputText rendered="{!ThanksmsgRejec}">
<apex:pageBlock >
<!-- span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/><br/> </span -->
<p>Please select the reason:</p>
<apex:selectList id="Pleaseselectthereason" size="1" value="{!caseRejectReason}">
<apex:selectoption itemLabel="Out of office-cannot complete due to existing workload" itemValue="Out of office-cannot complete due to existing workload"></apex:selectoption>
<apex:selectoption itemLabel="I recommend another physician more suitable for this case.Enter Name in Free Text Box" itemValue="I recommend another physician more suitable for this case.Enter Name in Free Text Box"></apex:selectoption>
<apex:selectoption itemLabel="Other - explain" itemValue="Other - explain"></apex:selectoption>
</apex:selectList>
<br/>
<p>Comments:</p>
<apex:inputTextarea label="Comments" style="width:550px;height:100px" id="comments" value="{!caseRejectComment}"/>
<br/><br/>
<div align="center" draggable="false" >
<apex:commandButton action="{!saveRejectInfo}" value="Save"/>
</div>
</apex:pageBlock>
</apex:outputText>
<apex:outputText rendered="{!rejectreasonmessage}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.</span>
</apex:outputText>
<apex:outputText rendered="{!Assignedtoothers}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">This case has already been assigned to some other physician.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyAccepted}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already accepted the case.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyRejected}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already rejected the case.</span>
</apex:outputText>
</div>
</apex:form>
</apex:page>
Regards,
Isha
- sfdc@isha.ax1814
- March 15, 2021
- Like
- 0
This page has an error. You might just need to refresh it. First, would you give us some details? (We're reporting this as error ID: -1511790141)
HI All,
Iam getting below error and i am posting my lightning component here.
This page has an error. You might just need to refresh it. First, would you give us some details? (We're reporting this as error ID: -1511790141)
Component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Case_Record" type="Object"/>
<aura:attribute name="recordLoadError" type="String"/>
<aura:attribute name="disabled" type="Boolean" default="false" />
<aura:attribute name="viewScreen" type="boolean" default="true"/>
<aura:attribute name="editScreen" type="boolean" default="FALSE"/>
<aura:attribute name="saved" type="Boolean" default="false" />
<aura:attribute name="textDisplay" type="Boolean" default="true" />
<aura:if isTrue="{!!v.saved}">
<!--View Case Timestamps:-->
<aura:if isTrue="{!v.viewScreen}">
<force:recordData
aura:id="recordLoader"
recordId="{!v.recordId}"
fields="Status,
New_Request_Submitted_Date_Time__c,
New_Request_Submited_completed_Date_Time__c,
Benefits_Eligibility_Initiated_Date_Time__c,
Benefits_Eligibility_Completed_Date_Time__c,
Program_Determination_Initiated_Date__c,
Program_Determination_Completed_Date__c"
targetFields="{!v.Case_Record}"
targetError="{!v.recordLoadError}"
/>
<!--<lightning:card>-->
<!--<h1 align="center" class="ui2" v.Case_Record>
<a><span class="slds-page-header__title slds-truncate" title="Request Timeline">Support Screen Link Sent</span></a>
</h1><br/>
<div class="slds-border_top"></div>-->
<!-- Markup start-->
<ul>
<aura:if isTrue="{!v.Case_Record.New_Request_Submitted_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_new_case">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-timeline__icon slds-icon_container slds-icon-standard-new_case " title="new_case">
<lightning:icon iconName="action:new_case" alternativeText="Approved" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>New Request</Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.New_Request_Submitted_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
<aura:if isTrue="{!v.Case_Record.New_Request_Submited_completed_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_new_group">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-icon_container slds-icon-standard-new_group slds-timeline__icon" title="new_group">
<lightning:icon iconName="action:new_group" alternativeText="Approved" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>New Request Completed </Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.New_Request_Submited_completed_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
<aura:if isTrue="{!v.Case_Record.Benefits_Eligibility_Completed_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_record">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-icon-standard-record slds-timeline__icon" title="record">
<lightning:icon iconName="action:record" alternativeText="record" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>Benefits Eligibility</Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.Benefits_Eligibility_Completed_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
</ul>
<!--</lightning:card>-->
<center>
<div class="slds-m-top_medium">
<lightning:button variant="brand" type="Edit" name="Edit" label="Edit" onclick="{!c.handleEdit}"/>
</div>
</center>
</aura:if>
<!--Edit Case Timestamps:-->
<aura:if isTrue="{!v.editScreen}">
<lightning:recordEditForm aura:id="createevalForm"
onload="{!c.handleLoad}"
onsubmit="{!c.handleSubmit}"
onsuccess="{!c.handleSuccess}"
recordId="{!v.recordId}"
objectApiName="Case">
<div class="slds-p-left_medium">
<div class="slds-p-right_medium">
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="New_Request_Submitted_Date_Time__c" aura:id="Track0"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="New_Request_Submited_completed_Date_Time__c" aura:id="Track2"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="Benefits_Eligibility_Initiated_Date_Time__c" aura:id="Track2"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="Benefits_Eligibility_Completed_Date_Time__c" aura:id="Track3"/>
</div>
</div>
</div>
<center>
<div class="slds-m-top_medium">
<!--<lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="Save" label="Save" onclick="{!c.handleSubmit}"/>-->
<lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="Save" label="Save" />
<lightning:button disabled="{!v.disabled}" variant="brand" type="cancel" name="Cancel" label="Cancel" onclick ="{!c.handleCancel}"/>
</div>
</center>
</div>
</lightning:recordEditForm>
</aura:if>
<aura:set attribute="else">
<p>Saved!</p>
</aura:set>
</div>
</div>
</aura:if>
</aura:component>
Controller:
({
init : function (component, event, helper) {
// $A.get('e.force:refreshView').fire();
},
handleEdit: function(component){
component.set("v.viewScreen",false);
component.set("v.editScreen",true);
$A.get('e.force:refreshView').fire();
},
handleSubmit : function(component, event, helper) {
var reqField1 = component.find('Track0').get('v.value');
var reqField2 = component.find('Track1').get('v.value');
component.set("v.textDisplay",false);
//if($A.util.isEmpty(reqField1) || $A.util.isEmpty(reqField2)){
// alert('All required fields should be completed.');
// } else
//if(!$A.util.isEmpty(reqField1) || !$A.util.isEmpty(reqField2)){
event.preventDefault();
var fields = event.getParam("fields");
alert('hi');
alert(fields);
//fields['Flag__c'] =false;
component.find('createevalForm').submit(fields); // Submit form
component.set("v.editScreen",false);
component.set("v.viewScreen",true);
$A.get('e.force:refreshView').fire();
//location.reload();
//}
},
handleLoad: function(component, event, helper) {
component.set('v.showSpinner', false);
},
showToast : function(title, type, message) {
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"title": title,
"type": type,
"message": message
});
toastEvent.fire();
},
handleCancel : function(component, event, helper) {
helper.showHide(component);
event.preventDefault();
component.set("v.editScreen",false);
component.set("v.viewScreen",true);
}
})
Regards,
Isha
Iam getting below error and i am posting my lightning component here.
This page has an error. You might just need to refresh it. First, would you give us some details? (We're reporting this as error ID: -1511790141)
Component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Case_Record" type="Object"/>
<aura:attribute name="recordLoadError" type="String"/>
<aura:attribute name="disabled" type="Boolean" default="false" />
<aura:attribute name="viewScreen" type="boolean" default="true"/>
<aura:attribute name="editScreen" type="boolean" default="FALSE"/>
<aura:attribute name="saved" type="Boolean" default="false" />
<aura:attribute name="textDisplay" type="Boolean" default="true" />
<aura:if isTrue="{!!v.saved}">
<!--View Case Timestamps:-->
<aura:if isTrue="{!v.viewScreen}">
<force:recordData
aura:id="recordLoader"
recordId="{!v.recordId}"
fields="Status,
New_Request_Submitted_Date_Time__c,
New_Request_Submited_completed_Date_Time__c,
Benefits_Eligibility_Initiated_Date_Time__c,
Benefits_Eligibility_Completed_Date_Time__c,
Program_Determination_Initiated_Date__c,
Program_Determination_Completed_Date__c"
targetFields="{!v.Case_Record}"
targetError="{!v.recordLoadError}"
/>
<!--<lightning:card>-->
<!--<h1 align="center" class="ui2" v.Case_Record>
<a><span class="slds-page-header__title slds-truncate" title="Request Timeline">Support Screen Link Sent</span></a>
</h1><br/>
<div class="slds-border_top"></div>-->
<!-- Markup start-->
<ul>
<aura:if isTrue="{!v.Case_Record.New_Request_Submitted_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_new_case">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-timeline__icon slds-icon_container slds-icon-standard-new_case " title="new_case">
<lightning:icon iconName="action:new_case" alternativeText="Approved" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>New Request</Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.New_Request_Submitted_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
<aura:if isTrue="{!v.Case_Record.New_Request_Submited_completed_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_new_group">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-icon_container slds-icon-standard-new_group slds-timeline__icon" title="new_group">
<lightning:icon iconName="action:new_group" alternativeText="Approved" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>New Request Completed </Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.New_Request_Submited_completed_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
<aura:if isTrue="{!v.Case_Record.Benefits_Eligibility_Completed_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_record">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-icon-standard-record slds-timeline__icon" title="record">
<lightning:icon iconName="action:record" alternativeText="record" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>Benefits Eligibility</Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.Benefits_Eligibility_Completed_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
</ul>
<!--</lightning:card>-->
<center>
<div class="slds-m-top_medium">
<lightning:button variant="brand" type="Edit" name="Edit" label="Edit" onclick="{!c.handleEdit}"/>
</div>
</center>
</aura:if>
<!--Edit Case Timestamps:-->
<aura:if isTrue="{!v.editScreen}">
<lightning:recordEditForm aura:id="createevalForm"
onload="{!c.handleLoad}"
onsubmit="{!c.handleSubmit}"
onsuccess="{!c.handleSuccess}"
recordId="{!v.recordId}"
objectApiName="Case">
<div class="slds-p-left_medium">
<div class="slds-p-right_medium">
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="New_Request_Submitted_Date_Time__c" aura:id="Track0"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="New_Request_Submited_completed_Date_Time__c" aura:id="Track2"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="Benefits_Eligibility_Initiated_Date_Time__c" aura:id="Track2"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="Benefits_Eligibility_Completed_Date_Time__c" aura:id="Track3"/>
</div>
</div>
</div>
<center>
<div class="slds-m-top_medium">
<!--<lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="Save" label="Save" onclick="{!c.handleSubmit}"/>-->
<lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="Save" label="Save" />
<lightning:button disabled="{!v.disabled}" variant="brand" type="cancel" name="Cancel" label="Cancel" onclick ="{!c.handleCancel}"/>
</div>
</center>
</div>
</lightning:recordEditForm>
</aura:if>
<aura:set attribute="else">
<p>Saved!</p>
</aura:set>
</div>
</div>
</aura:if>
</aura:component>
Controller:
({
init : function (component, event, helper) {
// $A.get('e.force:refreshView').fire();
},
handleEdit: function(component){
component.set("v.viewScreen",false);
component.set("v.editScreen",true);
$A.get('e.force:refreshView').fire();
},
handleSubmit : function(component, event, helper) {
var reqField1 = component.find('Track0').get('v.value');
var reqField2 = component.find('Track1').get('v.value');
component.set("v.textDisplay",false);
//if($A.util.isEmpty(reqField1) || $A.util.isEmpty(reqField2)){
// alert('All required fields should be completed.');
// } else
//if(!$A.util.isEmpty(reqField1) || !$A.util.isEmpty(reqField2)){
event.preventDefault();
var fields = event.getParam("fields");
alert('hi');
alert(fields);
//fields['Flag__c'] =false;
component.find('createevalForm').submit(fields); // Submit form
component.set("v.editScreen",false);
component.set("v.viewScreen",true);
$A.get('e.force:refreshView').fire();
//location.reload();
//}
},
handleLoad: function(component, event, helper) {
component.set('v.showSpinner', false);
},
showToast : function(title, type, message) {
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"title": title,
"type": type,
"message": message
});
toastEvent.fire();
},
handleCancel : function(component, event, helper) {
helper.showHide(component);
event.preventDefault();
component.set("v.editScreen",false);
component.set("v.viewScreen",true);
}
})
Regards,
Isha
- sfdc@isha.ax1814
- March 01, 2021
- Like
- 0
Can you please help me out test class for apex class?
Hi Team,
Can you pleae help me out test class for below class which is calling in case trigger before trigger.
Please help me out on this?
public class AH_HN_Stage_Validations {
public static void validateStatus(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'You are not allowed to skip a stage. Please follow the workflow.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId){
//Status validation for - QC1
If(eachCurrentCase.Status == 'QC1'){
If(eachCurrentCase.Status == 'QC1' && oldCase.Status=='MRP'){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Physician Expert Review
If(eachCurrentCase.Status == 'Physician Expert Review'){
If(eachCurrentCase.Status == 'Physician Expert Review' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - QC2
If(eachCurrentCase.Status == 'QC2'){
If(eachCurrentCase.Status == 'QC2' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - AH MD Review
If(eachCurrentCase.Status == 'AH MD Review'){
If(eachCurrentCase.Status == 'AH MD Review' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Report Sent
If(eachCurrentCase.Status == 'Report Sent'){
If(eachCurrentCase.Status == 'Report Sent' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Peer Consult
If(eachCurrentCase.Status == 'Peer Consult '){
If(eachCurrentCase.Status == 'Peer Consult' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2' || oldCase.Status=='AH MD Review')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - QC3
If(eachCurrentCase.Status == 'QC3'){
If(eachCurrentCase.Status == 'QC3' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2' || oldCase.Status=='AH MD Review' || oldCase.Status=='Report Sent')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Peer Consult Review Sent
If(eachCurrentCase.Status == 'Peer Consult Review Sent'){
If(eachCurrentCase.Status == 'Peer Consult Review Sent' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2' || oldCase.Status=='AH MD Review' || oldCase.Status=='Report Sent' || oldCase.Status=='Peer Consult')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Closed
If(eachCurrentCase.Status == 'Closed' && oldCase.Status!='Peer Consult'){
If(eachCurrentCase.Status == 'Closed' && eachCurrentCase.Close_Reason__c==null && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2' || oldCase.Status=='AH MD Review' || oldCase.Status=='Report Sent' || oldCase.Status=='QC3')){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
}
//MRP_MR_Review_Validations
public static void MRPvalidate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete MR Review.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
Id guestRecordtypeId = Schema.SObjectType.Task.getRecordTypeInfosByName().get('AH MR Review').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Narrative' && [select Id, Status,(select id from Tasks Where RecordTypeId =:guestRecordtypeId) from Case Where Id =: eachCurrentCase.Id].Tasks.size()==0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//Narrative_Fields_Vaidations
public static void narrativeValidate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please fill clinical Narration.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'QC1' && (eachCurrentCase.Clinical_Narrative__c == null && eachCurrentCase.Clinical_Summary__c == null)){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//Qc1 Fields_Vaidations
public static void QC1validate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete QC1 related task';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
//Id guestRecordtypeId = Schema.SObjectType.Task.getRecordTypeInfosByName().get('AH Qualitycheck').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Physician Expert Review' && [select Id, Status,(select id,status,Activity_Type__c from Tasks Where status='Open' and Activity_Type__c='QC1') from Case Where Id =: eachCurrentCase.Id].Tasks.size()>0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//Physician Review Fields_Vaidations
public static void PhysicianexpertValidate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please update the Physician clinical Review.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
Id PhyRewRecTypeId = Schema.SObjectType.Physician_Review__c.getRecordTypeInfosByName().get('Clinical Review').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
if(eachCurrentCase.status=='QC2' && [select Id, Status,(select id, Name from Physician_Reviews__r Where RecordTypeId =:PhyRewRecTypeId) from Case Where Id =:eachCurrentCase.Id].Physician_Reviews__r.size()==0){
//Case varActualCaseRecord2 = (Case)Trigger.newMap.get(vCase1.Id);
eachCurrentCase.adderror(skipErrorMessage );
}
}
}
}
//QC2 Validations
public static void QC2validate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete QC2 related task';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'AH MD Review' && [select Id, Status,(select id from Tasks Where status='Open'and Activity_Type__c='QC2') from Case Where Id =: eachCurrentCase.Id].Tasks.size()>0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//AH MD Review Validations
public static void AHMDReviewvalidate(List<Case> vListCase){
/*for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete AH MD review related task';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Report Sent' && [select Id, Status,(select id from Tasks Where status='Completed' and Activity_Type__c='MD Review') from Case Where Id =: eachCurrentCase.Id].Tasks.size()==0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}*/
}
//Peer consult Validations
public static void Peerconsultvalidate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If((eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId)&& eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Peer Consult'){
/* If(eachCurrentCase.Peer_Consult_Required__c=='Yes'){
eachCurrentCase.Status = 'QC3';
}*/
If(eachCurrentCase.Peer_Consult_Required__c=='No'){
eachCurrentCase.Status = 'Closed';
eachCurrentCase.Sub_Status__c='Completed';
//Closedvalidation(vListCase);
}
}
}
}
}
//Peerconsult Validations
public static void Peerconsultvalidations(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please update the Physician P2P Review.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
Id PhyRewRecTypeId = Schema.SObjectType.Physician_Review__c.getRecordTypeInfosByName().get('P2P Review').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'QC3' && [select Id, Status,(select id, Name from Physician_Reviews__r Where RecordTypeId =:PhyRewRecTypeId) from Case Where Id =:eachCurrentCase.Id].Physician_Reviews__r.size()==0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//QC3 Validations
public static void QC3validate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete QC3 related task';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Peer Consult Review Sent' && [select Id, Status,(select id from Tasks Where status='Open' and Activity_Type__c='QC3') from Case Where Id =: eachCurrentCase.Id].Tasks.size()>0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//Closed Validations
public static void Closedvalidation(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Outcome must be completed in order to close case.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
if(eachCurrentCase.Status=='Closed'){
eachCurrentCase.Sub_Status__c='Completed';
If(eachCurrentCase.Sub_Status__c =='Completed' && (eachCurrentCase.Humanistic_Outcomes__c==null || eachCurrentCase.Appropriate_Use_of_Healthcare__c==null || eachCurrentCase.Area_of_Cost_Savings__c==null || eachCurrentCase.Outcome_of_Review__c==null)){
eachCurrentCase.adderror(skipErrorMessage);
}
}
}
}
}
}
Regards,
Isha
Can you pleae help me out test class for below class which is calling in case trigger before trigger.
Please help me out on this?
public class AH_HN_Stage_Validations {
public static void validateStatus(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'You are not allowed to skip a stage. Please follow the workflow.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId){
//Status validation for - QC1
If(eachCurrentCase.Status == 'QC1'){
If(eachCurrentCase.Status == 'QC1' && oldCase.Status=='MRP'){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Physician Expert Review
If(eachCurrentCase.Status == 'Physician Expert Review'){
If(eachCurrentCase.Status == 'Physician Expert Review' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - QC2
If(eachCurrentCase.Status == 'QC2'){
If(eachCurrentCase.Status == 'QC2' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - AH MD Review
If(eachCurrentCase.Status == 'AH MD Review'){
If(eachCurrentCase.Status == 'AH MD Review' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Report Sent
If(eachCurrentCase.Status == 'Report Sent'){
If(eachCurrentCase.Status == 'Report Sent' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Peer Consult
If(eachCurrentCase.Status == 'Peer Consult '){
If(eachCurrentCase.Status == 'Peer Consult' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2' || oldCase.Status=='AH MD Review')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - QC3
If(eachCurrentCase.Status == 'QC3'){
If(eachCurrentCase.Status == 'QC3' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2' || oldCase.Status=='AH MD Review' || oldCase.Status=='Report Sent')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Peer Consult Review Sent
If(eachCurrentCase.Status == 'Peer Consult Review Sent'){
If(eachCurrentCase.Status == 'Peer Consult Review Sent' && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2' || oldCase.Status=='AH MD Review' || oldCase.Status=='Report Sent' || oldCase.Status=='Peer Consult')){
eachCurrentCase.addError(skipErrorMessage);
}
}
//Status validation for - Closed
If(eachCurrentCase.Status == 'Closed' && oldCase.Status!='Peer Consult'){
If(eachCurrentCase.Status == 'Closed' && eachCurrentCase.Close_Reason__c==null && (oldCase.Status=='MRP' || oldCase.Status=='Narrative' || oldCase.Status=='QC1' || oldCase.Status=='Physician Expert Review' || oldCase.Status=='QC2' || oldCase.Status=='AH MD Review' || oldCase.Status=='Report Sent' || oldCase.Status=='QC3')){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
}
//MRP_MR_Review_Validations
public static void MRPvalidate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete MR Review.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
Id guestRecordtypeId = Schema.SObjectType.Task.getRecordTypeInfosByName().get('AH MR Review').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Narrative' && [select Id, Status,(select id from Tasks Where RecordTypeId =:guestRecordtypeId) from Case Where Id =: eachCurrentCase.Id].Tasks.size()==0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//Narrative_Fields_Vaidations
public static void narrativeValidate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please fill clinical Narration.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'QC1' && (eachCurrentCase.Clinical_Narrative__c == null && eachCurrentCase.Clinical_Summary__c == null)){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//Qc1 Fields_Vaidations
public static void QC1validate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete QC1 related task';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
//Id guestRecordtypeId = Schema.SObjectType.Task.getRecordTypeInfosByName().get('AH Qualitycheck').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Physician Expert Review' && [select Id, Status,(select id,status,Activity_Type__c from Tasks Where status='Open' and Activity_Type__c='QC1') from Case Where Id =: eachCurrentCase.Id].Tasks.size()>0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//Physician Review Fields_Vaidations
public static void PhysicianexpertValidate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please update the Physician clinical Review.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
Id PhyRewRecTypeId = Schema.SObjectType.Physician_Review__c.getRecordTypeInfosByName().get('Clinical Review').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
if(eachCurrentCase.status=='QC2' && [select Id, Status,(select id, Name from Physician_Reviews__r Where RecordTypeId =:PhyRewRecTypeId) from Case Where Id =:eachCurrentCase.Id].Physician_Reviews__r.size()==0){
//Case varActualCaseRecord2 = (Case)Trigger.newMap.get(vCase1.Id);
eachCurrentCase.adderror(skipErrorMessage );
}
}
}
}
//QC2 Validations
public static void QC2validate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete QC2 related task';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'AH MD Review' && [select Id, Status,(select id from Tasks Where status='Open'and Activity_Type__c='QC2') from Case Where Id =: eachCurrentCase.Id].Tasks.size()>0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//AH MD Review Validations
public static void AHMDReviewvalidate(List<Case> vListCase){
/*for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete AH MD review related task';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Report Sent' && [select Id, Status,(select id from Tasks Where status='Completed' and Activity_Type__c='MD Review') from Case Where Id =: eachCurrentCase.Id].Tasks.size()==0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}*/
}
//Peer consult Validations
public static void Peerconsultvalidate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If((eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId)&& eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Peer Consult'){
/* If(eachCurrentCase.Peer_Consult_Required__c=='Yes'){
eachCurrentCase.Status = 'QC3';
}*/
If(eachCurrentCase.Peer_Consult_Required__c=='No'){
eachCurrentCase.Status = 'Closed';
eachCurrentCase.Sub_Status__c='Completed';
//Closedvalidation(vListCase);
}
}
}
}
}
//Peerconsult Validations
public static void Peerconsultvalidations(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please update the Physician P2P Review.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
Id PhyRewRecTypeId = Schema.SObjectType.Physician_Review__c.getRecordTypeInfosByName().get('P2P Review').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'QC3' && [select Id, Status,(select id, Name from Physician_Reviews__r Where RecordTypeId =:PhyRewRecTypeId) from Case Where Id =:eachCurrentCase.Id].Physician_Reviews__r.size()==0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//QC3 Validations
public static void QC3validate(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Please complete QC3 related task';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
If(eachCurrentCase.Status == 'Peer Consult Review Sent' && [select Id, Status,(select id from Tasks Where status='Open' and Activity_Type__c='QC3') from Case Where Id =: eachCurrentCase.Id].Tasks.size()>0){
eachCurrentCase.addError(skipErrorMessage);
}
}
}
}
//Closed Validations
public static void Closedvalidation(List<Case> vListCase){
for(Case eachCurrentCase : vListCase){
String skipErrorMessage = 'Outcome must be completed in order to close case.';
Case oldCase = (Case)Trigger.oldMap.get(eachCurrentCase.Id);
Id recordtypeAPOId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('APO').getRecordTypeId();
Id recordtypeEARId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('EAR').getRecordTypeId();
If(eachCurrentCase.RecordTypeId == recordtypeAPOId || eachCurrentCase.RecordTypeId == recordtypeEARId && eachCurrentCase.status != oldCase.status){
if(eachCurrentCase.Status=='Closed'){
eachCurrentCase.Sub_Status__c='Completed';
If(eachCurrentCase.Sub_Status__c =='Completed' && (eachCurrentCase.Humanistic_Outcomes__c==null || eachCurrentCase.Appropriate_Use_of_Healthcare__c==null || eachCurrentCase.Area_of_Cost_Savings__c==null || eachCurrentCase.Outcome_of_Review__c==null)){
eachCurrentCase.adderror(skipErrorMessage);
}
}
}
}
}
}
Regards,
Isha
- sfdc@isha.ax1814
- August 13, 2020
- Like
- 0
Testclass Issue
test class:
/**********************************************************************************************
@author Satmetrix
@date 20 Jan,2012
@description: Test Class for SMXProcessCaseFaasATIBatch
Revision(s):
ToDo(s): Usage of Asserts for functional coverage
VR,
**********************************************************************************************/
@isTest
public class SMXProcessCaseFaasATIBatchTest {
public static testMethod void testBatch() {
//Create Test Account
Map<String, Object> accMap = new Map<String, Object> {
};
List<Account> lstAcc = (List<Account>) ShGl_TestFactory.createSObjectList(new Account(),3,accMap);
insert lstAcc;
//Create test contact and associate to Account
Map<String, Object> conMap = new Map<String, Object> {
};
List<Contact> conL = (List<Contact>) ShGl_TestFactory.createSObjectList(new Contact(),3,conMap);
insert conL;
for(integer i=0; i<conL.Size(); i++){
conL[i].AccountId = lstAcc[i].Id;
}
Update conL;
//Create test Case and associate to Contact
Map<String, Object> caseMap = new Map<String, Object> {
'RecordTypeId' => Schema.SObjectType.Case.getRecordTypeInfosByName().get('FaaS Compromise Report').getRecordTypeId()
};
List<Case> csL = (List<Case>) ShGl_TestFactory.createSObjectList(new Case(),3,caseMap);
insert csL;
for(integer i=0; i<conL.Size(); i++){
csL[i].AccountId = lstAcc[i].Id;
if(i==0){
csL[i].Managed_Defense__c = 'CP';
}else{
csL[i].Managed_Defense__c = 'CM';
csL[i].Status = 'Closed';
}
}
Update csL;
//Create test for Custom Object(OCM_Agent__c)
List<OCM_Agent__c> ssConLst = new List<OCM_Agent__c>();
for(integer i=0; i<conL.Size(); i++){
OCM_Agent__c sscon = new OCM_Agent__c(Contact__c = conL[i].Id, CM_Threat_Contact__c = 'Primary');
ssConLst.add(sscon);
}
insert ssConLst;
//Create test for Custom Object(Feedback__c)
List<Feedback__c> fbkLst= new List<Feedback__c>();
Integer i=2;
Feedback__c fbk = new Feedback__c(Contact__c = conL[i].Id, Case__c= csL[i].id, Name = 'Test_Name', DataCollectionId__c = 'Test_SurveyId', DataCollectionName__c = 'Test_SurveyName',Status__c='Response Received');
fbkLst.add(fbk );
insert fbkLst;
System.debug('ssConLst'+ssConLst);
test.startTest();
Database.executeBatch(new SMXProcessCaseFaasATIBatch(),50);
test.stopTest();
}
}
Apex class:
//Determine Survey Name and Survey Id based on Managed Defence
if(strManagedDefence.equalsignorecase('CP') || strManagedDefence.equalsignorecase('CV') || strManagedDefence.equalsignorecase('MD13')){
strSurveyName = 'FaaS Compromise Survey';
strSurveyId = 'FIREEYE_128387';
}
/*else if(strManagedDefence.equalsignorecase('ATI+') || strManagedDefence.equalsignorecase('CM')){
strSurveyName = 'ATI+ Feedback Survey';
strSurveyId = 'FIREEYE_132678';
}
*/
//Retrieve the List of Contacts associated with the Account
List<ID> lstContactIDs = mapAccountToContactList.get(csRecord.idAccountID);
if(lstContactIDs!=null){
for(ID idContact : lstContactIDs ){
Map<ID,ID> mapContactToFeedback = mapCaseToContactToFeedback.get(csRecord.idCaseID);
//lgSeed = lgSeed++;
System.Debug('lgSeed ==> '+lgSeed);
System.Debug('idContact==> '+idContact);
System.Debug('csRecord.idCaseID==> '+csRecord.idCaseID);
if(mapContactToFeedback == null || mapContactToFeedback.isEmpty()){
//Prepare Survey Record
lgSeed = lgSeed+1;
Feedback__c feedback = new Feedback__c();
feedback.Name = 'P_' + lgSeed;
feedback.Contact__c = idContact ; //ContactId to which survey have to be sent out
feedback.Case__c = csRecord.idCaseID; // CaseId processed
feedback.DataCollectionId__c = strSurveyId;
feedback.Status__c = 'Nominated';
feedback.DataCollectionName__c = strSurveyName;
lstFeedback.add(feedback);
}else{
ID idFeedback = mapContactToFeedback.get(idContact);
if(idFeedback == null){
//Prepare Survey Record
lgSeed = lgSeed+1;
Feedback__c feedback = new Feedback__c();
feedback.Name = 'P_' + lgSeed;
feedback.Contact__c = idContact; //ContactId to which survey have to be sent out
feedback.Case__c = csRecord.idCaseId; // CaseId processed
feedback.DataCollectionId__c = strSurveyId;
feedback.Status__c = 'Nominated';
feedback.DataCollectionName__c = strSurveyName;
lstFeedback.add(feedback);
}
}
} // End of loop processing through list of valid contacts
}
} //End of loop processing through list of valid cases
insert lstFeedback; //
Error:
System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [DataCollectionId__c, DataCollectionName__c]: [DataCollectionId__c, DataCollectionName__c]
I already provided the values but still getting errors.
Please fix this error.
Regards,
Isha
/**********************************************************************************************
@author Satmetrix
@date 20 Jan,2012
@description: Test Class for SMXProcessCaseFaasATIBatch
Revision(s):
ToDo(s): Usage of Asserts for functional coverage
VR,
**********************************************************************************************/
@isTest
public class SMXProcessCaseFaasATIBatchTest {
public static testMethod void testBatch() {
//Create Test Account
Map<String, Object> accMap = new Map<String, Object> {
};
List<Account> lstAcc = (List<Account>) ShGl_TestFactory.createSObjectList(new Account(),3,accMap);
insert lstAcc;
//Create test contact and associate to Account
Map<String, Object> conMap = new Map<String, Object> {
};
List<Contact> conL = (List<Contact>) ShGl_TestFactory.createSObjectList(new Contact(),3,conMap);
insert conL;
for(integer i=0; i<conL.Size(); i++){
conL[i].AccountId = lstAcc[i].Id;
}
Update conL;
//Create test Case and associate to Contact
Map<String, Object> caseMap = new Map<String, Object> {
'RecordTypeId' => Schema.SObjectType.Case.getRecordTypeInfosByName().get('FaaS Compromise Report').getRecordTypeId()
};
List<Case> csL = (List<Case>) ShGl_TestFactory.createSObjectList(new Case(),3,caseMap);
insert csL;
for(integer i=0; i<conL.Size(); i++){
csL[i].AccountId = lstAcc[i].Id;
if(i==0){
csL[i].Managed_Defense__c = 'CP';
}else{
csL[i].Managed_Defense__c = 'CM';
csL[i].Status = 'Closed';
}
}
Update csL;
//Create test for Custom Object(OCM_Agent__c)
List<OCM_Agent__c> ssConLst = new List<OCM_Agent__c>();
for(integer i=0; i<conL.Size(); i++){
OCM_Agent__c sscon = new OCM_Agent__c(Contact__c = conL[i].Id, CM_Threat_Contact__c = 'Primary');
ssConLst.add(sscon);
}
insert ssConLst;
//Create test for Custom Object(Feedback__c)
List<Feedback__c> fbkLst= new List<Feedback__c>();
Integer i=2;
Feedback__c fbk = new Feedback__c(Contact__c = conL[i].Id, Case__c= csL[i].id, Name = 'Test_Name', DataCollectionId__c = 'Test_SurveyId', DataCollectionName__c = 'Test_SurveyName',Status__c='Response Received');
fbkLst.add(fbk );
insert fbkLst;
System.debug('ssConLst'+ssConLst);
test.startTest();
Database.executeBatch(new SMXProcessCaseFaasATIBatch(),50);
test.stopTest();
}
}
Apex class:
//Determine Survey Name and Survey Id based on Managed Defence
if(strManagedDefence.equalsignorecase('CP') || strManagedDefence.equalsignorecase('CV') || strManagedDefence.equalsignorecase('MD13')){
strSurveyName = 'FaaS Compromise Survey';
strSurveyId = 'FIREEYE_128387';
}
/*else if(strManagedDefence.equalsignorecase('ATI+') || strManagedDefence.equalsignorecase('CM')){
strSurveyName = 'ATI+ Feedback Survey';
strSurveyId = 'FIREEYE_132678';
}
*/
//Retrieve the List of Contacts associated with the Account
List<ID> lstContactIDs = mapAccountToContactList.get(csRecord.idAccountID);
if(lstContactIDs!=null){
for(ID idContact : lstContactIDs ){
Map<ID,ID> mapContactToFeedback = mapCaseToContactToFeedback.get(csRecord.idCaseID);
//lgSeed = lgSeed++;
System.Debug('lgSeed ==> '+lgSeed);
System.Debug('idContact==> '+idContact);
System.Debug('csRecord.idCaseID==> '+csRecord.idCaseID);
if(mapContactToFeedback == null || mapContactToFeedback.isEmpty()){
//Prepare Survey Record
lgSeed = lgSeed+1;
Feedback__c feedback = new Feedback__c();
feedback.Name = 'P_' + lgSeed;
feedback.Contact__c = idContact ; //ContactId to which survey have to be sent out
feedback.Case__c = csRecord.idCaseID; // CaseId processed
feedback.DataCollectionId__c = strSurveyId;
feedback.Status__c = 'Nominated';
feedback.DataCollectionName__c = strSurveyName;
lstFeedback.add(feedback);
}else{
ID idFeedback = mapContactToFeedback.get(idContact);
if(idFeedback == null){
//Prepare Survey Record
lgSeed = lgSeed+1;
Feedback__c feedback = new Feedback__c();
feedback.Name = 'P_' + lgSeed;
feedback.Contact__c = idContact; //ContactId to which survey have to be sent out
feedback.Case__c = csRecord.idCaseId; // CaseId processed
feedback.DataCollectionId__c = strSurveyId;
feedback.Status__c = 'Nominated';
feedback.DataCollectionName__c = strSurveyName;
lstFeedback.add(feedback);
}
}
} // End of loop processing through list of valid contacts
}
} //End of loop processing through list of valid cases
insert lstFeedback; //
Error:
System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [DataCollectionId__c, DataCollectionName__c]: [DataCollectionId__c, DataCollectionName__c]
I already provided the values but still getting errors.
Please fix this error.
Regards,
Isha
- sfdc@isha.ax1814
- June 03, 2020
- Like
- 0
Test class error for batch class-Need urgent help
Hi Team,
I have below test class. and iam getting below error while excetuing this testclass.
Iam attaching here the error message . pls help me tofis this issue.
Regards,
ISHA
I have below test class. and iam getting below error while excetuing this testclass.
Iam attaching here the error message . pls help me tofis this issue.
@isTest // Test Class to execute SMXNominationProcessor Class global class SMXNominationProcessorTest{ public static void setTestResponseValues(Integer testCaseNum){ if(testCaseNum == 1){ SMXNominationProcessor.testHttpStatusCode = 200; SMXNominationProcessor.testHttpResponseXML = '<webserviceresponse><code>0</code><description></description><row value="success"></row></webserviceresponse>'; }else if(testCaseNum == 2){ SMXNominationProcessor.testHttpStatusCode = 200; SMXNominationProcessor.testHttpResponseXML = '<webserviceresponse><code>0</code><description></description><row value="No Send Rule is applied for the provider"></row></webserviceresponse>'; }else if(testCaseNum == 3){ SMXNominationProcessor.testHttpStatusCode = 200; SMXNominationProcessor.testHttpResponseXML = '<webserviceresponse><code>-1</code><description></description><row value=""></row></webserviceresponse>'; }else if(testCaseNum == 4){ SMXNominationProcessor.testHttpStatusCode = 404; SMXNominationProcessor.testHttpResponseXML = '<webserviceresponse><code>-1</code><description></description><row value=""></row></webserviceresponse>'; } } @isTest static void testFeedbackUpdate(){ String strFeedbackID = prepareTestData(); for(Integer i = 1; i<=4; i++){ SMXNominationProcessorTest.setTestResponseValues(i); SMXNominationProcessor.processNomination(strFeedbackID); } } static String prepareTestData(){ //Insert account data using ShGl_TestFactory Map<String, Object> accMap = new Map<String, Object> { }; Account acc = (Account) ShGl_TestFactory.createSObject(new Account(),accMap); insert acc; //Check for account creation system.assertNotEquals(null, acc.Id); system.assertNotEquals('', acc.Id); //Insert contact data using ShGl_TestFactory Map<String, Object> conMap = new Map<String, Object> { 'AccountId' => acc.Id }; Contact con = (Contact) ShGl_TestFactory.createSObject(new Contact(),conMap); insert con; //Check for Contact creation and associated with account system.assertNotEquals(null, con.Id); system.assertNotEquals('', con.Id); system.assertEquals(acc.Id, con.AccountId); //Insert case data using ShGl_TestFactory Map<String, Object> csMap = new Map<String, Object> { 'ContactId' => con.Id }; Case cs = (Case) ShGl_TestFactory.createSObject(new Case(),csMap); insert cs; //Check for Case creation and associated with contact system.assertNotEquals(null, cs.Id); system.assertNotEquals('', cs.Id); system.assertEquals(con.Id, cs.ContactId); //Insert custom object feedback__c Feedback__c fbk = new Feedback__c(Name = 'TEST_CRM_12345', Contact__c = con.Id, DataCollectionId__c = '123456', Status__c = 'Test_Nominated', DataCollectionName__c = 'Test Survey Name', PrimaryScore__c = 9, PrimaryComment__c = 'Test comment', StatusDescription__c = 'Test Description', Case__c = cs.Id); insert fbk; //Check for Survey record Creation with Name, SurveyID, SurveyName and Staus not BLANK system.assertNotEquals(null, fbk.Id); system.assertNotEquals('', fbk.Id); system.assertEquals(con.Id, fbk.Contact__c); system.assertNotEquals('', fbk.Name); system.assertNotEquals(null, fbk.Name); system.assertNotEquals('', fbk.DataCollectionId__c); system.assertNotEquals(null, fbk.DataCollectionId__c); system.assertNotEquals('', fbk.DataCollectionName__c); system.assertNotEquals(null, fbk.DataCollectionName__c); system.assertNotEquals('', fbk.Status__c); system.assertNotEquals(null, fbk.Status__c); return fbk.Name; } }
Regards,
ISHA
- sfdc@isha.ax1814
- April 20, 2020
- Like
- 0
Process builder Formula -Need Urgent Help
Iam having a query in Account 'SELECT Id,Name,outcome FROM Account WHERE Name LIKE 'Unable to Support%'' and this one we converted into process builder formula as
NOT(CONTAINS(LOWER(TEXT([Case].Sub_Category__c), 'remove from field notices')))
Iam facing below error.
ERROR:
The formula expression is invalid: Incorrect number of parameters for function 'CONTAINS()'. Expected 2, received 1
Pls help me to fix this.
Regards,
ISHA
.
NOT(CONTAINS(LOWER(TEXT([Case].Sub_Category__c), 'remove from field notices')))
Iam facing below error.
ERROR:
The formula expression is invalid: Incorrect number of parameters for function 'CONTAINS()'. Expected 2, received 1
Pls help me to fix this.
Regards,
ISHA
.
- sfdc@isha.ax1814
- April 14, 2020
- Like
- 0
Process builder Formula Change-Need Urgent Help
Hi Team,
Iam having a query in Account 'SELECT Id,Name FROM Account WHERE Name LIKE 'Fireeye%'' and this one we converted into process builder formula as
AND(
NOT(ISBLANK([Case].AccountId )),
NOT(BEGINS([Case].Account.Name, "FireEye"))
another condtion is
NOT(CONTAINS([Case].Contact.Email, 'FireEye')
But i want to ignore case in my process builder formula as it is validating only 'FireEye' records but i want to validate irrespective of lower/upper/mixed . I want my formula work as Like funtion in Query.
This is urgent change pls help.
Regards,
ISHA
Iam having a query in Account 'SELECT Id,Name FROM Account WHERE Name LIKE 'Fireeye%'' and this one we converted into process builder formula as
AND(
NOT(ISBLANK([Case].AccountId )),
NOT(BEGINS([Case].Account.Name, "FireEye"))
another condtion is
NOT(CONTAINS([Case].Contact.Email, 'FireEye')
But i want to ignore case in my process builder formula as it is validating only 'FireEye' records but i want to validate irrespective of lower/upper/mixed . I want my formula work as Like funtion in Query.
This is urgent change pls help.
Regards,
ISHA
- sfdc@isha.ax1814
- April 13, 2020
- Like
- 0
test class for trigger on after update- URGENT
Hi ,
Case trigger handler class:
// Batch Class conversion handler
if(checkRecursive.opptyLineItemInsertRunOnce()){
for(case c: (List<Case>)Trigger.new){
Case oldCase = (Case)Trigger.oldMap.get(c.Id);
Boolean oldCaseStatus = oldCase.Status.equals('Closed');
Boolean newCaseStatus = c.Status.equals('Closed');
if (oldCaseStatus!=newCaseStatus && c.AccountId!=null && c.ContactId!=null) {
SMXProcessCaseFaasATIHandler smxHandler= new SMXProcessCaseFaasATIHandler();
smxHandler.convertBatchToTrigger(trigger.new);
}
}
SMXProcessCaseFaasATIHandler my handler class having logic of after update.
My test class is on after update oncase which is not firing .My method is"convertBatchToTrigger".
My test class:
@isTest
public class CaseTriggerHandlerBatchclassTest{
public static testMethod void testcreatefeedbacksurvey(){
Account acc = new Account(
Name='testAcc'
);
insert acc;
Contact con = new Contact(
firstname='test',Lastname='Con',
Email='test@gmail.com',
AccountId=acc.Id,Not_Active_Contact__c=false,HasOptedOutOfEmail=false
);
insert con;
RecordType red= [SELECT Id FROM RecordType WHERE Name ='FaaS Compromise Report' AND SObjectType = 'Case'];
Case cse = new Case(
AccountId=acc.Id,ContactId=con.Id,
RecordTypeId = red.Id,Status='New',Origin = 'Phone'
);
Insert cse;
OCM_Agent__c ocm= new OCM_Agent__c(CM_Threat_Contact__c= 'Primary',Contact__c=con.Id);
Insert ocm;
NPX_Survey_record__c npxsurvey= New NPX_Survey_record__c();
npxsurvey.Contact__c = cse.ContactId ;
npxsurvey.Account__c =acc.id;
npxsurvey.Case__c = cse.id;
// npxsurvey.Survey_Id__c = strSurveyId;
npxsurvey.Status__c = 'Nominated';
npxsurvey.Survey_name__c= 'FaaS Compromise Survey';
npxsurvey.Person_identifier__c=con.Email;
npxsurvey.First_Name__c=con.FirstName;
npxsurvey.Last_Name__c=con.LastName;
npxsurvey.Email__c=con.Email;
npxsurvey.Company_Name__c=acc.Name;
npxsurvey.Company_ID__c=acc.Id;
npxsurvey.Case_Record_Type__c=cse.RecordTypeId;
npxsurvey.Locale_Code__c='test';
npxsurvey.Contact__c=con.id;
Insert npxsurvey;
cse.Managed_Defense__c='CV';
cse.Status= 'Closed';
update cse;
}
}
Which is not working.
Pls help me on this testclass
Case trigger handler class:
// Batch Class conversion handler
if(checkRecursive.opptyLineItemInsertRunOnce()){
for(case c: (List<Case>)Trigger.new){
Case oldCase = (Case)Trigger.oldMap.get(c.Id);
Boolean oldCaseStatus = oldCase.Status.equals('Closed');
Boolean newCaseStatus = c.Status.equals('Closed');
if (oldCaseStatus!=newCaseStatus && c.AccountId!=null && c.ContactId!=null) {
SMXProcessCaseFaasATIHandler smxHandler= new SMXProcessCaseFaasATIHandler();
smxHandler.convertBatchToTrigger(trigger.new);
}
}
SMXProcessCaseFaasATIHandler my handler class having logic of after update.
My test class is on after update oncase which is not firing .My method is"convertBatchToTrigger".
My test class:
@isTest
public class CaseTriggerHandlerBatchclassTest{
public static testMethod void testcreatefeedbacksurvey(){
Account acc = new Account(
Name='testAcc'
);
insert acc;
Contact con = new Contact(
firstname='test',Lastname='Con',
Email='test@gmail.com',
AccountId=acc.Id,Not_Active_Contact__c=false,HasOptedOutOfEmail=false
);
insert con;
RecordType red= [SELECT Id FROM RecordType WHERE Name ='FaaS Compromise Report' AND SObjectType = 'Case'];
Case cse = new Case(
AccountId=acc.Id,ContactId=con.Id,
RecordTypeId = red.Id,Status='New',Origin = 'Phone'
);
Insert cse;
OCM_Agent__c ocm= new OCM_Agent__c(CM_Threat_Contact__c= 'Primary',Contact__c=con.Id);
Insert ocm;
NPX_Survey_record__c npxsurvey= New NPX_Survey_record__c();
npxsurvey.Contact__c = cse.ContactId ;
npxsurvey.Account__c =acc.id;
npxsurvey.Case__c = cse.id;
// npxsurvey.Survey_Id__c = strSurveyId;
npxsurvey.Status__c = 'Nominated';
npxsurvey.Survey_name__c= 'FaaS Compromise Survey';
npxsurvey.Person_identifier__c=con.Email;
npxsurvey.First_Name__c=con.FirstName;
npxsurvey.Last_Name__c=con.LastName;
npxsurvey.Email__c=con.Email;
npxsurvey.Company_Name__c=acc.Name;
npxsurvey.Company_ID__c=acc.Id;
npxsurvey.Case_Record_Type__c=cse.RecordTypeId;
npxsurvey.Locale_Code__c='test';
npxsurvey.Contact__c=con.id;
Insert npxsurvey;
cse.Managed_Defense__c='CV';
cse.Status= 'Closed';
update cse;
}
}
Which is not working.
Pls help me on this testclass
- sfdc@isha.ax1814
- April 11, 2020
- Like
- 0
Checkbox display through process builder-Need urgent help
Hi Team,
I have a process builder where iam creating a record on cutom_object__c and iam mapping a checkbox[Top x Account] which is populating from contact.Account fields
Iam doing a negative testing by removing Account value on contact. So, My proccess builder is failing and getting below error.
Error:
Can’t Save Record
We can't save this record because the “VOC Create Campaign Nominated Survey Records” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: INVALID_TYPE_ON_FIELD_IN_RECORD: Top X Account: value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 448042294-2763196 (-1395494820)
Click here to return to the previous page.
Can you please help me how to fix this issue.
Note: on Account and Custom_object__c the fields are checkbox
Regards,
ISHA
I have a process builder where iam creating a record on cutom_object__c and iam mapping a checkbox[Top x Account] which is populating from contact.Account fields
Iam doing a negative testing by removing Account value on contact. So, My proccess builder is failing and getting below error.
Error:
Can’t Save Record
We can't save this record because the “VOC Create Campaign Nominated Survey Records” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: INVALID_TYPE_ON_FIELD_IN_RECORD: Top X Account: value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 448042294-2763196 (-1395494820)
Click here to return to the previous page.
Can you please help me how to fix this issue.
Note: on Account and Custom_object__c the fields are checkbox
Regards,
ISHA
- sfdc@isha.ax1814
- April 06, 2020
- Like
- 0
Adding Campaign members[Contacts] to Campaigns automatically based on certain conditions on Contacts
Hi,
At present, we are manually adding campaign members[Contats] to a campaign to avaoid that, we are looking for a automation on this.
Based on certain conditions on Contact, we need to add to a campaign.
Can you please help me on this requirement with clear implementation.
Regards,
ISHA
At present, we are manually adding campaign members[Contats] to a campaign to avaoid that, we are looking for a automation on this.
Based on certain conditions on Contact, we need to add to a campaign.
Can you please help me on this requirement with clear implementation.
Regards,
ISHA
- sfdc@isha.ax1814
- March 30, 2020
- Like
- 0
Custom field is not populating in Process builder
Hi ,
We have a processbilder and on Action i selcted update records and selected the campaign object .
I have a custom field called 'Send call' picklist field but iam not able to see that field coming in process builder.
I checked FLS . This field has given acess to all the profiles as edit.
We have a processbilder and on Action i selcted update records and selected the campaign object .
I have a custom field called 'Send call' picklist field but iam not able to see that field coming in process builder.
I checked FLS . This field has given acess to all the profiles as edit.
- sfdc@isha.ax1814
- March 11, 2020
- Like
- 0
process builder formula help- Urgent
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
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 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.
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 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.
Regards,
Isha
- sfdc@isha.ax1814
- August 27, 2019
- Like
- 0
Lightningcomponent Apexclass testclass - Urgent help
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
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
- sfdc@isha.ax1814
- August 16, 2019
- Like
- 0
Please Help-Current Accountid Is not Coming in Brases In URL
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.
Regards,
Isha
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.
Regards,
Isha
- sfdc@isha.ax1814
- August 07, 2019
- Like
- 0
Urgent help-Lightning component Please help
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
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
- sfdc@isha.ax1814
- August 02, 2019
- Like
- 0
Can't save permission set Test Permission set, which is assigned to a user with user license Salesforce. The user license doesn't allow the permission:
Hi Team,
Iam facing below issue when ever iam trying to edit my permission set 'Test Permission set'. Please let me know how i can edit and make the chnages in permission set?
Error:
Can't save permission set Test Permission set, which is assigned to a user with user license Salesforce. The user license doesn't allow the permission:
Regards,
Isha
Iam facing below issue when ever iam trying to edit my permission set 'Test Permission set'. Please let me know how i can edit and make the chnages in permission set?
Error:
Can't save permission set Test Permission set, which is assigned to a user with user license Salesforce. The user license doesn't allow the permission:
Regards,
Isha
- sfdc@isha.ax1814
- July 29, 2021
- Like
- 0
Remove Html tags from text area
Hi Team,
I have below rich text area and long texta rea fields. We migrated data from one sandbox to another sandbox. After migrtaion We can see data mixed with html tags. I want to remove these html tags. Can you please help me how to solve this issue.
Summary of local treating provide treatment plan
summary of AH provider treatment plan
Regards,
Isha
I have below rich text area and long texta rea fields. We migrated data from one sandbox to another sandbox. After migrtaion We can see data mixed with html tags. I want to remove these html tags. Can you please help me how to solve this issue.
Summary of local treating provide treatment plan
summary of AH provider treatment plan
Regards,
Isha
- sfdc@isha.ax1814
- March 29, 2021
- Like
- 0
Display error message when we select the picklist value in vfpage
Hi Team,
I want to display error mesg when we select 'Other-Explain'.
<apex:page showHeader="false" action="{!InitMethod}" cache="false" controller="AH_HN_PhysicianAcceptnReject_CLS" tabStyle="Case">
<apex:includeScript value="/soap/ajax/36.0/connection.js"/>
<apex:includeScript value="/soap/ajax/36.0/apex.js"/>
<apex:includeLightning />
<apex:Pagemessages />
<head>
<apex:slds />
<div class="slds-align_absolute-center">
<apex:image url="{!$Resource.AH_Physician_Expert_Template_Logo}" />
</div>
</head>
<apex:form >
<div class="slds-align_absolute-center">
<apex:outputText rendered="{!ThanksmsgAccpt}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for accepting, the case has now been added to your dashboard. Please log into the physician portal to begin your review.</span>
</apex:outputText>
<!--
<apex:outputText rendered="{!ThanksmsgRejec}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/> </span>
</apex:outputText>
-->
<apex:outputText rendered="true">
<apex:pageBlock >
<!-- span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/><br/> </span -->
<p>Please select the reason:</p>
<apex:actionRegion >
<apex:selectList id="Pleaseselectthereason" size="1" label="caseRejectReason" value="{!caseRejectReason}">
<apex:selectoption itemLabel="Out of office-cannot complete due to existing workload" itemValue="Out of office-cannot complete due to existing workload"></apex:selectoption>
<apex:selectoption itemLabel="I recommend another physician more suitable for this case.Enter Name in Free Text Box" itemValue="I recommend another physician more suitable for this case.Enter Name in Free Text Box"></apex:selectoption>
<apex:selectoption itemLabel="Other - explain" itemValue="Other - explain"></apex:selectoption>
<!--<apex:actionSupport event="onchange" reRender="comments" />-->
</apex:selectList>
</apex:actionRegion>
<br/>
<p>Comments:</p>
<apex:inputTextarea label="Comments" style="width:550px;height:100px" id="comments" value="{!caseRejectComment}"/>
<br/><br/>
<div align="center" draggable="false" >
<apex:commandButton action="{!saveRejectInfo}" value="Save"/>
</div>
</apex:pageBlock>
</apex:outputText>
<apex:outputText rendered="{!rejectreasonmessage}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.</span>
</apex:outputText>
<apex:outputText rendered="{!Assignedtoothers}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">This case has already been assigned to some other physician.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyAccepted}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already accepted the case.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyRejected}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already rejected the case.</span>
</apex:outputText>
</div>
</apex:form>
</apex:page>
Regards,
Isha
I want to display error mesg when we select 'Other-Explain'.
<apex:page showHeader="false" action="{!InitMethod}" cache="false" controller="AH_HN_PhysicianAcceptnReject_CLS" tabStyle="Case">
<apex:includeScript value="/soap/ajax/36.0/connection.js"/>
<apex:includeScript value="/soap/ajax/36.0/apex.js"/>
<apex:includeLightning />
<apex:Pagemessages />
<head>
<apex:slds />
<div class="slds-align_absolute-center">
<apex:image url="{!$Resource.AH_Physician_Expert_Template_Logo}" />
</div>
</head>
<apex:form >
<div class="slds-align_absolute-center">
<apex:outputText rendered="{!ThanksmsgAccpt}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for accepting, the case has now been added to your dashboard. Please log into the physician portal to begin your review.</span>
</apex:outputText>
<!--
<apex:outputText rendered="{!ThanksmsgRejec}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/> </span>
</apex:outputText>
-->
<apex:outputText rendered="true">
<apex:pageBlock >
<!-- span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/><br/> </span -->
<p>Please select the reason:</p>
<apex:actionRegion >
<apex:selectList id="Pleaseselectthereason" size="1" label="caseRejectReason" value="{!caseRejectReason}">
<apex:selectoption itemLabel="Out of office-cannot complete due to existing workload" itemValue="Out of office-cannot complete due to existing workload"></apex:selectoption>
<apex:selectoption itemLabel="I recommend another physician more suitable for this case.Enter Name in Free Text Box" itemValue="I recommend another physician more suitable for this case.Enter Name in Free Text Box"></apex:selectoption>
<apex:selectoption itemLabel="Other - explain" itemValue="Other - explain"></apex:selectoption>
<!--<apex:actionSupport event="onchange" reRender="comments" />-->
</apex:selectList>
</apex:actionRegion>
<br/>
<p>Comments:</p>
<apex:inputTextarea label="Comments" style="width:550px;height:100px" id="comments" value="{!caseRejectComment}"/>
<br/><br/>
<div align="center" draggable="false" >
<apex:commandButton action="{!saveRejectInfo}" value="Save"/>
</div>
</apex:pageBlock>
</apex:outputText>
<apex:outputText rendered="{!rejectreasonmessage}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.</span>
</apex:outputText>
<apex:outputText rendered="{!Assignedtoothers}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">This case has already been assigned to some other physician.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyAccepted}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already accepted the case.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyRejected}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already rejected the case.</span>
</apex:outputText>
</div>
</apex:form>
</apex:page>
Regards,
Isha
- sfdc@isha.ax1814
- March 22, 2021
- Like
- 0
Make a field required dynamically based on picklist value using Visualforce
Hi Team,
I have below vf page. I want to make comment field required only when picklist vaue is 'Other - explain'.
can you please help me
<apex:page showHeader="false" action="{!InitMethod}" cache="false" controller="AH_HN_PhysicianAcceptnReject_CLS" tabStyle="Case">
<apex:includeScript value="/soap/ajax/36.0/connection.js"/>
<apex:includeScript value="/soap/ajax/36.0/apex.js"/>
<apex:includeLightning />
<head>
<apex:slds />
<div class="slds-align_absolute-center">
<apex:image url="{!$Resource.AH_Physician_Expert_Template_Logo}" />
</div>
</head>
<apex:form >
<div class="slds-align_absolute-center">
<apex:outputText rendered="{!ThanksmsgAccpt}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for accepting, the case has now been added to your dashboard. Please log into the physician portal to begin your review.</span>
</apex:outputText>
<!--
<apex:outputText rendered="{!ThanksmsgRejec}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/> </span>
</apex:outputText>
-->
<apex:outputText rendered="{!ThanksmsgRejec}">
<apex:pageBlock >
<!-- span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/><br/> </span -->
<p>Please select the reason:</p>
<apex:selectList id="Pleaseselectthereason" size="1" value="{!caseRejectReason}">
<apex:selectoption itemLabel="Out of office-cannot complete due to existing workload" itemValue="Out of office-cannot complete due to existing workload"></apex:selectoption>
<apex:selectoption itemLabel="I recommend another physician more suitable for this case.Enter Name in Free Text Box" itemValue="I recommend another physician more suitable for this case.Enter Name in Free Text Box"></apex:selectoption>
<apex:selectoption itemLabel="Other - explain" itemValue="Other - explain"></apex:selectoption>
</apex:selectList>
<br/>
<p>Comments:</p>
<apex:inputTextarea label="Comments" style="width:550px;height:100px" id="comments" value="{!caseRejectComment}"/>
<br/><br/>
<div align="center" draggable="false" >
<apex:commandButton action="{!saveRejectInfo}" value="Save"/>
</div>
</apex:pageBlock>
</apex:outputText>
<apex:outputText rendered="{!rejectreasonmessage}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.</span>
</apex:outputText>
<apex:outputText rendered="{!Assignedtoothers}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">This case has already been assigned to some other physician.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyAccepted}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already accepted the case.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyRejected}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already rejected the case.</span>
</apex:outputText>
</div>
</apex:form>
</apex:page>
Regards,
Isha
I have below vf page. I want to make comment field required only when picklist vaue is 'Other - explain'.
can you please help me
<apex:page showHeader="false" action="{!InitMethod}" cache="false" controller="AH_HN_PhysicianAcceptnReject_CLS" tabStyle="Case">
<apex:includeScript value="/soap/ajax/36.0/connection.js"/>
<apex:includeScript value="/soap/ajax/36.0/apex.js"/>
<apex:includeLightning />
<head>
<apex:slds />
<div class="slds-align_absolute-center">
<apex:image url="{!$Resource.AH_Physician_Expert_Template_Logo}" />
</div>
</head>
<apex:form >
<div class="slds-align_absolute-center">
<apex:outputText rendered="{!ThanksmsgAccpt}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for accepting, the case has now been added to your dashboard. Please log into the physician portal to begin your review.</span>
</apex:outputText>
<!--
<apex:outputText rendered="{!ThanksmsgRejec}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/> </span>
</apex:outputText>
-->
<apex:outputText rendered="{!ThanksmsgRejec}">
<apex:pageBlock >
<!-- span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.<br/><br/> </span -->
<p>Please select the reason:</p>
<apex:selectList id="Pleaseselectthereason" size="1" value="{!caseRejectReason}">
<apex:selectoption itemLabel="Out of office-cannot complete due to existing workload" itemValue="Out of office-cannot complete due to existing workload"></apex:selectoption>
<apex:selectoption itemLabel="I recommend another physician more suitable for this case.Enter Name in Free Text Box" itemValue="I recommend another physician more suitable for this case.Enter Name in Free Text Box"></apex:selectoption>
<apex:selectoption itemLabel="Other - explain" itemValue="Other - explain"></apex:selectoption>
</apex:selectList>
<br/>
<p>Comments:</p>
<apex:inputTextarea label="Comments" style="width:550px;height:100px" id="comments" value="{!caseRejectComment}"/>
<br/><br/>
<div align="center" draggable="false" >
<apex:commandButton action="{!saveRejectInfo}" value="Save"/>
</div>
</apex:pageBlock>
</apex:outputText>
<apex:outputText rendered="{!rejectreasonmessage}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">Thank you for rejecting the case.</span>
</apex:outputText>
<apex:outputText rendered="{!Assignedtoothers}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">This case has already been assigned to some other physician.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyAccepted}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already accepted the case.</span>
</apex:outputText>
<apex:outputText rendered="{!AlreadyRejected}">
<span style="font-size:20px;font-weight:bold;" class="slds-m-top_xx-large">You have already rejected the case.</span>
</apex:outputText>
</div>
</apex:form>
</apex:page>
Regards,
Isha
- sfdc@isha.ax1814
- March 15, 2021
- Like
- 0
This page has an error. You might just need to refresh it. First, would you give us some details? (We're reporting this as error ID: -1511790141)
HI All,
Iam getting below error and i am posting my lightning component here.
This page has an error. You might just need to refresh it. First, would you give us some details? (We're reporting this as error ID: -1511790141)
Component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Case_Record" type="Object"/>
<aura:attribute name="recordLoadError" type="String"/>
<aura:attribute name="disabled" type="Boolean" default="false" />
<aura:attribute name="viewScreen" type="boolean" default="true"/>
<aura:attribute name="editScreen" type="boolean" default="FALSE"/>
<aura:attribute name="saved" type="Boolean" default="false" />
<aura:attribute name="textDisplay" type="Boolean" default="true" />
<aura:if isTrue="{!!v.saved}">
<!--View Case Timestamps:-->
<aura:if isTrue="{!v.viewScreen}">
<force:recordData
aura:id="recordLoader"
recordId="{!v.recordId}"
fields="Status,
New_Request_Submitted_Date_Time__c,
New_Request_Submited_completed_Date_Time__c,
Benefits_Eligibility_Initiated_Date_Time__c,
Benefits_Eligibility_Completed_Date_Time__c,
Program_Determination_Initiated_Date__c,
Program_Determination_Completed_Date__c"
targetFields="{!v.Case_Record}"
targetError="{!v.recordLoadError}"
/>
<!--<lightning:card>-->
<!--<h1 align="center" class="ui2" v.Case_Record>
<a><span class="slds-page-header__title slds-truncate" title="Request Timeline">Support Screen Link Sent</span></a>
</h1><br/>
<div class="slds-border_top"></div>-->
<!-- Markup start-->
<ul>
<aura:if isTrue="{!v.Case_Record.New_Request_Submitted_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_new_case">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-timeline__icon slds-icon_container slds-icon-standard-new_case " title="new_case">
<lightning:icon iconName="action:new_case" alternativeText="Approved" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>New Request</Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.New_Request_Submitted_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
<aura:if isTrue="{!v.Case_Record.New_Request_Submited_completed_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_new_group">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-icon_container slds-icon-standard-new_group slds-timeline__icon" title="new_group">
<lightning:icon iconName="action:new_group" alternativeText="Approved" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>New Request Completed </Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.New_Request_Submited_completed_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
<aura:if isTrue="{!v.Case_Record.Benefits_Eligibility_Completed_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_record">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-icon-standard-record slds-timeline__icon" title="record">
<lightning:icon iconName="action:record" alternativeText="record" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>Benefits Eligibility</Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.Benefits_Eligibility_Completed_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
</ul>
<!--</lightning:card>-->
<center>
<div class="slds-m-top_medium">
<lightning:button variant="brand" type="Edit" name="Edit" label="Edit" onclick="{!c.handleEdit}"/>
</div>
</center>
</aura:if>
<!--Edit Case Timestamps:-->
<aura:if isTrue="{!v.editScreen}">
<lightning:recordEditForm aura:id="createevalForm"
onload="{!c.handleLoad}"
onsubmit="{!c.handleSubmit}"
onsuccess="{!c.handleSuccess}"
recordId="{!v.recordId}"
objectApiName="Case">
<div class="slds-p-left_medium">
<div class="slds-p-right_medium">
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="New_Request_Submitted_Date_Time__c" aura:id="Track0"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="New_Request_Submited_completed_Date_Time__c" aura:id="Track2"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="Benefits_Eligibility_Initiated_Date_Time__c" aura:id="Track2"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="Benefits_Eligibility_Completed_Date_Time__c" aura:id="Track3"/>
</div>
</div>
</div>
<center>
<div class="slds-m-top_medium">
<!--<lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="Save" label="Save" onclick="{!c.handleSubmit}"/>-->
<lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="Save" label="Save" />
<lightning:button disabled="{!v.disabled}" variant="brand" type="cancel" name="Cancel" label="Cancel" onclick ="{!c.handleCancel}"/>
</div>
</center>
</div>
</lightning:recordEditForm>
</aura:if>
<aura:set attribute="else">
<p>Saved!</p>
</aura:set>
</div>
</div>
</aura:if>
</aura:component>
Controller:
({
init : function (component, event, helper) {
// $A.get('e.force:refreshView').fire();
},
handleEdit: function(component){
component.set("v.viewScreen",false);
component.set("v.editScreen",true);
$A.get('e.force:refreshView').fire();
},
handleSubmit : function(component, event, helper) {
var reqField1 = component.find('Track0').get('v.value');
var reqField2 = component.find('Track1').get('v.value');
component.set("v.textDisplay",false);
//if($A.util.isEmpty(reqField1) || $A.util.isEmpty(reqField2)){
// alert('All required fields should be completed.');
// } else
//if(!$A.util.isEmpty(reqField1) || !$A.util.isEmpty(reqField2)){
event.preventDefault();
var fields = event.getParam("fields");
alert('hi');
alert(fields);
//fields['Flag__c'] =false;
component.find('createevalForm').submit(fields); // Submit form
component.set("v.editScreen",false);
component.set("v.viewScreen",true);
$A.get('e.force:refreshView').fire();
//location.reload();
//}
},
handleLoad: function(component, event, helper) {
component.set('v.showSpinner', false);
},
showToast : function(title, type, message) {
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"title": title,
"type": type,
"message": message
});
toastEvent.fire();
},
handleCancel : function(component, event, helper) {
helper.showHide(component);
event.preventDefault();
component.set("v.editScreen",false);
component.set("v.viewScreen",true);
}
})
Regards,
Isha
Iam getting below error and i am posting my lightning component here.
This page has an error. You might just need to refresh it. First, would you give us some details? (We're reporting this as error ID: -1511790141)
Component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Case_Record" type="Object"/>
<aura:attribute name="recordLoadError" type="String"/>
<aura:attribute name="disabled" type="Boolean" default="false" />
<aura:attribute name="viewScreen" type="boolean" default="true"/>
<aura:attribute name="editScreen" type="boolean" default="FALSE"/>
<aura:attribute name="saved" type="Boolean" default="false" />
<aura:attribute name="textDisplay" type="Boolean" default="true" />
<aura:if isTrue="{!!v.saved}">
<!--View Case Timestamps:-->
<aura:if isTrue="{!v.viewScreen}">
<force:recordData
aura:id="recordLoader"
recordId="{!v.recordId}"
fields="Status,
New_Request_Submitted_Date_Time__c,
New_Request_Submited_completed_Date_Time__c,
Benefits_Eligibility_Initiated_Date_Time__c,
Benefits_Eligibility_Completed_Date_Time__c,
Program_Determination_Initiated_Date__c,
Program_Determination_Completed_Date__c"
targetFields="{!v.Case_Record}"
targetError="{!v.recordLoadError}"
/>
<!--<lightning:card>-->
<!--<h1 align="center" class="ui2" v.Case_Record>
<a><span class="slds-page-header__title slds-truncate" title="Request Timeline">Support Screen Link Sent</span></a>
</h1><br/>
<div class="slds-border_top"></div>-->
<!-- Markup start-->
<ul>
<aura:if isTrue="{!v.Case_Record.New_Request_Submitted_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_new_case">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-timeline__icon slds-icon_container slds-icon-standard-new_case " title="new_case">
<lightning:icon iconName="action:new_case" alternativeText="Approved" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>New Request</Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.New_Request_Submitted_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
<aura:if isTrue="{!v.Case_Record.New_Request_Submited_completed_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_new_group">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-icon_container slds-icon-standard-new_group slds-timeline__icon" title="new_group">
<lightning:icon iconName="action:new_group" alternativeText="Approved" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>New Request Completed </Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.New_Request_Submited_completed_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
<aura:if isTrue="{!v.Case_Record.Benefits_Eligibility_Completed_Date_Time__c !=null}">
<li>
<div class="slds-timeline__item_expandable slds-timeline__item_record">
<span class="slds-assistive-text">task</span>
<div class="slds-media"><div> </div>
<div class="slds-media__figure">
<div class="slds-icon-standard-record slds-timeline__icon" title="record">
<lightning:icon iconName="action:record" alternativeText="record" size="xx-small"/>
</div>
</div>
<div>
<a class="ui2"><Strong>Benefits Eligibility</Strong></a><br/>
<lightning:formattedDateTime class="ui" value="{!v.Case_Record.Benefits_Eligibility_Completed_Date_Time__c}" year="numeric" month="numeric" day="numeric" hour="2-digit"
minute="2-digit" hour12="true" weekday="long"/>
</div>
</div>
</div>
</li>
</aura:if>
</ul>
<!--</lightning:card>-->
<center>
<div class="slds-m-top_medium">
<lightning:button variant="brand" type="Edit" name="Edit" label="Edit" onclick="{!c.handleEdit}"/>
</div>
</center>
</aura:if>
<!--Edit Case Timestamps:-->
<aura:if isTrue="{!v.editScreen}">
<lightning:recordEditForm aura:id="createevalForm"
onload="{!c.handleLoad}"
onsubmit="{!c.handleSubmit}"
onsuccess="{!c.handleSuccess}"
recordId="{!v.recordId}"
objectApiName="Case">
<div class="slds-p-left_medium">
<div class="slds-p-right_medium">
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="New_Request_Submitted_Date_Time__c" aura:id="Track0"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="New_Request_Submited_completed_Date_Time__c" aura:id="Track2"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="Benefits_Eligibility_Initiated_Date_Time__c" aura:id="Track2"/>
</div>
</div>
<div class="slds-grid">
<div class="slds-col--padded slds-large-size--12-of-12"><span class="required">*</span>
<lightning:inputField fieldName="Benefits_Eligibility_Completed_Date_Time__c" aura:id="Track3"/>
</div>
</div>
</div>
<center>
<div class="slds-m-top_medium">
<!--<lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="Save" label="Save" onclick="{!c.handleSubmit}"/>-->
<lightning:button disabled="{!v.disabled}" variant="brand" type="submit" name="Save" label="Save" />
<lightning:button disabled="{!v.disabled}" variant="brand" type="cancel" name="Cancel" label="Cancel" onclick ="{!c.handleCancel}"/>
</div>
</center>
</div>
</lightning:recordEditForm>
</aura:if>
<aura:set attribute="else">
<p>Saved!</p>
</aura:set>
</div>
</div>
</aura:if>
</aura:component>
Controller:
({
init : function (component, event, helper) {
// $A.get('e.force:refreshView').fire();
},
handleEdit: function(component){
component.set("v.viewScreen",false);
component.set("v.editScreen",true);
$A.get('e.force:refreshView').fire();
},
handleSubmit : function(component, event, helper) {
var reqField1 = component.find('Track0').get('v.value');
var reqField2 = component.find('Track1').get('v.value');
component.set("v.textDisplay",false);
//if($A.util.isEmpty(reqField1) || $A.util.isEmpty(reqField2)){
// alert('All required fields should be completed.');
// } else
//if(!$A.util.isEmpty(reqField1) || !$A.util.isEmpty(reqField2)){
event.preventDefault();
var fields = event.getParam("fields");
alert('hi');
alert(fields);
//fields['Flag__c'] =false;
component.find('createevalForm').submit(fields); // Submit form
component.set("v.editScreen",false);
component.set("v.viewScreen",true);
$A.get('e.force:refreshView').fire();
//location.reload();
//}
},
handleLoad: function(component, event, helper) {
component.set('v.showSpinner', false);
},
showToast : function(title, type, message) {
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"title": title,
"type": type,
"message": message
});
toastEvent.fire();
},
handleCancel : function(component, event, helper) {
helper.showHide(component);
event.preventDefault();
component.set("v.editScreen",false);
component.set("v.viewScreen",true);
}
})
Regards,
Isha
- sfdc@isha.ax1814
- March 01, 2021
- Like
- 0
Process builder Formula Change-Need Urgent Help
Hi Team,
Iam having a query in Account 'SELECT Id,Name FROM Account WHERE Name LIKE 'Fireeye%'' and this one we converted into process builder formula as
AND(
NOT(ISBLANK([Case].AccountId )),
NOT(BEGINS([Case].Account.Name, "FireEye"))
another condtion is
NOT(CONTAINS([Case].Contact.Email, 'FireEye')
But i want to ignore case in my process builder formula as it is validating only 'FireEye' records but i want to validate irrespective of lower/upper/mixed . I want my formula work as Like funtion in Query.
This is urgent change pls help.
Regards,
ISHA
Iam having a query in Account 'SELECT Id,Name FROM Account WHERE Name LIKE 'Fireeye%'' and this one we converted into process builder formula as
AND(
NOT(ISBLANK([Case].AccountId )),
NOT(BEGINS([Case].Account.Name, "FireEye"))
another condtion is
NOT(CONTAINS([Case].Contact.Email, 'FireEye')
But i want to ignore case in my process builder formula as it is validating only 'FireEye' records but i want to validate irrespective of lower/upper/mixed . I want my formula work as Like funtion in Query.
This is urgent change pls help.
Regards,
ISHA
- sfdc@isha.ax1814
- April 13, 2020
- Like
- 0
process builder formula help- Urgent
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
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 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.
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 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.
Regards,
Isha
- sfdc@isha.ax1814
- August 27, 2019
- Like
- 0
VF tab in mobile version not working
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>
Can comeone help me on this.
Regards,
Isha
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>
Can comeone help me on this.
Regards,
Isha
- sfdc@isha.ax1814
- July 29, 2019
- Like
- 0
standard save - on case status change display new fields and save
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
Regards,
Isha
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
Regards,
Isha
- sfdc@isha.ax1814
- July 18, 2019
- Like
- 0
action status onchange sections should display
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
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
- sfdc@isha.ax1814
- July 11, 2019
- Like
- 0
scroll bar is not working in mobile in vfpage
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
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
- sfdc@isha.ax1814
- July 02, 2019
- Like
- 0
Urgent help ...help me on test class ?
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
"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
- sfdc@isha.ax1814
- June 10, 2019
- Like
- 0
System.SObjectException: DML statement cannot operate on trigger.new or trigger.old: Class.CustomTeamMemberTriggerBL.DeleteInactiveMembers: line 26, column 1
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
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
- sfdc@isha.ax1814
- February 06, 2019
- Like
- 0