+ Start a Discussion
alchemyalchemy 

explanation

 public FPsidebarController(ApexPages.StandardController stdController) {

        fmBean=new FamilyMemberInfoBean();

        fmInfoService=new FamilyMemberInfoService();

        fmInfoService.isCostomerProfile(fmBean);

        this.acct = (Account)stdController.getRecord();

        String accountId;

        if(Apexpages.currentPage().getParameters().get(entityId)!=null){

 

        if(this.acct.Id == null){

            accountId= Apexpages.currentPage().getParameters().get(entityId);

        }

        else{

            accountId = this.acct.Id;

         }

        }

 

 public FPsidebarController(ApexPages.StandardController stdController)

{     

  fmBean=new FamilyMemberInfoBean();   

    fmInfoService=new FamilyMemberInfoService(); 

      fmInfoService.isCostomerProfile(fmBean);   

    this.acct = (Account)stdController.getRecord();   

    String accountId;     

  if(Apexpages.currentPage().getParameters().get(entityId)!=null)

{           

    if(this.acct.Id == null)

       {       accountId= Apexpages.currentPage().getParameters().get(entityId); 

      }       

else

{       

    accountId = this.acct.Id;     

   }   

    }

 

      i am not able to understand what this code is tring to do?

       can i get some help on the same

 

Imran MohammedImran Mohammed

Basically the code is checking if the request URL has entityId parameter in it.

If the parameter is there its retreiving the value and storing it in accountId variable.

If the parameter is not there, its assigning the current Account records id .

alchemyalchemy

What is the following line trying to do

 this.acct = (Account)stdController.getRecord();   

Imran MohammedImran Mohammed

It fetches the current account record thats being accessed.

And later you can get the id of that record.