• Hoysala
  • NEWBIE
  • 70 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 31
    Questions
  • 25
    Replies
global class DS_CallsStatusUpdate implements Database.Batchable<sObject>,Schedulable
{
    global Database.queryLocator start(Database.BatchableContext bc)
{
        return Database.getQueryLocator('SELECT Id,OCE__Account__c,OCE__CallDateTime__c,OCE__Status__c FROM OCE__Call__c WHERE OCE__Status__c =\'draft\' AND OCE__CallDateTime__c<LAST_N_DAYS:2');
}
 global void execute(Database.BatchableContext bc, List<OCE__Call__c> scope)
    {
        List<OCE__Call__c> callLst = new List<OCE__Call__c>();
        for(OCE__Call__c ca : scope)
        { 
            ca.OCE__Status__c = 'Submitted';
            callLst.add(ca);
        }   
        system.debug('calls--'+callLst);
        UPDATE callLst; 
    }

 
public class DS_ExpenseNoteTrigger_Handler {
    public static void checkExpenseNoteOverlapNew(list<DS_Expense_Note__c> listNewExpenseNotes){
        Set<String> setExistingExpensePeriodId = new set<String>();
        for(DS_Expense_Note__c thisExpense : [select Id,DS_Period_Information__c,CreatedbyId from DS_Expense_Note__c where CreatedbyId =:UserInfo.getUserId()]){
            setExistingExpensePeriodId.add(thisExpense.DS_Period_Information__c);
        }
        
        for(DS_Expense_Note__c thisExpenseNote : listNewExpenseNotes){
            if(setExistingExpensePeriodId.contains(thisExpenseNote.DS_Period_Information__c)){
                thisExpenseNote.addError(Label.DS_ExpenseNote_Validation);
            }
        }
    }
    
}
VF Page

<apex:page standardController="NICE_ratings_cutoff_points__c" extensions="AddMultipleRatings">
    <apex:form id="theForm">
        <apex:pageMessages ></apex:pageMessages>
        <apex:pageblock id="thePB" title="Creating Multiple Ratings">
            <apex:pageblockButtons >
                <apex:commandButton value="Save" action="{!SaveMultipleRatings}"/>
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
                
            </apex:pageblockButtons>
            
            <apex:outputPanel id="ratingsHead">
                <apex:variable value="{!0}" var="rowNum"/>  
                <apex:pageBlockSection columns="1" title="Adding Multiple Ratings CutOff Points" id="thePbs" collapsible="False"> 
                    
                    <apex:pageBlockTable value="{!wcRatingsList}" var="eachRecord"> 
                        
                        <apex:column headerValue="Action">
                            <apex:commandLink value="Remove" style="color:red" action="{!removeRowFromRatingsList}" rendered="{!rowNum > -1}" rerender="ratingsHead" immediate="true" >
                                <apex:param value="{!rowNum}" name="rowToRemove" assignTo="{!rowToRemove}"/>
                            </apex:commandLink>
                            <apex:variable var="rowNum" value="{!rowNum + 1}"/>
                        </apex:column>
                        
                        <apex:column headerValue="Country">
                            <apex:inputField value="{!eachRecord.niceRatings.Country__c}" required="true"/>
                        </apex:column>
                        
                        <apex:column headerValue="Ratings">
                            <apex:inputField value="{!eachRecord.niceRatings.Rating__c}" required="true"/>
                        </apex:column>
                        
                        
                        <apex:column headerValue="Sub Ratings">
                            <apex:inputfield value="{!eachRecord.niceRatings.Sub_Rating__c}"/>
                        </apex:column>
                        
                        <apex:column headerValue="Value">
                            <apex:inputField value="{!eachRecord.niceRatings.Value__c}" required="true"/>
                        </apex:column>   
                        
                    </apex:pageBlockTable>
                </apex:pageBlockSection>
                <apex:commandButton value="Add More" action="{!addNewRowToRatingsList}" rerender="ratingsHead" Status="status" immediate="true" />
                
            </apex:outputPanel>
            
        </apex:pageblock>
    </apex:form>   
</apex:page>

 
public with sharing class AccController
{

    

    public list <account> acc {get;set;} 
    public string searchstring {get;set;} 
    Public Boolean ShowCreateBlock{get;set;}
    public Boolean ShowBlock{get;set;}
    Public Boolean DisplaySearchResults{get;set;}
    public Account account{get;set;}
    Public Account NewAccountRecord{get;set;}
    
    
    
    public AccController()
    {
        ShowCreateBlock = false;
        ShowBlock=True;
        DisplaySearchResults = false;
        NewAccountRecord= New Account(Name='Test');
        
    }
    
    public String getAccount()
    {
        return null;
    }
    
    
    public String options { get; set; }
    
    public PageReference executeSearch() {
        return null;
    }
    public list<account> showList = new list<account>([select Name, Email__c,Phone from Account]);
    Public list<account> getshowList()
    {
        
        return showList;
    }
    
    
    public PageReference create()
    {
        return null;
    }
    
    public pagereference search()
    { 
        string searchquery='select name,id from account where name like \'%'+searchstring+'%\' Limit 20'; 
        acc= Database.query(searchquery);
        DisplaySearchResults =true;
        if(acc.size()==0)
        {
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'account not found'));
            ShowCreateBlock = true; 
            ShowBlock=False;
        }
        return null;
    }
    public void clear()
    { 
        acc.clear(); 
    } 
    Public pagereference saveRecord()
    {
        acc=[select id,email__c from Account];
        for(Account a : acc)
        {
            if(NewAccountRecord.Email__c==a.Email__C)
            {
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Email is already exist'));
                return null;
            }
        }
        if(ApexPages.hasMessages()==false)
            {
                insert NewAccountRecord;
                pagereference  pageRef = new pagereference('/'+NewAccountRecord.Id);
                return pageRef ; 
            } 
        return null; 
        }
         public List<SelectOption> getItems() {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('10','10'));
            options.add(new SelectOption('20','20'));
            options.add(new SelectOption('30','30'));
              options.add(new SelectOption('40','40'));
            return options;
        }
    }
 
<apex:page Controller="AccController"  showHeader="true" tabStyle="account" >
    <apex:form > 
    <apex:pageMessages ></apex:pageMessages>
    <apex:pageblock title="New Account" id="CreateRecordBlock" Rendered="{!ShowCreateBlock}">
        <apex:pageblockSection >
       <apex:inputField value="{!NewAccountRecord.Name}"/>
            <apex:inputField value="{!NewAccountRecord.Phone}"/>  
            <apex:inputField value="{!NewAccountRecord.Email__c}"/>  
        </apex:pageblockSection>
        <apex:pageblockButtons >
        <apex:commandButton value="saveAccount" action="{!saveRecord}"/>
        </apex:pageblockButtons>
    </apex:pageblock>
    
    <apex:pageBlock id="SearchBlock" Rendered="{!ShowBlock}">
        <apex:inputText value="{!searchstring}" label="Input"/> 
        <apex:commandButton value="Search records" action="{!search}" /> 
        <apex:commandButton value="Clear records" action="{!clear}"/> 
       <!-- <apex:commandButton value="Create account" action="{!create}"/>-->
        <apex:pageBlock title="Search Result" id="resBlock" rendered="{!DisplaySearchResults}">
        <apex:actionSupport event="onchange" reRender="Account"/> 
        <apex:pageblockTable value="{!acc}" var="a"> 
        <apex:column value="{!a.name}"/> 
        <apex:column value="{!a.id}"/>
         </apex:pageBlockTable>
    </apex:pageBlock>
   
    
    <apex:pageBlock >
        <apex:inputField value="{!Account.Type}"/>
        <apex:pageBlockTable value="{!showList}" var="a">
         <apex:column headerValue="Account Name">
        <apex:outputLink value="/{!a.id}">{!a.name}</apex:outputLink>
        </apex:column>
        <apex:column headerValue="Account Phone" value="{!a.Phone}"/>
        <apex:column headerValue="Account Email" value="{!a.Email__c}"/>
        
        <apex:CommandButton action="{!executeSearch}" value="Search"/>
         
        <apex:selectList >
        <apex:selectOptions value="{!options}"/>
        </apex:selectList>
        </apex:pageBlockTable>
    </apex:pageBlock>
    
    
    </apex:pageBlock>
    </apex:form>
</apex:page>

 
<apex:page Controller="AccController"  showHeader="true" tabStyle="account" >
    <apex:form > 
    <apex:pageMessages ></apex:pageMessages>
    <apex:pageblock title="New Account" id="CreateRecordBlock" Rendered="{!ShowCreateBlock}">
        <apex:pageblockSection >
       <apex:inputField value="{!NewAccountRecord.Name}"/>
            <apex:inputField value="{!NewAccountRecord.Phone}"/>  
            <apex:inputField value="{!NewAccountRecord.Email__c}"/>  
        </apex:pageblockSection>
        <apex:pageblockButtons >
        <apex:commandButton value="saveAccount" action="{!saveRecord}"/>
        </apex:pageblockButtons>
    </apex:pageblock>
    
    <apex:pageBlock id="SearchBlock" Rendered="{!ShowBlock}">
        <apex:inputText value="{!searchstring}" label="Input"/> 
        <apex:commandButton value="Search records" action="{!search}" /> 
        <apex:commandButton value="Clear records" action="{!clear}"/> 
       <!-- <apex:commandButton value="Create account" action="{!create}"/>-->
        <apex:pageBlock title="Search Result" id="resBlock" rendered="{!DisplaySearchResults}">
        <apex:actionSupport event="onchange" reRender="Account"/> 
        <apex:pageblockTable value="{!acc}" var="a"> 
        <apex:column value="{!a.name}"/> 
        <apex:column value="{!a.id}"/>
         </apex:pageBlockTable>
    </apex:pageBlock>
   
    
    <apex:pageBlock >
        <apex:inputField value="{!Account.Type}"/>
        <apex:pageBlockTable value="{!showList}" var="a">
         <apex:column headerValue="Account Name">
        <apex:outputLink value="/{!a.id}">{!a.name}</apex:outputLink>
        </apex:column>
        <apex:column headerValue="Account Phone" value="{!a.Phone}"/>
        <apex:column headerValue="Account Email" value="{!a.Email__c}"/>
        
        <apex:CommandButton action="{!executeSearch}" value="Search"/>
         
        <apex:selectList >
        <apex:selectOptions value="{!options}"/>
        </apex:selectList>
        </apex:pageBlockTable>
    </apex:pageBlock>
    
    
    </apex:pageBlock>
    </apex:form>
</apex:page>
public with sharing class AccController
{
    public list <account> acc {get;set;} 
    public string searchstring {get;set;} 
    Public Boolean ShowCreateBlock{get;set;}
    public Boolean ShowBlock{get;set;}
    Public Boolean DisplaySearchResults{get;set;}
    public Account account{get;set;}
    Public Account NewAccountRecord{get;set;}
    
    public AccController()
    {
        ShowCreateBlock = false;
        ShowBlock=True;
        DisplaySearchResults = false;
        NewAccountRecord= New Account(Name='Test');
        
    }
    
    public String getAccount()
    {
        return null;
    }
    
    
    public String options { get; set; }
    
    public PageReference executeSearch() {
        return null;
    }
    public list<account> showList = new list<account>([select Name, Email__c,Phone from Account]);
    Public list<account> getshowList()
    {
        
        return showList;
    }
    
    
    public PageReference create()
    {
        return null;
    }
    
    public pagereference search()
    { 
        string searchquery='select name,id from account where name like \'%'+searchstring+'%\' Limit 20'; 
        acc= Database.query(searchquery);
        DisplaySearchResults =true;
        if(acc.size()==0)
        {
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'account not found'));
            ShowCreateBlock = true; 
            ShowBlock=False;
        }
        return null;
    }
    public void clear()
    { 
        acc.clear(); 
    } 
    Public pagereference saveRecord(){
        insert NewAccountRecord;
        pagereference  pageRef = new pagereference('/'+NewAccountRecord.Id);
        return pageRef ;
    }
}

 
public with sharing class AccController
{
    public list <account> acc {get;set;} 
    public string searchstring {get;set;} 
    Public Boolean ShowCreateBlock{get;set;}
    public Boolean ShowBlock{get;set;}
    Public Boolean DisplaySearchResults{get;set;}
    public Account account{get;set;}
    Public Account NewAccountRecord{get;set;}
    
    public AccController()
    {
        ShowCreateBlock = false;
        ShowBlock=True;
        DisplaySearchResults = false;
        NewAccountRecord= New Account();
         
    }

    public String getAccount()
    {
        return null;
    }


    public String options { get; set; }

    public PageReference executeSearch() {
        return null;
    }
    public list<account> showList = new list<account>([select Name, Email__c,Phone from Account]);
    Public list<account> getshowList()
    {
        
        return showList;
    }
   
  
    public PageReference create()
    {
        return null;
    }

    public pagereference search()
    { 
        string searchquery='select name,id from account where name like \'%'+searchstring+'%\' Limit 20'; 
        acc= Database.query(searchquery);
        DisplaySearchResults =true;
        if(acc.size()==0)
        {
          ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'account not found'));
          ShowCreateBlock = true; 
          ShowBlock=False;
        }
        return null;
    }
    public void clear()
    { 
    acc.clear(); 
    } 
    Public pagereference saveRecord(){
        insert NewAccountRecord;
        pagereference  pageRef = new pagereference('/'+NewAccountRecord.Id);
        return pageRef ;
    }
}

 
public class DS_ExpenseNoteTrigger_Handler {
    public static void checkExpenseNoteOverlapNew(list<DS_Expense_Note__c> listNewExpenseNotes){
        Set<String> setExistingExpensePeriodId = new set<String>();
        for(DS_Expense_Note__c thisExpense : [select Id,DS_Period_Information__c,CreatedbyId from DS_Expense_Note__c where CreatedbyId =:UserInfo.getUserId()]){
            setExistingExpensePeriodId.add(thisExpense.DS_Period_Information__c);
        }
        
        for(DS_Expense_Note__c thisExpenseNote : listNewExpenseNotes){
            if(setExistingExpensePeriodId.contains(thisExpenseNote.DS_Period_Information__c)){
                thisExpenseNote.addError(Label.DS_ExpenseNote_Validation);
            }
        }
    }
    
}
VF Page

<apex:page standardController="NICE_ratings_cutoff_points__c" extensions="AddMultipleRatings">
    <apex:form id="theForm">
        <apex:pageMessages ></apex:pageMessages>
        <apex:pageblock id="thePB" title="Creating Multiple Ratings">
            <apex:pageblockButtons >
                <apex:commandButton value="Save" action="{!SaveMultipleRatings}"/>
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
                
            </apex:pageblockButtons>
            
            <apex:outputPanel id="ratingsHead">
                <apex:variable value="{!0}" var="rowNum"/>  
                <apex:pageBlockSection columns="1" title="Adding Multiple Ratings CutOff Points" id="thePbs" collapsible="False"> 
                    
                    <apex:pageBlockTable value="{!wcRatingsList}" var="eachRecord"> 
                        
                        <apex:column headerValue="Action">
                            <apex:commandLink value="Remove" style="color:red" action="{!removeRowFromRatingsList}" rendered="{!rowNum > -1}" rerender="ratingsHead" immediate="true" >
                                <apex:param value="{!rowNum}" name="rowToRemove" assignTo="{!rowToRemove}"/>
                            </apex:commandLink>
                            <apex:variable var="rowNum" value="{!rowNum + 1}"/>
                        </apex:column>
                        
                        <apex:column headerValue="Country">
                            <apex:inputField value="{!eachRecord.niceRatings.Country__c}" required="true"/>
                        </apex:column>
                        
                        <apex:column headerValue="Ratings">
                            <apex:inputField value="{!eachRecord.niceRatings.Rating__c}" required="true"/>
                        </apex:column>
                        
                        
                        <apex:column headerValue="Sub Ratings">
                            <apex:inputfield value="{!eachRecord.niceRatings.Sub_Rating__c}"/>
                        </apex:column>
                        
                        <apex:column headerValue="Value">
                            <apex:inputField value="{!eachRecord.niceRatings.Value__c}" required="true"/>
                        </apex:column>   
                        
                    </apex:pageBlockTable>
                </apex:pageBlockSection>
                <apex:commandButton value="Add More" action="{!addNewRowToRatingsList}" rerender="ratingsHead" Status="status" immediate="true" />
                
            </apex:outputPanel>
            
        </apex:pageblock>
    </apex:form>   
</apex:page>

 
public with sharing class AccController
{

    

    public list <account> acc {get;set;} 
    public string searchstring {get;set;} 
    Public Boolean ShowCreateBlock{get;set;}
    public Boolean ShowBlock{get;set;}
    Public Boolean DisplaySearchResults{get;set;}
    public Account account{get;set;}
    Public Account NewAccountRecord{get;set;}
    
    
    
    public AccController()
    {
        ShowCreateBlock = false;
        ShowBlock=True;
        DisplaySearchResults = false;
        NewAccountRecord= New Account(Name='Test');
        
    }
    
    public String getAccount()
    {
        return null;
    }
    
    
    public String options { get; set; }
    
    public PageReference executeSearch() {
        return null;
    }
    public list<account> showList = new list<account>([select Name, Email__c,Phone from Account]);
    Public list<account> getshowList()
    {
        
        return showList;
    }
    
    
    public PageReference create()
    {
        return null;
    }
    
    public pagereference search()
    { 
        string searchquery='select name,id from account where name like \'%'+searchstring+'%\' Limit 20'; 
        acc= Database.query(searchquery);
        DisplaySearchResults =true;
        if(acc.size()==0)
        {
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'account not found'));
            ShowCreateBlock = true; 
            ShowBlock=False;
        }
        return null;
    }
    public void clear()
    { 
        acc.clear(); 
    } 
    Public pagereference saveRecord()
    {
        acc=[select id,email__c from Account];
        for(Account a : acc)
        {
            if(NewAccountRecord.Email__c==a.Email__C)
            {
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Email is already exist'));
                return null;
            }
        }
        if(ApexPages.hasMessages()==false)
            {
                insert NewAccountRecord;
                pagereference  pageRef = new pagereference('/'+NewAccountRecord.Id);
                return pageRef ; 
            } 
        return null; 
        }
         public List<SelectOption> getItems() {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('10','10'));
            options.add(new SelectOption('20','20'));
            options.add(new SelectOption('30','30'));
              options.add(new SelectOption('40','40'));
            return options;
        }
    }
 
<apex:page Controller="AccController"  showHeader="true" tabStyle="account" >
    <apex:form > 
    <apex:pageMessages ></apex:pageMessages>
    <apex:pageblock title="New Account" id="CreateRecordBlock" Rendered="{!ShowCreateBlock}">
        <apex:pageblockSection >
       <apex:inputField value="{!NewAccountRecord.Name}"/>
            <apex:inputField value="{!NewAccountRecord.Phone}"/>  
            <apex:inputField value="{!NewAccountRecord.Email__c}"/>  
        </apex:pageblockSection>
        <apex:pageblockButtons >
        <apex:commandButton value="saveAccount" action="{!saveRecord}"/>
        </apex:pageblockButtons>
    </apex:pageblock>
    
    <apex:pageBlock id="SearchBlock" Rendered="{!ShowBlock}">
        <apex:inputText value="{!searchstring}" label="Input"/> 
        <apex:commandButton value="Search records" action="{!search}" /> 
        <apex:commandButton value="Clear records" action="{!clear}"/> 
       <!-- <apex:commandButton value="Create account" action="{!create}"/>-->
        <apex:pageBlock title="Search Result" id="resBlock" rendered="{!DisplaySearchResults}">
        <apex:actionSupport event="onchange" reRender="Account"/> 
        <apex:pageblockTable value="{!acc}" var="a"> 
        <apex:column value="{!a.name}"/> 
        <apex:column value="{!a.id}"/>
         </apex:pageBlockTable>
    </apex:pageBlock>
   
    
    <apex:pageBlock >
        <apex:inputField value="{!Account.Type}"/>
        <apex:pageBlockTable value="{!showList}" var="a">
         <apex:column headerValue="Account Name">
        <apex:outputLink value="/{!a.id}">{!a.name}</apex:outputLink>
        </apex:column>
        <apex:column headerValue="Account Phone" value="{!a.Phone}"/>
        <apex:column headerValue="Account Email" value="{!a.Email__c}"/>
        
        <apex:CommandButton action="{!executeSearch}" value="Search"/>
         
        <apex:selectList >
        <apex:selectOptions value="{!options}"/>
        </apex:selectList>
        </apex:pageBlockTable>
    </apex:pageBlock>
    
    
    </apex:pageBlock>
    </apex:form>
</apex:page>

 
<apex:page Controller="AccController"  showHeader="true" tabStyle="account" >
    <apex:form > 
    <apex:pageMessages ></apex:pageMessages>
    <apex:pageblock title="New Account" id="CreateRecordBlock" Rendered="{!ShowCreateBlock}">
        <apex:pageblockSection >
       <apex:inputField value="{!NewAccountRecord.Name}"/>
            <apex:inputField value="{!NewAccountRecord.Phone}"/>  
            <apex:inputField value="{!NewAccountRecord.Email__c}"/>  
        </apex:pageblockSection>
        <apex:pageblockButtons >
        <apex:commandButton value="saveAccount" action="{!saveRecord}"/>
        </apex:pageblockButtons>
    </apex:pageblock>
    
    <apex:pageBlock id="SearchBlock" Rendered="{!ShowBlock}">
        <apex:inputText value="{!searchstring}" label="Input"/> 
        <apex:commandButton value="Search records" action="{!search}" /> 
        <apex:commandButton value="Clear records" action="{!clear}"/> 
       <!-- <apex:commandButton value="Create account" action="{!create}"/>-->
        <apex:pageBlock title="Search Result" id="resBlock" rendered="{!DisplaySearchResults}">
        <apex:actionSupport event="onchange" reRender="Account"/> 
        <apex:pageblockTable value="{!acc}" var="a"> 
        <apex:column value="{!a.name}"/> 
        <apex:column value="{!a.id}"/>
         </apex:pageBlockTable>
    </apex:pageBlock>
   
    
    <apex:pageBlock >
        <apex:inputField value="{!Account.Type}"/>
        <apex:pageBlockTable value="{!showList}" var="a">
         <apex:column headerValue="Account Name">
        <apex:outputLink value="/{!a.id}">{!a.name}</apex:outputLink>
        </apex:column>
        <apex:column headerValue="Account Phone" value="{!a.Phone}"/>
        <apex:column headerValue="Account Email" value="{!a.Email__c}"/>
        
        <apex:CommandButton action="{!executeSearch}" value="Search"/>
         
        <apex:selectList >
        <apex:selectOptions value="{!options}"/>
        </apex:selectList>
        </apex:pageBlockTable>
    </apex:pageBlock>
    
    
    </apex:pageBlock>
    </apex:form>
</apex:page>
public with sharing class AccController
{
    public list <account> acc {get;set;} 
    public string searchstring {get;set;} 
    Public Boolean ShowCreateBlock{get;set;}
    public Boolean ShowBlock{get;set;}
    Public Boolean DisplaySearchResults{get;set;}
    public Account account{get;set;}
    Public Account NewAccountRecord{get;set;}
    
    public AccController()
    {
        ShowCreateBlock = false;
        ShowBlock=True;
        DisplaySearchResults = false;
        NewAccountRecord= New Account();
         
    }

    public String getAccount()
    {
        return null;
    }


    public String options { get; set; }

    public PageReference executeSearch() {
        return null;
    }
    public list<account> showList = new list<account>([select Name, Email__c,Phone from Account]);
    Public list<account> getshowList()
    {
        
        return showList;
    }
   
  
    public PageReference create()
    {
        return null;
    }

    public pagereference search()
    { 
        string searchquery='select name,id from account where name like \'%'+searchstring+'%\' Limit 20'; 
        acc= Database.query(searchquery);
        DisplaySearchResults =true;
        if(acc.size()==0)
        {
          ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'account not found'));
          ShowCreateBlock = true; 
          ShowBlock=False;
        }
        return null;
    }
    public void clear()
    { 
    acc.clear(); 
    } 
    Public pagereference saveRecord(){
        insert NewAccountRecord;
        pagereference  pageRef = new pagereference('/'+NewAccountRecord.Id);
        return pageRef ;
    }
}