• Anonymous1
  • NEWBIE
  • 15 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
Hi All, 

which is best way(flow/trigger) to calculate duration of Case Status particular picklist duration values and that sum value store it in custom field on case object.

We need same as Standard case lifecycle approach, as it calculates particular status time duration.
Example: I hae created one case record
User-added imageI want to caluclate only sum of "New" Duration values (0.004 + 0.55) and store it on case custom field(Date/Time) field. how to caluclate this duration values from case History

how this funtionality is feasible in flow / trigger. Kindly suggest me with some solution.

Thanks 
 
hi All,
I am trying to delete a visualforce page manually, it has showing reference type as Dashboard component and label  name, but when i click on that  label name , it s throwing an error as
"Data Not Available
      The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page.
"

This vf page called in apex class and button, those i have deleted by removing visualfoce page code between <apex:page></apex:page> tags.

Can anyone help to find the reference label to delete.

Thanks,
sampoorna.

 
Hi All, 

Can anyone help to correct this , if my code snippet is wrong:
I am using Contains keyword in Classic HTML Email Templates, i need to display dynamic values based on if Condition inside myCar();
example: myCar(MARUTHI 156);

myCar({!IF(CONTAINS(Case.Engine_Model_Db__c ,"MARUTHI")),"MARUTHI 156","{!IF(CONTAINS(Case.Engine_Model_Db__c,"SWIFT")),"SWIFT A1","False"}"})

Thanks in Advance
sfdclearner
Hi All,

I have a scenario, created product family as custom field on opportunity , whenever new opportunity product records are added f, then their pproduct family filed should autopopulate on opportunity( product family )custom field, when i delete any any opp products records from related opportunity then it auto delete that related record product family data from opportunity product family field. Any suggestion on apex code or can i do with flows? 

Thanks.
I have tried validation rule, but its not working

AND( $Profile.Name <> "Standard Platform User", 

IF( OR(AND( ISCHANGED(Status__c), ISPICKVAL(Status__c,"Yes")), 
AND( ISCHANGED(Status__c), ISPICKVAL(Status__c ,"No"))), 
ISCHANGED(NumberOfEmployees),NOT(ISCHANGED(NumberOfEmployees))), 

CASE(Status__c, "Yes",1, 
"No",1,0)=1)
 
This is achieved through standard contrller with detail page, but i want it through custom controller
<apex:page Controller="AccountRecordDisplay">
<apex:form >
     <apex:panelGrid columns="2" width="100%"  >
     <!--PageBlock 1 --->
            <apex:pageblock title="Account Records" >
               <apex:pageBlockTable value="{!acclist}" var="a">
                    <apex:column headerValue="Name" >
                        <apex:commandLink value="{!a.Name}" reRender="out">
                           <apex:param name="id" value="{!a.id}"/>
                        </apex:commandLink>
                    </apex:column> 
             </apex:pageBlockTable>                 
               <apex:pageBlockButtons location="Bottom" >
                    <apex:commandButton value="Previous"/>
                    <apex:commandButton value="Save"/>
                    <apex:commandButton value="Delete"/>
                    <apex:commandButton value="Next"/>
               </apex:pageBlockButtons>
            </apex:pageblock>
      <!---Page,block 2---> 
      <apex:pageBlock >   
       </apex:pageBlock>
               <apex:detail subject="{!$CurrentPage.Parameters.id}" inlineEdit="true" relatedList="false" />                                       
    </apex:panelGrid>          
    </apex:form>
</apex:page>


class:
public class AccountRecordDisplay
{

 public List<Account> acclist {set;get;}
 
 public AccountRecordDisplay()
 {
   acclist = new List<Account>([SELECT Id,Name FROM Account]);
 }
}

 
Test Class :

@isTest
private class ChainingQueueableClassTest 
{
 static testmethod void test3()
 {
     Test.startTest();
     System.enqueueJob(new ChainingQueueableClass());
     Test.stopTest();
     
     Contact con = new Contact();
     con.LastName = 'Test Con';
     con.LeadSource ='Web';
     con.Phone = '9573647724';
     insert con;
     Contact conts = [SELECT Id, LastName,LeadSource,Phone FROM Contact WHERE LastName = 'Test Con'];
         //conts.LeadSource ='Web';
       //  conts.Phone = '8712852052';
     //upsert conts;
    // System.assertEquals('8712852052', conts.Phone);
     System.assertEquals('Web', conts.LeadSource);    
 } 
    
}
Apex Class:

 
 
public class ChainingQueueableClass implements Queueable {

    public List<Contact> conlist {set; get;}
    
    public void execute(QueueableContext qc){
        conlist = [SELECT Id,LeadSource,Phone FROM Contact WHERE LastName ='sammm'];
        for(Contact c : conlist)    
       {
            c.LeadSource = 'Other'; // This bold style Code is not working showing red color , means its not covered code coverage ?
            c.Phone = '9573647724';
        
        }
        upsert conlist;
    }
}

 
Hi everyone,

I tried one scenario, i have created picklist field using custom functionality, upon changing the picklist value, the pageblocksection will show/hide.
Ex: If picklist value is fresher, then some other fields should show with pageblock and other Exp pageblocksection will be hidden  and vice versa.
I have written code, but its not working. can anyone help me to meet my criteria.

Thanks in advance

Vf code:
<apex:page standardController="Contact" extensions="StudentData1"  >
    <apex:form >
        <apex:pageBlock title="Rendering PageBlock sections" >
            <apex:pageBlockSection columns="2"  title="Student Data">
                   <apex:selectList value="{!StudentList}" size="1">
                   <apex:outputLabel value="Student:"/>
                   <apex:selectOptions value="{!list}">
                   <apex:actionSupport event="onchange" reRender="ab,bc"/>
                   </apex:selectOptions>
                   </apex:selectList>
            </apex:pageBlockSection>       
        </apex:pageBlock>
                
        <apex:outputpanel id="ab">

         <apex:pageBlock title="Fresher Details" rendered="{!list == 'Fresher'}">
            <apex:pageBlockSection columns="2">
                  <apex:inputField value="{!contact.FirstName}" />
                  <apex:inputField value="{!contact.LastName}" />
            </apex:pageBlockSection>
         </apex:pageBlock>
         
          </apex:outputpanel>
          
          <apex:outputpanel id="bc">

           <apex:pageBlock title="Experience Details" rendered="{!list == 'Exp'}">
            <apex:pageBlockSection columns="2">
                  <apex:inputField value="{!contact.Email}" />
                  <apex:inputField value="{!contact.Phone}" />
            </apex:pageBlockSection>
         </apex:pageBlock>
          
          </apex:outputpanel>

       <apex:commandButton value="save" action="{!Save}" /> 
        
    </apex:form>
</apex:page>

apex class:
public class StudentData1 {

    public StudentData1(ApexPages.StandardController controller) {

    }
  
public String StudentList {get;set;}
 
public List<SelectOption> getlist()
{
  List<SelectOption> stulist = new List<SelectOption>();
  stulist.add(new SelectOption('None','None'));
  stulist.add(new SelectOption('fresher','Fresher'));
  stulist.add(new SelectOption('Experience','Exp'));
  return stulist;
}

public pageReference save()
{
 return null;
}

}
Test Class :

@isTest
private class ChainingQueueableClassTest 
{
 static testmethod void test3()
 {
     Test.startTest();
     System.enqueueJob(new ChainingQueueableClass());
     Test.stopTest();
     
     Contact con = new Contact();
     con.LastName = 'Test Con';
     con.LeadSource ='Web';
     con.Phone = '9573647724';
     insert con;
     Contact conts = [SELECT Id, LastName,LeadSource,Phone FROM Contact WHERE LastName = 'Test Con'];
         //conts.LeadSource ='Web';
       //  conts.Phone = '8712852052';
     //upsert conts;
    // System.assertEquals('8712852052', conts.Phone);
     System.assertEquals('Web', conts.LeadSource);    
 } 
    
}
Apex Class:

 
 
public class ChainingQueueableClass implements Queueable {

    public List<Contact> conlist {set; get;}
    
    public void execute(QueueableContext qc){
        conlist = [SELECT Id,LeadSource,Phone FROM Contact WHERE LastName ='sammm'];
        for(Contact c : conlist)    
       {
            c.LeadSource = 'Other'; // This bold style Code is not working showing red color , means its not covered code coverage ?
            c.Phone = '9573647724';
        
        }
        upsert conlist;
    }
}

 
Hi everyone,

I tried one scenario, i have created picklist field using custom functionality, upon changing the picklist value, the pageblocksection will show/hide.
Ex: If picklist value is fresher, then some other fields should show with pageblock and other Exp pageblocksection will be hidden  and vice versa.
I have written code, but its not working. can anyone help me to meet my criteria.

Thanks in advance

Vf code:
<apex:page standardController="Contact" extensions="StudentData1"  >
    <apex:form >
        <apex:pageBlock title="Rendering PageBlock sections" >
            <apex:pageBlockSection columns="2"  title="Student Data">
                   <apex:selectList value="{!StudentList}" size="1">
                   <apex:outputLabel value="Student:"/>
                   <apex:selectOptions value="{!list}">
                   <apex:actionSupport event="onchange" reRender="ab,bc"/>
                   </apex:selectOptions>
                   </apex:selectList>
            </apex:pageBlockSection>       
        </apex:pageBlock>
                
        <apex:outputpanel id="ab">

         <apex:pageBlock title="Fresher Details" rendered="{!list == 'Fresher'}">
            <apex:pageBlockSection columns="2">
                  <apex:inputField value="{!contact.FirstName}" />
                  <apex:inputField value="{!contact.LastName}" />
            </apex:pageBlockSection>
         </apex:pageBlock>
         
          </apex:outputpanel>
          
          <apex:outputpanel id="bc">

           <apex:pageBlock title="Experience Details" rendered="{!list == 'Exp'}">
            <apex:pageBlockSection columns="2">
                  <apex:inputField value="{!contact.Email}" />
                  <apex:inputField value="{!contact.Phone}" />
            </apex:pageBlockSection>
         </apex:pageBlock>
          
          </apex:outputpanel>

       <apex:commandButton value="save" action="{!Save}" /> 
        
    </apex:form>
</apex:page>

apex class:
public class StudentData1 {

    public StudentData1(ApexPages.StandardController controller) {

    }
  
public String StudentList {get;set;}
 
public List<SelectOption> getlist()
{
  List<SelectOption> stulist = new List<SelectOption>();
  stulist.add(new SelectOption('None','None'));
  stulist.add(new SelectOption('fresher','Fresher'));
  stulist.add(new SelectOption('Experience','Exp'));
  return stulist;
}

public pageReference save()
{
 return null;
}

}
HI Everybody,

I have a standard Implementation object that works very closely like the Opportunity object but has different stages and a few different fields.  I'm trying to hide/show sections of this Implementation object based on what Stage was chosen out of this picklist.  I'm able to get this working when I create a separate visualforce page with the code below but I'm having trouble embedding this in the Implementation object.  I would rather not re-create an entirely custom Implementation object and just put some inline visualforce page into a section that takes care of this functionality. 

When I embed my visualforce page it acts completely separate from the standard Implementation object.  Here is my current visualforce code:

<apex:page standardController="Implementation__c" sidebar="true" tabStyle="Implementation__c">
   
    <apex:form >
       <apex:pageBlock title="Implementation">             
           <apex:pageBlocksection columns="2">
               <apex:outputField value="{!Implementation__c.Name}"/>
                <apex:outputField value="{!Implementation__c.Closed_Date__c}"/>
               <apex:inputField value="{!Implementation__c.Stages__c}">
                <apex:actionSupport event="onchange" reRender="ab, ac"/>  
                 </apex:inputField>
            </apex:pageBlocksection>
            </apex:pageBlock>
    
        <apex:outputpanel id="ab">
                <apex:pageBlock title="Execution" rendered="{!Implementation__c.Stages__c == 'Execution I'}">
                <apex:pageBlockSection >  
                <apex:pageblocksectionItem >
                    <apex:outputField value="{!Implementation__c.Next_Steps__c}"/>
                </apex:pageBlocksectionItem>
            </apex:pageBlocksection>
            </apex:pageblock>
        </apex:outputpanel>    
 
        <apex:outputpanel id="ac">
                <apex:pageBlock title="Completion" rendered="{!Implementation__c.Stages__c == 'Completion'}">
                <apex:pageBlockSection >  
                <apex:pageblocksectionItem >
                    <apex:outputField value="{!Implementation__c.Next_Steps__c}"/>
                </apex:pageBlocksectionItem>
            </apex:pageBlocksection>
            </apex:pageblock>
        </apex:outputpanel>
        
    </apex:form>
</apex:page>

Thanks,
Jeff