• Nisar799
  • NEWBIE
  • 245 Points
  • Member since 2015
  • Salesforce Developer | Consultant


  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 1
    Questions
  • 22
    Replies
Can I assume that every SObject will have a name field as the minimum ?
trigger updateaccount on Contact (after update) {
    map<id,contact> conmap = trigger.newmap;
    set<id> allconids = conmap.keySet();
    list<account> acclist = [select id,phone from account where id in: allconids];
    for (account acc : acclist){
        
       acc.Phone = conmap.get(acc.Id).phone;
    }
update acclist;
I have impletemened account insert page, with custom controller. 
Here is the code for custom controller : 

public class AccountInsertPageCustomCtrl {
    public Account acc{get; set;}
    
    public  AccountInsertPageCustomCtrl(){
        acc = new Account();
    }
    
    public PageReference Save(){
        if(acc != null){
            insert acc;
        }
        PageReference pg = new PageReference('/'+acc.Id);
        pg.setRedirect(true);
        return pg;
    }
    public PageReference SaveAndNew(){
        if(acc != null){
            insert acc;
        }
        PageReference pg = new PageReference('/001/e?retURL=%2F0016F00002CaaO4');
        pg.setRedirect(true);
        return pg;
    }
    public PageReference Cancel(){
        
        //PageReference pg = new PageReference('/001/o');
        //pg.setRedirect(true);
        return null;
    }
}

Scenario : when I open the VF Enter the required fields, and without clicking on Save and Save&New button, if I click on Cancel, its working fine. as per I have mentioned in the code. but when I do not enter anything, its showing me validation error for Account name ? how can I make it work? I mean, on clicking on Cancel, it must redirect to the All accounts page. 
Hello,

I have a vf code like below
<apex:outputText value="{!caseObj.Asset.SerialNumber}"/>
Serial number is a standard field Text(80)

I want to disply first 8 characters on one line and the rest characters on other line, like below
 
A0123456
789105SDFDS

How can i achieve it with minimal code.

thanks for suggestions
 
  • February 21, 2017
  • Like
  • 0
Greetings all, I am adding a system.debug in my trigger and noticed that the values when running a debug are returing null.

My code is listed as 
 
 system.debug(mte.Service_Member__r.FirstName + ' and ' + mte.Lead_Supervisor__r.LastName + ' will be getting their member term evaluation on ' + mte.Date_of_Review__c.format() + 
                            ' for member term ' + mte.Member_Term__c);

The output appears as 

null and null will be getting their member term evaluation on 1/25/17 for member term a0Ig0000007iekyEAA

My goal is to get the output to appear as a value rather than null, the trigger works nicely no less, but still.

Hope it helps.

Joe and Jane will be getting their member term evaluation of 

Hi,

I am trying to send an email where I include certain values from a customObj1. I noticed that when I insert the field "Start_Date__c" (type is Date) into the email body, then the field renders as "2015-08-12 00:00:00". This is not what I want.

How can I include a Date field that will output as "MM/DD/YYYY" (or MM-DD-YYY) in an email that is sent from an apex classes?
  • November 25, 2015
  • Like
  • 0
Hi,

I am using an apex trigger to create events that are based on the campaign start date. So when the campaign start date changes, i want to update the events and only when the start date changes. 

What is the best way to check if the start date field value changed? I am having difficulty finding a good way to compare the date fields prior and current values. 
  • November 24, 2015
  • Like
  • 0
I want to get Default new user license  of customer portal in apex code. how can i get default new user license or default new profile of the portal in apex code ?
Can I assume that every SObject will have a name field as the minimum ?
Hi All,

I am iserting contact record in my class. I need to check if all the fields are updateble and then i will upsert the record. I have written the following code but it is not working. Kindly provide me solution.
 
if (Schema.sObjectType.Contact.isUpdateable()){
            	   	   contact.FirstName = firstname;
            	   	   contact.LastName = lastname;
            	   	   contact.Email = emailaddress;
            	   	   contact.Email_Alt_1__c = altemail1;
            	       contact.Email_Alt_2__c = altemail2;
            	       contact.MailingStreet = street;
            	       contact.MailingCity = city;
            	       contact.MailingPostalCode = postalCode;
            	       if (country == 'United States') {
            	           contact.MailingState = stateprovince;
            	       } else {
            	       	   contact.MailingState = '';
            	       }
            	       contact.MailingCountry = country;
            	       contact.Country__c = regioncountry;
            	       //contact.Audience__c = audience;
            	       contact.Cisco_com_Login__c = ciscocomlogin;
            	       contact.Testing_ID__c = testingid;
            	       contact.Cisco_ID_CSCO__c = ciscoid;
            	       contact.Area_Code__c = Integer.valueOf(areaCode.trim());
            	       contact.Country_Code__c = countryCode;
            	       contact.Phone = phonenumber;
            	       contact.Fax = faxPhone;
                       
            	       contact.HomePhone = homePhone;
            	       upsert contact;
                       }

 
trigger updateaccount on Contact (after update) {
    map<id,contact> conmap = trigger.newmap;
    set<id> allconids = conmap.keySet();
    list<account> acclist = [select id,phone from account where id in: allconids];
    for (account acc : acclist){
        
       acc.Phone = conmap.get(acc.Id).phone;
    }
update acclist;
I have impletemened account insert page, with custom controller. 
Here is the code for custom controller : 

public class AccountInsertPageCustomCtrl {
    public Account acc{get; set;}
    
    public  AccountInsertPageCustomCtrl(){
        acc = new Account();
    }
    
    public PageReference Save(){
        if(acc != null){
            insert acc;
        }
        PageReference pg = new PageReference('/'+acc.Id);
        pg.setRedirect(true);
        return pg;
    }
    public PageReference SaveAndNew(){
        if(acc != null){
            insert acc;
        }
        PageReference pg = new PageReference('/001/e?retURL=%2F0016F00002CaaO4');
        pg.setRedirect(true);
        return pg;
    }
    public PageReference Cancel(){
        
        //PageReference pg = new PageReference('/001/o');
        //pg.setRedirect(true);
        return null;
    }
}

Scenario : when I open the VF Enter the required fields, and without clicking on Save and Save&New button, if I click on Cancel, its working fine. as per I have mentioned in the code. but when I do not enter anything, its showing me validation error for Account name ? how can I make it work? I mean, on clicking on Cancel, it must redirect to the All accounts page. 
This error seems to be an odd one in that seems to happen when loading a visualforce page first time each day. This page is accessed from a community portal. Subsequent attempts to access the page loads fine, its only the first time each day that we have noticed this.
 
System.VisualforceException : Dependent class is invalid and needs recompilation: Class ClassName : SELECT AccountId, Account.RecordType.Name FROM User ^ERROR at Row:1:Column:19Didn't understand relationship 'Account' in field path.

We tried saving the class here but there are no compilation errors.

Anyone faced seomthing like this before?

Hi, community

After setting up integration between Marketing Cloud and Sales cloud we configured some Triggered Send definitions, that send emails to Contacts/Leads. Now, we need to add custom field Work_Email__c on Contact and send address verification email if Work_Email__c is changed to NOT NULL. In Triggered Send, it is not possible to select this field as the recipient's address. We are trying to achieve this using Journey Builder and Salesforce Data Events, but we cannot find appropriate Data Source :

User-added image
Is there a way to solve this issue?

Thanks

Hello,

I have a vf code like below
<apex:outputText value="{!caseObj.Asset.SerialNumber}"/>
Serial number is a standard field Text(80)

I want to disply first 8 characters on one line and the rest characters on other line, like below
 
A0123456
789105SDFDS

How can i achieve it with minimal code.

thanks for suggestions
 
  • February 21, 2017
  • Like
  • 0
Greetings all, I am adding a system.debug in my trigger and noticed that the values when running a debug are returing null.

My code is listed as 
 
 system.debug(mte.Service_Member__r.FirstName + ' and ' + mte.Lead_Supervisor__r.LastName + ' will be getting their member term evaluation on ' + mte.Date_of_Review__c.format() + 
                            ' for member term ' + mte.Member_Term__c);

The output appears as 

null and null will be getting their member term evaluation on 1/25/17 for member term a0Ig0000007iekyEAA

My goal is to get the output to appear as a value rather than null, the trigger works nicely no less, but still.

Hope it helps.

Joe and Jane will be getting their member term evaluation of 

I am looking for the best way to accomplish updating Campaign Members Custom Field when an Event is added to the Campaign.
I don;t think its possible with process flow.  Any Trigger examples would be greatly appreciated.
  • November 30, 2015
  • Like
  • 0
Hi,

I am trying to send an email where I include certain values from a customObj1. I noticed that when I insert the field "Start_Date__c" (type is Date) into the email body, then the field renders as "2015-08-12 00:00:00". This is not what I want.

How can I include a Date field that will output as "MM/DD/YYYY" (or MM-DD-YYY) in an email that is sent from an apex classes?
  • November 25, 2015
  • Like
  • 0
Hi,

I am using an apex trigger to create events that are based on the campaign start date. So when the campaign start date changes, i want to update the events and only when the start date changes. 

What is the best way to check if the start date field value changed? I am having difficulty finding a good way to compare the date fields prior and current values. 
  • November 24, 2015
  • Like
  • 0
Hi all,

looking for Apex syntax how to open a VisualForce page
ie :
 if (field==Case1)
{open visualForce1}
 if (field==Case2)
{open visualForce2}

Many thaks for your assistance.
I have wriiten a test class for an apex class which have a wrapper class.In the test class the wrapper class lines are not covered.Please help me out!
My apex class:
public with sharing class Rfleet_Dashboard_DeliveriesYear {

public Rfleet_Dashboard_DeliveriesYear(ApexPages.StandardController controller) {

  
   
System.Debug('>>>>>>>>>>>>>a value --> ' +selcoun);

recentdate=[SELECT Current_month__c FROM IKAM_Data__c where Current_month__c != null order by  Current_month__c Desc limit 1].Current_month__c ;
system.debug('date<<<<<<<<<'+recentdate.day());
recentyear=recentdate.year();
recentmonth=recentdate.month();


If(recentmonth==1){mOnthName='January';}
 else if(recentmonth==2){mOnthName='February';}
  else if(recentmonth==3){mOnthName='March';}
   else if(recentmonth==4){mOnthName='April';}
    else if(recentmonth==5){mOnthName='May';}
     else if(recentmonth==6){mOnthName='June';}
      else if(recentmonth==7){mOnthName='July';}
       else if(recentmonth==8){mOnthName='August';}
        else if(recentmonth==9){mOnthName='Sepetember';}
         else if(recentmonth==10){mOnthName='October';}
          else if(recentmonth==11){mOnthName='November';}
           else if(recentmonth==12){mOnthName='December';}
            else{}

france=false;
    europe=false;
    eurasia=false;
    asia=false;
    AMI=false;
    america=false;

    allcountry=true;
    }
 public String mOnthName{get;set;}
public Integer recentyear{get;set;}
public Integer recentmonth{get;set;}  
public boolean america{get;set;}
public boolean allcountry {get;set;}
public boolean AMI{get;set;}
public boolean asia{get;set;}
public boolean eurasia{get;set;}
public boolean europe{get;set;}
public boolean france{get;set;}
public string selcoun{get;set;} 
public Date recentdate{get;set;} 


public String getcont() {return selcoun;}

 
public class Month {
    public Decimal year {get; set;}
    public Decimal volume{get; set;}
    Month(Decimal year,Decimal volume) {this.year = year;this.volume= volume;}
}

public Month[] getMonths() {
    Month[] months = new Month[] {};
    System.Debug('>>>>>>>>>>>>>insid getmonths--> ' +selcoun);
    for (AggregateResult ar : [

SELECT sum( IKAM_Data__r.Countries_delivered_volume__c)Dvol,CALENDAR_YEAR(IKAM_Data__r.Current_month__c)Year FROM Country_DCVF_Volume__c  group by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) order by CALENDAR_YEAR(IKAM_Data__r.Current_month__c)]) {
    months.add(new Month((Decimal )ar.get('Year'),(Decimal)ar.get('Dvol')));
    }
    system.debug('------->'+months);
    return months;
}  

      
      
    public class Month1 {
    public Decimal year {get; set;}
    public Decimal volume{get; set;}
    Month1(Decimal year,Decimal volume) {this.year = year;this.volume= volume;}
}

public Month[] getMonths1() {
    Month[] months1 = new Month[] {};
      System.Debug('>>>>>>>>>>>>>insid getmonths1--> ' +selcoun);
    for (AggregateResult ar : [SELECT sum( IKAM_Data__r.Countries_delivered_volume__c)Dvol,CALENDAR_YEAR(IKAM_Data__r.Current_month__c)Year FROM Country_DCVF_Volume__c where region__c='americas' group by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) order by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) ]) {                                        
    months1.add(new Month((Decimal )ar.get('Year'),(Decimal)ar.get('Dvol')));
    }
    system.debug('------->'+months1);
    return months1;
} 

 public class Month2{
    public Decimal year {get; set;}
    public Decimal volume{get; set;}
    Month2(Decimal year,Decimal volume) {this.year = year;this.volume= volume;}
}

public Month[] getMonths2() {
    Month[] months2 = new Month[] {};
      System.Debug('>>>>>>>>>>>>>insid getmonths1--> ' +selcoun);
    for (AggregateResult ar : [SELECT sum( IKAM_Data__r.Countries_delivered_volume__c)Dvol,CALENDAR_YEAR(IKAM_Data__r.Current_month__c)Year FROM Country_DCVF_Volume__c where region__c='AMI' group by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) order by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) ]) {                                        
    months2.add(new Month((Decimal )ar.get('Year'),(Decimal)ar.get('Dvol')));
    }
    system.debug('------->'+months2);
    return months2;
} 
  public class Month3 {
    public Decimal year{get; set;}
    public Decimal volume{get; set;}
    Month3(Decimal year,Decimal volume) {this.year = year;this.volume= volume;}
}

public Month[] getMonths3() {
    Month[] months3 = new Month[] {};
      System.Debug('>>>>>>>>>>>>>insid getmonths1--> ' +selcoun);
    for (AggregateResult ar : [SELECT sum( IKAM_Data__r.Countries_delivered_volume__c)Dvol,CALENDAR_YEAR(IKAM_Data__r.Current_month__c)Year FROM Country_DCVF_Volume__c where region__c='Asia-Pacific' group by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) order by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) ]) {                                        
    months3.add(new Month((Decimal )ar.get('Year'),(Decimal)ar.get('Dvol')));
    }
    system.debug('------->'+months3);
    return months3;
}  

 public class Month4 {
    public Decimal year {get; set;}
    public Decimal volume{get; set;}
    Month4(Decimal year,Decimal volume) {this.year = year;this.volume= volume;}
}

public Month[] getMonths4() {
    Month[] months4 = new Month[] {};
      System.Debug('>>>>>>>>>>>>>insid getmonths1--> ' +selcoun);
    for (AggregateResult ar : [SELECT sum( IKAM_Data__r.Countries_delivered_volume__c)Dvol,CALENDAR_YEAR(IKAM_Data__r.Current_month__c)Year FROM Country_DCVF_Volume__c where region__c='Eurasia' group by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) order by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) ]) {                                        
    months4.add(new Month((Decimal )ar.get('Year'),(Decimal)ar.get('Dvol')));
    }
    system.debug('------->'+months4);
    return months4;
} 

 public class Month5 {
    public Decimal year {get; set;}
    public Decimal volume{get; set;}
    Month5(Decimal year,Decimal volume) {this.year = year;this.volume= volume;}
}

public Month[] getMonths5() {
    Month[] months5 = new Month[] {};
      System.Debug('>>>>>>>>>>>>>insid getmonths1--> ' +selcoun);
    for (AggregateResult ar : [SELECT sum( IKAM_Data__r.Countries_delivered_volume__c)Dvol,CALENDAR_YEAR(IKAM_Data__r.Current_month__c)Year FROM Country_DCVF_Volume__c where region__c='Europe G9' group by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) order by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) ]) {                                        
    months5.add(new Month((Decimal )ar.get('Year'),(Decimal)ar.get('Dvol')));
    }
    system.debug('------->'+months5);
    return months5;
} 

 public class Month6 {
    public Decimal year {get; set;}
    public Decimal volume{get; set;}
    Month6(Decimal year,Decimal volume) {this.year = year;this.volume= volume;}
}

public Month[] getMonths6() {
    Month[] months6 = new Month[] {};
      System.Debug('>>>>>>>>>>>>>insid getmonths1--> ' +selcoun);
    for (AggregateResult ar : [SELECT sum( IKAM_Data__r.Countries_delivered_volume__c)Dvol,CALENDAR_YEAR(IKAM_Data__r.Current_month__c)Year FROM Country_DCVF_Volume__c where region__c='France' group by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) order by CALENDAR_YEAR(IKAM_Data__r.Current_month__c) ]) {                                        
    months6.add(new Month((Decimal )ar.get('Year'),(Decimal)ar.get('Dvol')));
    }
    system.debug('------->'+months6);
    return months6;
}
public List<SelectOption> getRegion() {
    List<SelectOption> options = new List<SelectOption>();
    
    options .add(new SelectOption('All countries','All countries'));
    Schema.DescribeFieldResult fieldResult = Country_DCVF_Volume__c.Region__c .getDescribe();
    List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
    for( Schema.PicklistEntry f : ple)
    {
    options.add(new SelectOption(f.getLabel(), f.getValue()));
    }
    return options;
}

      
public PageReference selectedcountry() {
    System.Debug('>>>>>>>>>>>>>insid pageref--> ' +selcoun);
     france=false;
    europe=false;
    eurasia=false;
    asia=false;
    AMI=false;
    america=false;
    allcountry=true;
    getMonths();
    return null;
}

public PageReference selectedcountry1() {

 allcountry=false;
   
    america=true;
   
    getMonths1();
    return null;
}

public PageReference selectedcountry2() {
      france=false;
    europe=false;
    eurasia=false;
    asia=false;
    AMI=true;
    america=false;
    allcountry=false;
    getMonths2();
    return null;
}

public PageReference selectedcountry3() {
    france=false;
    europe=false;
    eurasia=false;
    asia=true;
    AMI=false;
    america=false;
    allcountry=false;
    getMonths3();
    return null;
}
   public PageReference selectedcountry4() {
    france=false;
    europe=false;
    eurasia=true;
    asia=false;
    AMI=false;
    america=false;
    allcountry=false;
    getMonths4();
    return null;
}
  
  public PageReference selectedcountry5() {
   france=false;
    europe=true;
    eurasia=false;
    asia=false;
    AMI=false;
    america=false;
    allcountry=false;
    getMonths5();
    return null;
}
  
  public PageReference selectedcountry6() {
    france=true;
    europe=false;
    eurasia=false;
    asia=false;
    AMI=false;
    america=false;
    allcountry=false;
    getMonths6();
    return null;
}
  

 
 }

My test class:
@isTest
public class Rfleet_Dashboard_DeliveriesYear_Test {
    public static testMethod void deliverytest(){
         Id rType =[Select id from RecordType where sObjectType = 'Account' and name='RFLEET-ACC-DCVF-RT'].id;    
        account acc = new account(name='gfgf',montant__c=0.3,recordtypeid=rType);
        insert acc;
        acc.Name='hghg';
        update acc;
        
        
        IKAM_Data__c ikam = new IKAM_Data__c();
        ikam.Annual_deliveries_target__c=85;
        ikam.Annual_global_deliveries_commitment__c=90;
        ikam.Account__c=acc.id; // insert some account and use that id here 001m000000NPFrU
        ikam.IKAM_Year__c=2015;
        test.startTest();
        insert ikam;
         
       
      country_dcvf_volume__c con = new country_dcvf_volume__c();
        con.Country__c='Algeria';
        con.Region__c='France';
        con.Insertion_date__c=system.Today();
        con.KAM__c='Prabu';
        con.Country_forecast__c=3;
        con.Delivered_volume__c=1;
        con.Parent_Account__c=acc.id;  // insert some account and use that id here  001m000000NFrdp
        con.IKAM_Data__c=ikam.id;
        insert con;
         
        
        
        pagereference vfpage = page.Rfleet_Dashboard_DeliveriesYear_Vf;
        test.setCurrentPageReference(vfpage);
        apexpages.StandardController bre = new apexpages.StandardController(con);
       // Rfleet_Dashboard_DeliveriesYear.Month1 = new Rfleet_Dashboard_DeliveriesYear.Month1();
        Rfleet_Dashboard_DeliveriesYear controller = new Rfleet_Dashboard_DeliveriesYear(bre);
        
        
        controller.getcont();
        controller.getMonths();
        controller.getMonths1();
        controller.getMonths2();
        controller.getMonths3();
        controller.getMonths4();
        controller.getMonths5();
        controller.getMonths6();
        controller.getRegion();
        controller.selectedcountry();
        controller.selectedcountry1();
        controller.selectedcountry2();
        controller.selectedcountry3();
        controller.selectedcountry4();
        controller.selectedcountry5();
        controller.selectedcountry6();
        
       
      }
  
}

The wraper class lines are not covered in test class.The uncovered lines in test class are:
User-added image
Hi,

I wanted to see if a workflow field update runs before an apex trigger (after update)?

Scenario:
I have a certain set of campaigns that when they are updated, I want to create events associated to those Campaigns. I am using an apex trigger to create the events, but I wanted only update those events when two Campaign fields are updated (StartDate and customField1). This means that if other campaign fields are updated then i do not want to update the events.

I was thinking of using a workflow field update using the following logic to determine whether the apex trigger should update the events. 
Workflow criteria:

ISCHANGED(StartDate) AND customField1=TRUE

Field update (set UpdateEvents__c field to true):

Campaign.UpdateEvents__c = TRUE

Then in my apex trigger, I would check if Campaign.UpdateEvents__c = TRUE, then only update the Events using the following logic below:
 
//assume cmps is all the campaigns being updated
List<Campaign> cmps = [Select Id, StartDate, UpdateEvents__c From Campaign];

for(Campaign cp : cmps) {
   if(cp.UpdateEvent__c = true) {

       //logic to update events associated to the campaign goes here

   }//end if
}//end for

Then once the events have been updated, I would like to set the Campaign.UpdateEvents__c to FALSE.

I was wondering if all this was possible and if the workflow field update would process before the apex trigger. 
 
  • November 23, 2015
  • Like
  • 0
I'm trying to use the following in my controller class in the developer edition. It throws a compilation error saying "Method doesn't exist or incorrect signature"

Map<String, Schema.SObjectType> globalObjMap = Schema.getGlobalDescribe();

I've seen the descibe call being used in many examples on the web and even in the salesforce documentation. How come it's throwing an error for me. Kindly help.
Example: invoice amount =1000 then should have to print 
           (one thousands )

plz help me..

Posting this in order to help others who, months from now, might Google "OP_WITH_INVALID_USER_TYPE_EXCEPTION" and find this explanation.

 

We wrote an Apex trigger on the User object, to insert a custom object record anytime a user updates their Chatter status.  This was done to fulfill a client's requirement to audit all Chatter activity.

 

The trigger worked fine, until one day the client signed up some Chatter Free users.  When such a user tried to update their status, they got a pop-up with an OP_WITH_INVALID_USER_TYPE_EXCEPTION error.

 

We scratched our collective heads for awhile.  After all, Apex triggers run in "system mode," right?  That is supposed to mean that "object and field-level permissions of the current user are ignored."  And yet this trigger seemed like it was running in "user mode," enforcing restrictions based on who the current user was.

 

The root cause turned out to be that a Chatter Free user cannot be the owner of a custom object record, and SFDC by default sets the current user as a new record's first owner.  We discovered this when we realized, via experiment, that Apex triggers fired as the result of actions by Chatter Free users could definitely update an existing record, but were having problems creating records.

 

So the simple solution was to explicitly set the owner of the new record to some fully-licensed user prior to inserting it.

By default, the focus is set to the first available inputField. In my case, the first input is a date field. Every time I go to the page, the focus is set to that field and the calendar pops up, covering items below it.

How do I remove the auto-focus? screenshot:

 


Example: invoice amount =1000 then should have to print 
           (one thousands )

plz help me..

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it. 

By default, the focus is set to the first available inputField. In my case, the first input is a date field. Every time I go to the page, the focus is set to that field and the calendar pops up, covering items below it.

How do I remove the auto-focus? screenshot: