• chanti k
  • NEWBIE
  • 5 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 52
    Questions
  • 5
    Replies
Hi All,

i have two fileds on visualforce page . we are enterd one value in first filed then same value wil be  display in second filed

Kindly help me , how to write the functionality give me one eample


Cheers,
Chanti
HI All,

Actually my requirement is whenever case is created or closed a case , at that time i want calculate fiscal quarter based on calendar.
Below function is working using formula filed. but i have sturck . please let me know how to write a condtion for whenever case is created or closed a case on Maintance record type.

For your refrence here i am enclosing my code.
 
CASE(
    MONTH(TODAY()),

    1, "Q1",
    2, "Q1",
    3, "Q1",

    4, "Q2",
    5, "Q2",
    6, "Q2",

    7, "Q3",
    8, "Q3",
    9, "Q3",

    "Q4"
)

Please help me on this.

Thanks,
Chanti.​
Hi All,

I have 3 fileds on opportunity. these are fields
1)status is picklist, values of status : Approved, Rejected and In progress
2)App_date 
3)App year.

But Here my reuirements is when ever status is Approved then i want update App_date  and App_year. .but  App year is only current year  .

I did not get year format "YYYY".. 

please see the below eample for year .

Note :App_year = 2018.

Here my trigger.
trigger approvalupadte on Opportunity (before update, before insert)
{
  for(Opportunity opp : Trigger.new){
      if(opp.Status__c=='Approved')
      {
      
      opp.App_year ='YYYY';
      opp.App_date =system.today();
      }
      
     
        
  }

}
Kindly help me for Current year format, how to i will get
Thanks,
Chanti.
HI All,

1 ) I have 4 fields 1)Firstname 2)lastname 3) type is picklist(Value of picklist) 4 ) DATE on Opportunity object
2)  Firstname +lastname +type +DATE

My reuirement is i want track the information who ever changes those fields, How we can achive this?

Regards,
Chanti
Hi All,

I want calculate the "caseage" based on status changed value only for weekdays.

Example: here Caseage means : created case and closed cose 

i have picklist values of Status : In progress, pending and rejcted

Thanks in Advance

Chanti
Hi All,

i want hide input field based on select value from picklist in visualforce page
.
EX: Auto is text field and type is picklist. i have value of picklist (X, Y, Z). when ever i have select a value 'Y'  then i want hide Auto is text field.

Give me small Example.

Thanks in Advance,
Chanti
HI Experts 

This is my reuirement.

i have Follow button. for ex: i want count  avalue only one time but here same user clicked multipulle times on button that time i don't want increment count value. please help me how to i will write a logic in method.

 
<apex:commandButton id="CommandButton1" value="Follow" action="{!followOwner}"/>



public Integer followingCount{get;set;}

//Constructor
public userData (ApexPages.StandardController stdController) {
    UserId = UserInfo.getUserId();
    GetCount();
}

 //Method
 public void GetCount() {

 List<User> following = [SELECT Id, Name,title, SmallPhotoUrl FROM User WHERE Id =:parentsetid AND Id !=:u.id order by name]; 
    followingCount = following.size();
 }


Thanks in Advance,
Chanti
 
Hi ,

I have written a test class nad  I am getting this error in test class (System.QueryException: List has no rows for assignment to SObject), please help me . below is my test class and apex class 
 
public without sharing class CountCon {
    Integer count = 0;
    public Account a {get;set;}        
    
    public CountCon()
    {
        Account a = new Account();
        a = [Select NumberOfEmployees from Account where id = '0019000000DNnwo'];
        if(a.NumberOfEmployees != null)
            count = a.NumberOfEmployees;
    }           
    public PageReference incrementCounter() {
            count++;
            try
            {
                a = [Select id from Account where id = '0019000000DNnwo'];
                a.NumberOfEmployees = count;
                update a;
            }
            catch(exception e)
            {
                ApexPages.addMessages(e);
            }
            return null;
    }
       
                       
    public Integer getCount() {
        return count;
    }
}


Test class



@istest
public class CountCon_test
{ 
 static testmethod void test()
 {
 Account acc= new Account();
 Acc.name='test';
 insert Acc;
 
 CountCon cn = new CountCon ();
 cn.incrementCounter();
 cn.getCount();
 
 }
}

User-added image
Thanks,
Chanti.
HI , 

i got only 60% code coverage, i need more than 75%. please let me know how  i will cover for loop condtion

 
@istest
public class importDataFromCSVController_test
{
 
 static testmethod void test()
 {
 
 importDataFromCSVController mvc = new importDataFromCSVController();
 mvc.importCSVFile();
 mvc.csvAsString='test';
 
 
 }
}


CLASS

public class importDataFromCSVController {
public Blob csvFileBody{get;set;}
public string csvAsString{get;set;}
public String[] csvFileLines{get;set;}
public List<account> acclist{get;set;}
  public importDataFromCSVController(){
    csvFileLines = new String[]{};
    acclist = New List<Account>(); 
  }
  
  public void importCSVFile(){
       try{
           csvAsString = csvFileBody.toString();
           csvFileLines = csvAsString.split('\n'); 
            
           for(Integer i=1;i<csvFileLines.size();i++){
               Account accObj = new Account() ;
               string[] csvRecordData = csvFileLines[i].split(',');
               accObj.name = csvRecordData[0] ;             
               accObj.accountnumber = csvRecordData[1];
               accObj.Type = csvRecordData[2];
               accObj.AccountSource = csvRecordData[3];   
               accObj.Industry = csvRecordData[4];                                                                             
               acclist.add(accObj);   
           }
        //insert acclist;
        }
        catch (Exception e)
        {
            ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured while importin data Please make sure input csv file is correct');
            ApexPages.addMessage(errorMessage);
        }  
  }
}


Please see the my screen shot

User-added image

Thanks,
Chanti
Hi Eperts,

Please share me with example and provide bit more information.. pls don't share the link

Thanks,
Chanti

Hello all,
While saving a record now i am getting beloww error on command button , kindly do the needful.

Here i have attached the my code. pls see attached screen shot User-added image


Thanks,
Chanti










 
Apex class :Public class employmenthistiry
{

 public Employee__c emp{get;set;}
 public list<Employee__c > empl{get;set;}
 public List<SelectOption> Technicaloptions{get;set;}
 
 public employmenthistiry()
 {
 
 empl=[select id,name,Date_of_joining__c,Department__c,Desigination__c,Email__c,Employeeid__c,Mobile__c,Office_Phone__c,payslip_lase_sent_date__c,Permanent_cITY__c from Employee__c];
 
  
 }
 
 
 public PageReference submit()
 {
 insert emp;
 return null;
 }
 
}



PAGE

<apex:page controller="employmenthistiry" sidebar="true">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection title="Employe" collapsible="false">
                    <apex:inputField value="{! emp.Name }"/>
                    <apex:inputField value="{! emp.Date_of_joining__c}"/>
                    <apex:inputField value="{! emp.Department__c}"/>
                    <apex:inputField value="{! emp.Desigination__c}"/>
                    <apex:inputField value="{! emp.Email__c}"/>
                    <apex:inputField value="{! emp.Employeeid__c}"/>
                    <apex:inputField value="{! emp.Mobile__c }"/>
                    <apex:inputField value="{! emp.Office_Phone__c}"/>
                    <apex:inputField value="{! emp.payslip_lase_sent_date__c}"/>
                    <apex:inputField value="{! emp.Technology__c}"/>
                    </apex:pageBlockSection>
                    
             <apex:pageBlockSection TItle="ADDRESS">
             
                    <apex:inputField value="{! emp.Permanent_cITY__c }"/>
                    <apex:inputField value="{! emp.Permanent_State__c}"/>
                    <apex:inputField value="{! emp.PIN_CODE__c}"/>
                    <apex:inputField value="{! emp.Permanent__c}"/>
                    <apex:inputField value="{! emp.Name }"/>
                    <apex:inputField value="{! emp.Village__c}"/>
            </apex:pageBlockSection>   
            
            <apex:commandButton value="submit" action="{!submit}" />  
                
              
        </apex:pageBlock>
  </apex:form>
</apex:page>

 
HI Friends,
what is difference between partner managemant and partner training management 

Reagards,
Chanto

 
Hi,

I am trying to get the parent and child object filed values, but i have rescived chaild object filelds and i am not able to getting the parent object filedvalue.

How to we can do the merge filed in html email teplate

Could you pls guide me any one.
HI ,


I have 3 fields, one is required field (Product__c)have in one pageblock section section and one more section i have two fileds, such as(Type__c= Mechanic and seviarty__c=Admin.).

When ever i can set  for those fileds then now i want remove required for (Product__c) this filed.

Can you please sugggested me, with example code in apex class .

Thank you,
Chanti

 
HI,
i need update currency is Pound , when ever i can set  country is set to uk,
how to i can achive this by using this triggerr 

Thanks,
Chnati
I Have one filed on Account .Name of filed is "Named Account "it is a check box.
.  If the Named Accounts checkbox field is checked, we should display an image in the Named Account Indicator field, I want it in Red Color and a bigger font size .

How to we can achive ths & Kindly help me.?

Thanks,
Chanti
Hi expert community,

Below is my requirement.

I have acreated a user with Dataadministrator profile.after i am not able to login dataloder.
Let me know why we are getting this error , please help me on this.

Regards,
Chanti
Hi Experts,

Let me know What are the components we can't added to change set ? if we can't added to the changeset then how to move production? please write some componenete with highlight.

Regards,
Chanti
Hi Experts,

My requirement is i want able to see the all follwers in asingle report? if it is possible pls domenstration on this or let me know any alternate ou way. 

Kindly do the needful.

Thanks 
Chanti
HI All,

I have 3 visualforce pages. like V1, V2 and V3 Pages . Now my requirement is V1 page and V2 pages move to V3 Page (Entire the data from V1 , V2 to V3 Page.) how to we can achive this .pls give me with example code . 

Kindly help on this. 
Hi Eperts,

Please share me with example and provide bit more information.. pls don't share the link

Thanks,
Chanti

Hi All,

why we can't use V lookup functionality on standard objects ? we can impliment only on Custom object. what is the reason, Any one can expalin this.
Regards,
Viswanadham.
 
HI All,

I have 3 visualforce pages. like V1, V2 and V3 Pages . Now my requirement is V1 page and V2 pages move to V3 Page (Entire the data from V1 , V2 to V3 Page.) how to we can achive this .pls give me with example code . 

Kindly help on this. 
Hi All,

i want display the 3 fields whenever select the value of picklist in visualforce page? how to w e can achive this.

Example with code..this is very helpfull for me.
pls help me..
 
Hi ,

Below is my code for the apex class.Could you please help me .
public class EmailMessage {

    public String emailTo {get;set;}
    public String emailCc {get;set;}
    public String subject {get;set;}
    public String body {get;set;}
    
    private final Lead lead;

    public PageReference cancel() {
        return null;
    }

     public EmailMessage() {
     list <lead> l= [select Description, ID from Lead where id = :ApexPages.currentPage().getParameters().get('id')];
       subject = lead.Description;
          } 
   
    public void sendEmail() {
        
        //create a mail object to send email 
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        //string to hold To Addresses
        if (emailTo != '') {
            String[] toaddress = (new String[]{emailTo});
            //set email properties 
            mail.setSubject(subject);
            mail.setUseSignature(true);
            mail.setPlainTextBody(body); 
            mail.setTargetObjectID(lead.id);
            mail.setToAddresses(toaddress);

         if (emailCc != '') {
            String[] ccaddress = (new String[] {emailCc});
            mail.setCcAddresses(ccaddress);
            }
    
            // send the email
            Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});  
            
            lead.status = 'Email Sent';
            Update lead;
        }           
     }   
 }
Chanti,