• Supriyo Ghosh 5
  • NEWBIE
  • 75 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 39
    Replies
Hi,

I am having three record type in opportunity like a,b,c.I want to restrict a user e.g Ram Sharma should not create any opportunity with record type b.
Please suggest me how to do that.I cannot change his profile.
HI,

I want to copy one custom fields value to another custom fileds with a suffix value.For example
Code = 65892001
I want to put one A before this number and save it to another filed.(Like New code = A65892001).Is it possible??
Hi,

I am trying to copy one field value to another field through one button click.I have created one custom button and in java script is below.

{!requireScript("/soap/ajax/26.0/connection.js")} 
var emp=sforce.connection.query("Select Branch_Code__r.Name from Employee_Master__c where User__c='{!User.Id}' limit 1"); 
var recs = emp.getArray("records"); 
window.open("https://pfpdl--pdlpcsb.cs31.my.salesforce.com/a0v/e?ent=BDC-Transaction-Detail Edit&save_new_url=%2Fa0v%2Fo&retURL=&00Np0000000mvq0="+recs[0].Branch_Code__r.Name,"_self");

This script is copying the value in the url but not in that field.Anyone please help.
Hi,
I have a rich text area field where we are storing images.In my vf page I want to decrese the height and width as per my requirement.Please help.

<apex:column value="{!em.Image__c}"/>
I have a vf page and I want to sort that based on a particular field.Please help me to do that.
Page:
<apex:page standardController="Proposal_Details__c" sidebar="false" showChat="false" showHeader="false">
<apex:includeScript value="/support/console/26.0/integration.js"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"/>
    <script type="text/javascript">
        $j = jQuery.noConflict();    
        $j(document).ready(function () {
        $j("table.tableSorter").tablesorter();
        });    
    </script>
    <apex:Form >
    <apex:pageBlock >
        <apex:pageBlockSection columns="1" collapsible="false">
            <apex:pageBlockTable id="orderTable" value="{!Proposal_Details__c.Premium_Details__r}" var="p" styleClass="tablesorter" headerClass="header">
                <apex:Column value="{!p.Premium_Number__c}" headerClass="header"/>
                <apex:Column value="{!p.Premium_Detail_Page_Link__c}" headerClass="header"/>
                <apex:Column value="{!p.Premium_Type__c}" headerClass="header"/>
                <apex:Column value="{!p.Premium_Due_Date__c}" headerClass="header"/>
                <apex:Column value="{!p.Paid_Premium_Amount__c}" headerClass="header"/>
                <apex:Column value="{!p.Premium_Paid__c}" headerClass="header"/>
                <apex:Column value="{!p.Next_Due_Date__c}" headerClass="header"/>
                <apex:Column value="{!p.Collection_Date__c}" headerClass="header"/>
                <apex:Column value="{!p.Allocation_Date__c}" headerClass="header"/>
                <apex:Column value="{!p.Payment_Source__c}" headerClass="header"/>
            </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:Form>
</apex:page>
HI,
I have a apex class which is generating a report based on Query.I want to give a numer for that set of records.So for each time report generation a new number will be generate and post that number in all the record fetch in that report.How to do that.Please help.
Class
public with sharing class GenerateDtfCase {

    public GenerateDtfCase() {

    }

//public POSDetails__c customerObj{get;set;}
  Public List<Case> customerObj = new List<Case>();
  public List<Case> getcustomerObj(){return customerObj;}

  Public List<Employee_Master__c> Emp{get;set;}
  public String branchcode{get;set;} 
  public Case trnObj = new case();
  public Case gettrnObj(){return trnObj;}
  
  public list<case> upcase = new list<case>();
   
  //public String cityBranch {get;set;} 
public Date Today { get { return Date.today(); }}
    public GenerateDtfCase(ApexPages.StandardController controller) {
      try
        {
            Emp= [Select e.User__r.Id, e.User__c, e.Id, e.Branch_Code__r.BranchCode__c, e.Branch_Code__r.Cash_inCounter_Limit__c, 
                  e.Branch_Code__r.Cash_in_Safe_Limit__c, e.Branch_Code__r.Name, e.Branch_Code__c 
                  From Employee_Master__c e where User__r.Id = : UserInfo.getUserId() and Active__c= : true  limit 1];
            
            if(Emp[0].Branch_Code__r.BranchCode__c!= null)
            {
               
                branchcode=Emp[0].Branch_Code__r.Name;
            }else{
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'No Branch mapping found in Employee master for the logged in user.  Please contact the system administrator to get it corrected.'));
            }
        }catch(exception e){
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'No mapping record found in Employee Master for the Logged in user. Please contact the system administrator to get it corrected.'));
        }
    system.debug('branch code:'+branchcode);
    
    //customerObj = [select id, Name,Complete_Status__c,Branch_name__c,Creation_Date__c,Document_List__c,Vertical__c,Status__c,DTF_Creation_Date__c,Effective_date_of_coverage__c,Policy_No__c,proposal_Application_no__c,proposal_Name__c,Request_Type__c,Request_Type_new_del__c,Branch__c ,Supporting_Document_del__c 
    //FROM POSDetails__c WHERE Vertical__c='LI' AND Branch__r.Name =:branchcode];
    
//customerObj = [select id, Name, Complete_Status__c, Branch_name__c,Branch__r.Name , Creation_Date__c, Document_List__c, Vertical__c, Status__c, DTF_Creation_Date__c, Effective_date_of_coverage__c, Policy_No__c, proposal_Application_no__c, proposal_Name__c, Request_Type__c, Request_Type_new_del__c, Branch__c, Supporting_Document_del__c, OwnerId from POSDetails__c where (Vertical__c = 'LI'and Branch__r.Name =:branchcode)];
system.debug('test query branch:'+branchcode);
system.debug('test query customerObj:'+customerObj );
//ModifyCase();
    }
    
    public void ModifyCase() {
    System.debug('====customerObj:'+customerObj);
      for(Case c: [select id,CaseNumber,Branch_name__c,Account_Name__c,Proposal_Detail__c,Branch_Code__c,DTF_No2__c,Principal_code__c,Policy_Number__c,Creation_Date__c,Document_List__c,Vertical__c,DTF_Creation_Date__c,Effective_date_of_coverage__c,Request_Type__c,Supporting_Document__c 
    FROM Case WHERE (RecordTypeID ='012O00000005BMS' AND DTF_Creation_Date__c=null AND Vertical__c =: trnObj.Vertical__c AND Principal_code__c =: trnObj.Principal_code__c)]) {
      
            customerObj.add(c);
            case ics = new case();
            ics.id = c.id;
            ics.DTF_Creation_Date__c = System.today();
            ics.DTF_No2__c = c.Branch_Code__c +c.CaseNumber+ System.today();
            upcase.add(ics);
             
     }
     
     if(!upcase.isempty()){
        update upcase;
     }
    } 
    Public pageReference exportReport(){
    PageReference pg=ApexPages.currentPage();
     
        // System.Debug('>>>>>>>>>>>Date Test:>>>>>>>>>>'+trnObj.DTF_genarated_date__c);
        pg=new PageReference('/apex/Genarate_DTF_for_Case?vert='+ trnObj.Vertical__c +'&pricode='+trnObj.Principal_code__c);
        pg.setredirect(true);
        return pg;
    }
}
HI,
I have a exsiting Apex class where I want to update a field.
for(Case c: [select id,CaseNumber,Branch_name__c,Account_Name__c,Proposal_Detail__c,Principal_code__c,Policy_Number__c,Creation_Date__c,Document_List__c,Vertical__c,DTF_Creation_Date__c,Effective_date_of_coverage__c,Request_Type__c,Supporting_Document__c 
    FROM Case WHERE (RecordTypeID ='012O00000005BMS' AND DTF_Creation_Date__c=null AND Vertical__c =: trnObj.Vertical__c AND Principal_code__c =: trnObj.Principal_code__c)]) {
      
            customerObj.add(c);
            case ics = new case();
            ics.id = c.id;
            ics.DTF_Creation_Date__c = System.today();
            upcase.add(ics);
In the above code I am updating DTF_Creation_Date__c like that I want to update DTF_No__c.
I want to do like below.
DTF_No__c=Branch Code+DTF_Creation_Date__c.
Problem is DTF No is a numeric field,Branch Code is formula field and DTF creation date is date time filed.
So how to do it.Please help.
Hi,
I have a apex class.I want to add a fiter criteria if vertical__c=='test' from case object then update date__c=system.today();.Please help.

Class
public with sharing class GenerateDtfCase {
Public List<Case> customerObj{get;set;}
  Public List<Employee_Master__c> Emp{get;set;}
  public String branchcode{get;set;}
public Date Today { get { return Date.today(); }}
    public GenerateDtfCase(ApexPages.StandardController controller) {
      try
        {
            Emp= [Select e.User__r.Id, e.User__c, e.Id, e.Branch_Code__r.BranchCode__c, e.Branch_Code__r.Cash_inCounter_Limit__c, 
                  e.Branch_Code__r.Cash_in_Safe_Limit__c, e.Branch_Code__r.Name, e.Branch_Code__c 
                  From Employee_Master__c e where User__r.Id = : UserInfo.getUserId() and Active__c= : true  limit 1];
            
            if(Emp[0].Branch_Code__r.BranchCode__c!= null)
            {
               
                branchcode=Emp[0].Branch_Code__r.Name;
            }else{
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'No Branch mapping found in Employee master for the logged in user.  Please contact the system administrator to get it corrected.'));
            }
        }catch(exception e){
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'No mapping record found in Employee Master for the Logged in user. Please contact the system administrator to get it corrected.'));
        }
    system.debug('branch code:'+branchcode);
    
    
    customerObj = [select id,CaseNumber,Branch_name__c,Account_Name__c,Proposal_Detail__c,Policy_Number__c,Creation_Date__c,Document_List__c,Vertical__c,DTF_Creation_Date__c,Effective_date_of_coverage__c,Request_Type__c,Supporting_Document__c 
    FROM Case WHERE Vertical__c='LI' AND RecordType.ID ='012O00000005BMS' AND created_date__c=true ];
        
//customerObj = [select id, Name, Complete_Status__c, Branch_name__c,Branch__r.Name , Creation_Date__c, Document_List__c, Vertical__c, Status__c, DTF_Creation_Date__c, Effective_date_of_coverage__c, Policy_No__c, proposal_Application_no__c, proposal_Name__c, Request_Type__c, Request_Type_new_del__c, Branch__c, Supporting_Document_del__c, OwnerId from POSDetails__c where (Vertical__c = 'LI'and Branch__r.Name =:branchcode)];
system.debug('test query branch:'+branchcode);
system.debug('test query customerObj:'+customerObj );

    }
    
    public GenerateDtfCase() {
      
    } 

}
Hi,

I want to create a button through which I will upload a image in a standard page layout.Is it possible.Please help
I have written a validation rule but it is not working.Please help.

(ISCHANGED(Date_of_Birth__c)) &&($User.ProfileId<>'00e90000001TW6p')

DOB cannot be change other than system admin.
Hi,

I have created on vf page report but when I am click on run button the filter is not working.Please help.

Controller

public class EmpMasterReport
{

    public PageReference EmpList() {
        return null;
    }
    public Employee_Master__c getemp()
    {
      return emp;
    }
   public  Employee_Master__c emp=new Employee_Master__c (); 
   public Transient Date datename{set;get;}  
   public List<Employee_Master__c> EmpList {get;set;}
   public List<Employee_Master__c> PDF_EmpList = new List<Employee_Master__c>();
   public List<Employee_Master__c> getPDF_EmpList(){return PDF_EmpList;}
   public string str{get;set;}
   public date dt;
   
    public EmpMasterReport(ApexPages.StandardController stdController) 
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
        
    }
    
    public EmpMasterReport()
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
         
        //PDF_EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM 
        //Employee_Master__c where Active__c=true and Photo__c !=null and Date_Of_Birth__c =: datename];
        
        //system.debug(' PDF_EmpList '+ PDF_EmpList);
    }
    
     public void run()
    {
        //EmpList = new     List<Employee_Master__c>();
        //EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
        try
        {
        date dt=emp.Date_Of_Birth__c;
        EmpList =new list<Employee_Master__c>();
        EmpList= [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM 
        Employee_Master__c where Active__c=true and Photo__c !=null and Date_Of_Birth__c =:dt];
        }
        catch(exception e)
        {
         str=e.getmessage()+e.getlinenumber();
        }
        
        
        system.debug(' PDF_EmpList '+ EmpList);
    }
    
    
    Public pageReference exportReport()
    {
        //pageReference newPage;
        String Br='EmpMasterReport';
        
        system.debug(' datename '+ datename);
        
        PDF_EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM 
        Employee_Master__c where Active__c=true and Photo__c !=null and Date_Of_Birth__c =: datename];
        
        system.debug(' PDF_EmpList '+ PDF_EmpList);
        
        /*if(datename==null)
        {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO,'Please select the Date');
            ApexPages.addMessage(myMsg);
            
        }else
        {*/
            //newPage = new pageReference('/apex/EmpMasterReport_PdfDownloader');
            
            /*Blob pdfpageblob;
            pdfpageblob = newpage.getcontentAsPdf();
            
            Attachment a = new Attachment();
            a.Body = pdfpageblob;
            insert a;*/
        //}
        pageReference newPage = new pageReference('/apex/EmpMasterReport_PdfDownloader');
        newPage.setredirect(true);
        return newPage;
        //return null;
    }
    
    public pageReference pdfreport(){
        system.debug('FSAF');
        pageReference newPage = new pageReference('/apex/EmpMasterReport_PdfDownloader');
        newPage.setredirect(true);
        return newPage;
    }
   
}

vf page
<apex:page id="p1" docType="html-5.0" standardController="Employee_Master__c" extensions="EmpMasterReport" sidebar="false" showHeader="false" cache="true">

<apex:form id="frmid">
<apex:pagemessages ></apex:pagemessages>
<apex:pageBlock title="Employee Master Details" id="Emp_Master">
&nbsp;As On: &nbsp; &nbsp;&nbsp; <apex:input type="date" value="{!datename}"/>
&nbsp; &nbsp;&nbsp; <apex:commandButton Value="Run" action="{!run}" status="generateid" reRender="frmid"/>
<apex:commandButton value="Export As PDF" action="{!exportReport}" status="generateid" reRender="pageid"/> <apex:actionStatus id="actionid" startText="Please Wait...."> </apex:actionStatus>
<apex:pageBlockTable value="{! EmpList }" var="em" border="2"> <apex:column value="{!em.Name}"/>
<apex:column value="{!em.Address__c}"/>
<apex:column value="{!em.Date_Of_Birth__c}"/> <apex:column value="{!em.Date_Of_Joining__c}"/>
<apex:column value="{!em.Date_of_Leaving__c}"/>
<apex:column value="{!em.Thumbnail__c}"/> </apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Hi,

I have a vf page where i want to add a date filter on a particulat filed Date of joining.so if I select a date that should run a query which will provide me the data still that date.

Please help.

Controller

public class EmpMasterReport
{
   public Transient Date datename{set;get;}  
   public List<Employee_Master__c> EmpList {get;set;}
  
   
    public EmpMasterReport(ApexPages.StandardController stdController) 
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
        
    }
    
    public EmpMasterReport()
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
    
    Public pageReference exportReport()
    {
        pageReference newPage;
        String Br='EmpMasterReport';
        /*if(datename==null)
        {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO,'Please select the Date');
            ApexPages.addMessage(myMsg);
            
        }else
        {*/
            newPage = new pageReference('/apex/EmpMasterReport_PdfDownloader');
            
            /*Blob pdfpageblob;
            pdfpageblob = newpage.getcontentAsPdf();
            
            Attachment a = new Attachment();
            a.Body = pdfpageblob;
            insert a;*/
        //}
        
        return newPage;
    }
   
}

Please let me know how to do that.
Hi,

I am trying download a vf page as pdf by button click.But unable to get the report.Please help.

Controller

public class EmpMasterReport
{
   public Transient Date datename{set;get;}  
   public List<Employee_Master__c> EmpList {get;set;}
   
    public EmpMasterReport(ApexPages.StandardController stdController) 
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
    
    public EmpMasterReport()
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
    
    Public pageReference exportReport()
    {
        pageReference newPage;
        String Br='EmpMasterReport';
        if(datename==null)
        {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO,'Please select the Date');
            ApexPages.addMessage(myMsg);
            
        }else
        {
            newPage = new pageReference('/apex/EmpMaster_Report');
            Blob pdfpageblob;
            pdfpageblob = newpage.getcontentAsPdf();
            
             insert Blob;
        }
        
        return newPage ;
    }
   
}

Please help.
Hi,

I want to create a button which will generate my vf page report as PDF.

Controller

public class EmpMasterReport
{
   public List<Employee_Master__c> EmpList {get;set;}
   
    public EmpMasterReport(ApexPages.StandardController stdController) 
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
    
    public EmpMasterReport()
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
   
}

vf Page

<apex:page id="p1" standardController="Employee_Master__c" extensions="EmpMasterReport" sidebar="false" showHeader="false" cache="true">

<apex:form >
<apex:pageBlock title="Employee Master Details" id="Emp_Master">
<apex:pageBlockTable value="{! EmpList }" var="em" border="2">
<apex:column value="{!em.Name}"/>
<apex:column value="{!em.Address__c}"/>
<apex:column value="{!em.Date_Of_Birth__c}"/>
<apex:column value="{!em.Date_Of_Joining__c}"/>
<apex:column value="{!em.Date_of_Leaving__c}"/>
<apex:column value="{!em.Thumbnail__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Please note I cannot use "renderas=pdf".Please help.
I am to copy one text field from child to parent object.but I am getting one error.Please help.

Trigger

trigger EmployeeMaster  on SP_Master__c (after insert,after update) 
{
    
    Set<id> EmployeeRecords  = new Set<ID>();
    
    for(SP_Master__c sp : trigger.new)
    {
        if( sp.Active__c == true && sp.License_Type__c == 'LI')
        {
            EmployeeRecords.add(sp.Employee_Code__c);
        }
    }
    
    list<Employee_Master__c> EmpMaster = [select id,Name,SP__c,LI_License_No__c from Employee_Master__c where id IN :EmployeeRecords and SP__c = false ];
    
    for( Employee_Master__c empM : EmpMaster )
        
      
    {
        empM.SP__c = true;
        empM.LI_License_No__c=sp.License_Number__c;
        
    }
     
    if(EmpMaster.size()>0)
    {
        update EmpMaster;
    }
}

Error

Error: Compile Error: Variable does not exist: sp.License_Number__c at line 21 column 31
Hi,

I want to add grid in my vf page and also show as landscape mode.Please help.

My vf page
<apex:page id="p1" standardController="Employee_Master__c" extensions="EmpMasterReport" sidebar="false" 
        renderAs="PDF" showHeader="false">
     <apex:form >
        <apex:pageBlock title="Employee Master Details" id="Emp_Master">
            <apex:pageBlockTable value="{! EmpList }" var="em">
                <apex:column value="{!em.Name}"/>
                
                <apex:column value="{!em.Address__c}"/>
                
                <apex:column value="{!em.Date_Of_Birth__c}"/>
                
                <apex:column value="{!em.Date_Of_Joining__c}"/>
                
                <apex:column value="{!em.Date_of_Leaving__c}"/>
                
                <apex:column value="{!em.Thumbnail__c}"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
    
</apex:page>

Apex class

public class EmpMasterReport
{
   public List<Employee_Master__c> EmpList {get;set;}
   
    public EmpMasterReport(ApexPages.StandardController stdController) 
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
    
    public EmpMasterReport()
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
   
}

Please help.
Hi,

I want to add grid in my vf page and also show as landscape mode.Please help.

My vf page
<apex:page id="p1" standardController="Employee_Master__c" extensions="EmpMasterReport" sidebar="false" 
        renderAs="PDF" showHeader="false">
     <apex:form >
        <apex:pageBlock title="Employee Master Details" id="Emp_Master">
            <apex:pageBlockTable value="{! EmpList }" var="em">
                <apex:column value="{!em.Name}"/>
                
                <apex:column value="{!em.Address__c}"/>
                
                <apex:column value="{!em.Date_Of_Birth__c}"/>
                
                <apex:column value="{!em.Date_Of_Joining__c}"/>
                
                <apex:column value="{!em.Date_of_Leaving__c}"/>
                
                <apex:column value="{!em.Thumbnail__c}"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
    
</apex:page>
Hi,

I have two object.
1.Employee Master
2.Sp Master.

SP master is a related list with Employee master.So i want if SP Master one field Active__c =true then on check box should get checked in Employee master.How to do that.Please help.
Hi,

I want to create a report through vf page.My object name is EmpMaster.I want to display name,address and Emp code.Can anyone help me with the apex code and vf page.

Name      Address           EmpCode
Suman    Kolkata              20012
Saha       West Bengal      50026

I want to display like this.Please help.
Hi,

I am trying to copy one field value to another field through one button click.I have created one custom button and in java script is below.

{!requireScript("/soap/ajax/26.0/connection.js")} 
var emp=sforce.connection.query("Select Branch_Code__r.Name from Employee_Master__c where User__c='{!User.Id}' limit 1"); 
var recs = emp.getArray("records"); 
window.open("https://pfpdl--pdlpcsb.cs31.my.salesforce.com/a0v/e?ent=BDC-Transaction-Detail Edit&save_new_url=%2Fa0v%2Fo&retURL=&00Np0000000mvq0="+recs[0].Branch_Code__r.Name,"_self");

This script is copying the value in the url but not in that field.Anyone please help.
HI,
I have a exsiting Apex class where I want to update a field.
for(Case c: [select id,CaseNumber,Branch_name__c,Account_Name__c,Proposal_Detail__c,Principal_code__c,Policy_Number__c,Creation_Date__c,Document_List__c,Vertical__c,DTF_Creation_Date__c,Effective_date_of_coverage__c,Request_Type__c,Supporting_Document__c 
    FROM Case WHERE (RecordTypeID ='012O00000005BMS' AND DTF_Creation_Date__c=null AND Vertical__c =: trnObj.Vertical__c AND Principal_code__c =: trnObj.Principal_code__c)]) {
      
            customerObj.add(c);
            case ics = new case();
            ics.id = c.id;
            ics.DTF_Creation_Date__c = System.today();
            upcase.add(ics);
In the above code I am updating DTF_Creation_Date__c like that I want to update DTF_No__c.
I want to do like below.
DTF_No__c=Branch Code+DTF_Creation_Date__c.
Problem is DTF No is a numeric field,Branch Code is formula field and DTF creation date is date time filed.
So how to do it.Please help.
Hi,
I have a apex class.I want to add a fiter criteria if vertical__c=='test' from case object then update date__c=system.today();.Please help.

Class
public with sharing class GenerateDtfCase {
Public List<Case> customerObj{get;set;}
  Public List<Employee_Master__c> Emp{get;set;}
  public String branchcode{get;set;}
public Date Today { get { return Date.today(); }}
    public GenerateDtfCase(ApexPages.StandardController controller) {
      try
        {
            Emp= [Select e.User__r.Id, e.User__c, e.Id, e.Branch_Code__r.BranchCode__c, e.Branch_Code__r.Cash_inCounter_Limit__c, 
                  e.Branch_Code__r.Cash_in_Safe_Limit__c, e.Branch_Code__r.Name, e.Branch_Code__c 
                  From Employee_Master__c e where User__r.Id = : UserInfo.getUserId() and Active__c= : true  limit 1];
            
            if(Emp[0].Branch_Code__r.BranchCode__c!= null)
            {
               
                branchcode=Emp[0].Branch_Code__r.Name;
            }else{
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'No Branch mapping found in Employee master for the logged in user.  Please contact the system administrator to get it corrected.'));
            }
        }catch(exception e){
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'No mapping record found in Employee Master for the Logged in user. Please contact the system administrator to get it corrected.'));
        }
    system.debug('branch code:'+branchcode);
    
    
    customerObj = [select id,CaseNumber,Branch_name__c,Account_Name__c,Proposal_Detail__c,Policy_Number__c,Creation_Date__c,Document_List__c,Vertical__c,DTF_Creation_Date__c,Effective_date_of_coverage__c,Request_Type__c,Supporting_Document__c 
    FROM Case WHERE Vertical__c='LI' AND RecordType.ID ='012O00000005BMS' AND created_date__c=true ];
        
//customerObj = [select id, Name, Complete_Status__c, Branch_name__c,Branch__r.Name , Creation_Date__c, Document_List__c, Vertical__c, Status__c, DTF_Creation_Date__c, Effective_date_of_coverage__c, Policy_No__c, proposal_Application_no__c, proposal_Name__c, Request_Type__c, Request_Type_new_del__c, Branch__c, Supporting_Document_del__c, OwnerId from POSDetails__c where (Vertical__c = 'LI'and Branch__r.Name =:branchcode)];
system.debug('test query branch:'+branchcode);
system.debug('test query customerObj:'+customerObj );

    }
    
    public GenerateDtfCase() {
      
    } 

}
Hi,

I want to create a button through which I will upload a image in a standard page layout.Is it possible.Please help
I have written a validation rule but it is not working.Please help.

(ISCHANGED(Date_of_Birth__c)) &&($User.ProfileId<>'00e90000001TW6p')

DOB cannot be change other than system admin.
Hi,

I have created on vf page report but when I am click on run button the filter is not working.Please help.

Controller

public class EmpMasterReport
{

    public PageReference EmpList() {
        return null;
    }
    public Employee_Master__c getemp()
    {
      return emp;
    }
   public  Employee_Master__c emp=new Employee_Master__c (); 
   public Transient Date datename{set;get;}  
   public List<Employee_Master__c> EmpList {get;set;}
   public List<Employee_Master__c> PDF_EmpList = new List<Employee_Master__c>();
   public List<Employee_Master__c> getPDF_EmpList(){return PDF_EmpList;}
   public string str{get;set;}
   public date dt;
   
    public EmpMasterReport(ApexPages.StandardController stdController) 
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
        
    }
    
    public EmpMasterReport()
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
         
        //PDF_EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM 
        //Employee_Master__c where Active__c=true and Photo__c !=null and Date_Of_Birth__c =: datename];
        
        //system.debug(' PDF_EmpList '+ PDF_EmpList);
    }
    
     public void run()
    {
        //EmpList = new     List<Employee_Master__c>();
        //EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
        try
        {
        date dt=emp.Date_Of_Birth__c;
        EmpList =new list<Employee_Master__c>();
        EmpList= [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM 
        Employee_Master__c where Active__c=true and Photo__c !=null and Date_Of_Birth__c =:dt];
        }
        catch(exception e)
        {
         str=e.getmessage()+e.getlinenumber();
        }
        
        
        system.debug(' PDF_EmpList '+ EmpList);
    }
    
    
    Public pageReference exportReport()
    {
        //pageReference newPage;
        String Br='EmpMasterReport';
        
        system.debug(' datename '+ datename);
        
        PDF_EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM 
        Employee_Master__c where Active__c=true and Photo__c !=null and Date_Of_Birth__c =: datename];
        
        system.debug(' PDF_EmpList '+ PDF_EmpList);
        
        /*if(datename==null)
        {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO,'Please select the Date');
            ApexPages.addMessage(myMsg);
            
        }else
        {*/
            //newPage = new pageReference('/apex/EmpMasterReport_PdfDownloader');
            
            /*Blob pdfpageblob;
            pdfpageblob = newpage.getcontentAsPdf();
            
            Attachment a = new Attachment();
            a.Body = pdfpageblob;
            insert a;*/
        //}
        pageReference newPage = new pageReference('/apex/EmpMasterReport_PdfDownloader');
        newPage.setredirect(true);
        return newPage;
        //return null;
    }
    
    public pageReference pdfreport(){
        system.debug('FSAF');
        pageReference newPage = new pageReference('/apex/EmpMasterReport_PdfDownloader');
        newPage.setredirect(true);
        return newPage;
    }
   
}

vf page
<apex:page id="p1" docType="html-5.0" standardController="Employee_Master__c" extensions="EmpMasterReport" sidebar="false" showHeader="false" cache="true">

<apex:form id="frmid">
<apex:pagemessages ></apex:pagemessages>
<apex:pageBlock title="Employee Master Details" id="Emp_Master">
&nbsp;As On: &nbsp; &nbsp;&nbsp; <apex:input type="date" value="{!datename}"/>
&nbsp; &nbsp;&nbsp; <apex:commandButton Value="Run" action="{!run}" status="generateid" reRender="frmid"/>
<apex:commandButton value="Export As PDF" action="{!exportReport}" status="generateid" reRender="pageid"/> <apex:actionStatus id="actionid" startText="Please Wait...."> </apex:actionStatus>
<apex:pageBlockTable value="{! EmpList }" var="em" border="2"> <apex:column value="{!em.Name}"/>
<apex:column value="{!em.Address__c}"/>
<apex:column value="{!em.Date_Of_Birth__c}"/> <apex:column value="{!em.Date_Of_Joining__c}"/>
<apex:column value="{!em.Date_of_Leaving__c}"/>
<apex:column value="{!em.Thumbnail__c}"/> </apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Hi,

I want to create a button which will generate my vf page report as PDF.

Controller

public class EmpMasterReport
{
   public List<Employee_Master__c> EmpList {get;set;}
   
    public EmpMasterReport(ApexPages.StandardController stdController) 
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
    
    public EmpMasterReport()
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
   
}

vf Page

<apex:page id="p1" standardController="Employee_Master__c" extensions="EmpMasterReport" sidebar="false" showHeader="false" cache="true">

<apex:form >
<apex:pageBlock title="Employee Master Details" id="Emp_Master">
<apex:pageBlockTable value="{! EmpList }" var="em" border="2">
<apex:column value="{!em.Name}"/>
<apex:column value="{!em.Address__c}"/>
<apex:column value="{!em.Date_Of_Birth__c}"/>
<apex:column value="{!em.Date_Of_Joining__c}"/>
<apex:column value="{!em.Date_of_Leaving__c}"/>
<apex:column value="{!em.Thumbnail__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Please note I cannot use "renderas=pdf".Please help.