• Anjali Sharma 87
  • NEWBIE
  • 25 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 9
    Replies
Hi All,

I have one visualforce page and controller. Visualforce page have some fields in which user enters a value and save the records. Now when a user click on save button the records is save to the object and the pdf is also generated for the same and attached to notes and attachment for the same object. Please help me i am stuck.

Thanks
Anjali
Hi Team ,

I am getting an error when we push heroku app through eclipse .The error is as follow:
 
pre-receive hook declined
Compressing source files... done.
Building source:
Using set buildpack heroku/java
Java app detected
Installing OpenJDK 1.6... done
Installing Maven 3.3.9... done
Executing: mvn -B -DskipTests clean dependency:list install
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
 !     ERROR: Failed to build app with Maven
       We're sorry this build is failing! If you can't find the issue in application code,
       please submit a ticket so we can help: https://help.heroku.com/
 !     Push rejected, failed to compile Java app
Verifying deploy...
!    Push rejected.

Thanks
Sid
Hi,

I am getting an error when we push heroku app through eclipse .The error is as follow:
 
pre-receive hook declined
Compressing source files... done.
Building source:
Using set buildpack heroku/java
Java app detected
Installing OpenJDK 1.6... done
Installing Maven 3.3.9... done
Executing: mvn -B -DskipTests clean dependency:list install
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
 !     ERROR: Failed to build app with Maven
       We're sorry this build is failing! If you can't find the issue in application code,
       please submit a ticket so we can help: https://help.heroku.com/
 !     Push rejected, failed to compile Java app
Verifying deploy...
!    Push rejected.

Please help me.

Thanks
Siddhartha
Hi,

Suppose i have the one client and i schedule meeting with my client but client is in different time zone.
So first requirement is to get the client time zone and then arrange a meeting with the client time zone which is different from my time zone.
In my org it will show the meeting schedule time will be of client time zone.
Can one please help me to achive this.??????

Thanks in advance
:) 
hiii
i want to create a vf page on which i have two object one opportunity and task.
i have created the vf and controller bt i m facing the problem that how to a fetch the value of opportunity and on those opportunity we have task i a single query.
i m not abe to create a relationship query .Can anyone please help me 
Hi 

How to write the relationship query and how to fetch the record from the query on visaulforce page
For ex i have one account object and one contact obj then how to write the relationship from parent to child and child to parent bcoz when i am using the query it will give only id 
Account con;
con = [select account.name,(Select contact.firstName,contact.lastName from account.contacts) from account limit 1];
system.debug(con);

how to fetch the value of contact.last name and same when i use child to parent ?????
And then how to to display it on visualforce page.

Please explain me!!!

we have one add account button and del button at time for page load 
When the user click on the add new account then few fields ex: Account name ,Industry and Rating are show with inputFields so the user can
enter the user value and then two more button are display on page to add the contact for that account and delete the contact for that account.
For example one account with multiple contact on row.I have try but actully i have used the two pageblocktable with the Map in which i receive the value in one pageblocktable but when i am using the contact value in pageblocktable it is given the error i.e Map key null not found in map.
I am sharing the code ...

Visualforce page*************

<apex:page controller="Addcontactwrappernewcontroller">
 <apex:form >
   <apex:commandButton value="Add Account" action="{!addaccount}" rerender="panel"/>
    <apex:pageBlock >
    <apex:pageBlockSection columns="2">
     <apex:pageBlockTable var="key" value="{!mywrapperobj}">
      <apex:column headerValue="Account Name">
       <apex:inputField value="{!mywrapperobj[key].accobj.Name}"/>
      </apex:column>
      <apex:column headerValue="Rating">
       <apex:inputField value="{!mywrapperobj[key].accobj.Rating}"/>
      </apex:column>
      <apex:column headerValue="Type">
       <apex:inputField value="{!mywrapperobj[key].accobj.Type}"/>
      </apex:column>
      </apex:pageBlockTable>
     <apex:pageBlockTable var="innerListVar" value="{!mywrapperobj[key].conlist}">
      <apex:column headerValue="Last Name">
       <apex:inputField value="{!innerListVar.LastName}"/>
      </apex:column>
     </apex:pageBlockTable>
    </apex:pageBlockSection>
    </apex:pageBlock>
 </apex:form>
</apex:page>


Controller***********

public with sharing class Addcontactwrappernewcontroller {

    public String getKey() {
        return null;
    }


   
    public Integer counter {get;set;}
    public Integer row {get;set;}
    public Map<Integer,wrapperclass> mywrapperobj {get;set;}

    public class wrapperclass{
    
    public List<Contact> conlist{get;set;}
    public Account accobj{get;set;}
    public wrapperclass(){
    this.conlist = new List<Contact>();
    this.accobj = new Account();
     }
   }

    public Addcontactwrappernewcontroller(){
    counter = 0;
    mywrapperobj = new Map<Integer,wrapperclass>();
    addaccount();
   }

   public void addaccount(){
   counter ++;
   mywrapperobj.put(counter,new wrapperclass());
   row=counter;
   addcontactRow();
   }

   public void addcontactRow(){
   mywrapperobj.get(row).conlist.add(new Contact());
   }
    
}


Thanks in advance 

we have one add account button and del button at time for page load 
When the user click on the add new account then few fields ex: Account name ,Industry and Rating are show with inputFields so the user can
enter the user value and then two more button are display on page to add the contact for that account and delete the contact for that account.
For example one account with multiple contact on row.I have try but actully i have used the two pageblocktable with the Map in which i receive the value in one pageblocktable but when i am using the contact value in pageblocktable it is given the error i.e Map key null not found in map.
I am sharing the code ...

Visualforce page*************

<apex:page controller="Addcontactwrappernewcontroller">
 <apex:form >
   <apex:commandButton value="Add Account" action="{!addaccount}" rerender="panel"/>
    <apex:pageBlock >
    <apex:pageBlockSection columns="2">
     <apex:pageBlockTable var="key" value="{!mywrapperobj}">
      <apex:column headerValue="Account Name">
       <apex:inputField value="{!mywrapperobj[key].accobj.Name}"/>
      </apex:column>
      <apex:column headerValue="Rating">
       <apex:inputField value="{!mywrapperobj[key].accobj.Rating}"/>
      </apex:column>
      <apex:column headerValue="Type">
       <apex:inputField value="{!mywrapperobj[key].accobj.Type}"/>
      </apex:column>
      </apex:pageBlockTable>
     <apex:pageBlockTable var="innerListVar" value="{!mywrapperobj[key].conlist}">
      <apex:column headerValue="Last Name">
       <apex:inputField value="{!innerListVar.LastName}"/>
      </apex:column>
     </apex:pageBlockTable>
    </apex:pageBlockSection>
    </apex:pageBlock>
 </apex:form>
</apex:page>


Controller***********

public with sharing class Addcontactwrappernewcontroller {

    public String getKey() {
        return null;
    }


   
    public Integer counter {get;set;}
    public Integer row {get;set;}
    public Map<Integer,wrapperclass> mywrapperobj {get;set;}

    public class wrapperclass{
    
    public List<Contact> conlist{get;set;}
    public Account accobj{get;set;}
    public wrapperclass(){
    this.conlist = new List<Contact>();
    this.accobj = new Account();
     }
   }

    public Addcontactwrappernewcontroller(){
    counter = 0;
    mywrapperobj = new Map<Integer,wrapperclass>();
    addaccount();
   }

   public void addaccount(){
   counter ++;
   mywrapperobj.put(counter,new wrapperclass());
   row=counter;
   addcontactRow();
   }

   public void addcontactRow(){
   mywrapperobj.get(row).conlist.add(new Contact());
   }
    
}


Thanks in advance 
Can anyone please tell me if i want to add a row in which three fields are their i.e Account Name , Industry and Rating and two buttons and add row and del row.When a user insert the value in these fields and click on the add row button then these field and again show the text box to enter the value and simultaneously then the contact fields also show few text box on the visualforce page and two button for contact records when user click on add contact then the one more contact is added to same account and when delete it will delete the one contact....

I have create the code but that was not working properly so please help me for solving these tasks..

User-added image
Hi All,

I have one visualforce page and controller. Visualforce page have some fields in which user enters a value and save the records. Now when a user click on save button the records is save to the object and the pdf is also generated for the same and attached to notes and attachment for the same object. Please help me i am stuck.

Thanks
Anjali
hiii
i want to create a vf page on which i have two object one opportunity and task.
i have created the vf and controller bt i m facing the problem that how to a fetch the value of opportunity and on those opportunity we have task i a single query.
i m not abe to create a relationship query .Can anyone please help me 
Hi 

How to write the relationship query and how to fetch the record from the query on visaulforce page
For ex i have one account object and one contact obj then how to write the relationship from parent to child and child to parent bcoz when i am using the query it will give only id 
Account con;
con = [select account.name,(Select contact.firstName,contact.lastName from account.contacts) from account limit 1];
system.debug(con);

how to fetch the value of contact.last name and same when i use child to parent ?????
And then how to to display it on visualforce page.

Please explain me!!!
Hi,

So I'm creating a VF page. There is a coustom object called XYZ. Its has a picklist Field abc. I want to display abc as picklist value on my page. What will the code be in the class. Please help.
  • January 28, 2015
  • Like
  • 0

we have one add account button and del button at time for page load 
When the user click on the add new account then few fields ex: Account name ,Industry and Rating are show with inputFields so the user can
enter the user value and then two more button are display on page to add the contact for that account and delete the contact for that account.
For example one account with multiple contact on row.I have try but actully i have used the two pageblocktable with the Map in which i receive the value in one pageblocktable but when i am using the contact value in pageblocktable it is given the error i.e Map key null not found in map.
I am sharing the code ...

Visualforce page*************

<apex:page controller="Addcontactwrappernewcontroller">
 <apex:form >
   <apex:commandButton value="Add Account" action="{!addaccount}" rerender="panel"/>
    <apex:pageBlock >
    <apex:pageBlockSection columns="2">
     <apex:pageBlockTable var="key" value="{!mywrapperobj}">
      <apex:column headerValue="Account Name">
       <apex:inputField value="{!mywrapperobj[key].accobj.Name}"/>
      </apex:column>
      <apex:column headerValue="Rating">
       <apex:inputField value="{!mywrapperobj[key].accobj.Rating}"/>
      </apex:column>
      <apex:column headerValue="Type">
       <apex:inputField value="{!mywrapperobj[key].accobj.Type}"/>
      </apex:column>
      </apex:pageBlockTable>
     <apex:pageBlockTable var="innerListVar" value="{!mywrapperobj[key].conlist}">
      <apex:column headerValue="Last Name">
       <apex:inputField value="{!innerListVar.LastName}"/>
      </apex:column>
     </apex:pageBlockTable>
    </apex:pageBlockSection>
    </apex:pageBlock>
 </apex:form>
</apex:page>


Controller***********

public with sharing class Addcontactwrappernewcontroller {

    public String getKey() {
        return null;
    }


   
    public Integer counter {get;set;}
    public Integer row {get;set;}
    public Map<Integer,wrapperclass> mywrapperobj {get;set;}

    public class wrapperclass{
    
    public List<Contact> conlist{get;set;}
    public Account accobj{get;set;}
    public wrapperclass(){
    this.conlist = new List<Contact>();
    this.accobj = new Account();
     }
   }

    public Addcontactwrappernewcontroller(){
    counter = 0;
    mywrapperobj = new Map<Integer,wrapperclass>();
    addaccount();
   }

   public void addaccount(){
   counter ++;
   mywrapperobj.put(counter,new wrapperclass());
   row=counter;
   addcontactRow();
   }

   public void addcontactRow(){
   mywrapperobj.get(row).conlist.add(new Contact());
   }
    
}


Thanks in advance 
Can anyone please tell me if i want to add a row in which three fields are their i.e Account Name , Industry and Rating and two buttons and add row and del row.When a user insert the value in these fields and click on the add row button then these field and again show the text box to enter the value and simultaneously then the contact fields also show few text box on the visualforce page and two button for contact records when user click on add contact then the one more contact is added to same account and when delete it will delete the one contact....

I have create the code but that was not working properly so please help me for solving these tasks..

User-added image

I'm trying to improve the code coverage in a class that actually is 76%. In the class I have the following code that is not tested :

 

            Public List <SelectOption> buildingListOption  {get{//2&3
            List<selectOption> buildingList =new List<selectOption>();
            for(integer indx_j=0;indx_j<BuildList.size();indx_j++)
                buildingList.add(new selectOption(BuildList[indx_j].id,BuildList[indx_j].name)); 
                return buildingList;
            }//3
            private set;
            }//2
Taking out this code the coverage raised 5%. This code appears twice in the class then its weight is 10% in my code.

My question is how can I test this code.

 

Gustavo