• SFDC@Chennai
  • NEWBIE
  • 70 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 16
    Replies
I created List and the its having some values on, if i am checking llist size not covering up in test class.

In my apex class created list having six values, even it cound not covering up size of '1' 
Please share me if any one have idea about this- thanks

Hi, This following code is in my apex class.
In my test clas i can cover up List and followed by if condition, the bold part is not covering up. Please share me if any one have idea.

List < Forecast_Revenue_Report__c > getFlagVal = [SELECT Flag__c FROM Forecast_Revenue_Report__c WHERE Forecast_Month__c = : this.month1];
if(!getFlagVal.isEmpty()){

     this.flag = getFlagVal[0].Flag__c;

Thanks.
List < Report__c > frList = new List < Report__c > ();

How sholud i use the code for covering above line in apex test class? can any one have idea!!
Hi I created test class and called save method through the reference(CustomObj__c co = new CustomObj__c(); co.save()), its covering only true part.

I need cover up the list creating/ inserting part, Please find the below image for your reference.

User-added image
Thanks
HI

I wrote test class .
when i give the method name its covering only if part , else part is not covering
I need to cover the else part in test class

In test class I called the method as update();

My code is 

public PageReference update() {
  List < Forecast_Revenue_Report__c > getCheckEmpty = [SELECT Amount__c, Month__c, opp_id__c FROM Forecast_Revenue_Report__c WHERE opp_id__c = : this.oppId];
  if (getCheckEmpty.size() == 0) {
   return null;
  } else {
   List < Forecast_Revenue_Report__c > Output = [SELECT Amount__c, Month__c, opp_id__c FROM Forecast_Revenue_Report__c WHERE opp_id__c = : this.oppId];

   if (Output.size() > 0) {
    if (this.month1.contains(Output[0].Month__c)) {
if (Output.size() >= 1) {
      this.amount1 = Output[0].Amount__c;
     }}



Thanks in Advance
Hi
In the pick list i have six values like 6,12,18,24,30 &36.
In VFP, if i choosed 18 it shold get it in controller's/onload method of apex class.

Can any one share the idea to get this?
Hi- I just want to delete the existing records in contructor itself. 
This code is working in action method but its not working in constructor, Please share me idea if any one have. 

List<Forecast_Revenue_Report__c> foreRevRepOutput = [SELECT Forecast_Amount__c, Forecast_Month__c, opp_id__c FROM Forecast_Revenue_Report__c WHERE opp_id__c = :this.oppId];
for(Forecast_Revenue_Report__c frDelete : foreRevRepOutput ) {
                    delete frDelete;
       }

Thanks,
Hi My code is below, i can get 6 values in tem variable from foreRevRep List, but i should display all the amount fileds from temp.

List<Forecast_Revenue_Report__c> foreRevRep = [SELECT Forecast_Amount__c,Forecast_Month__c,opp_id__c FROM Forecast_Revenue_Report__c WHERE opp_id__c = :this.oppId];
        for(Forecast_Revenue_Report__c tem: foreRevRep){
            this.amount1 = ;
            this.amount2 = ;
            this.amount3 = ;
            this.amount4 = ;
            this.amount5 = ;
            this.amount6 = ;

        }

Thanks,
Hi

I created vfp in that i got valuers through input field and i saved/updated in text field of object,
<apex:inputText label="{!month1}" value="{!amount1}"

i just want to stay my last updated/inserted value in that textfiled. Can any one help me for this!
Hi

i have 4 INputtext

amount1:
amount2:
month1:
month2:

public PageReference save() {
  List < Forecast_Revenue_Report__c > frList = new List < Forecast_Revenue_Report__c > ();
  Forecast_Revenue_Report__c frr = new Forecast_Revenue_Report__c();
  frr.opp_id__c = opp.Id;
       if (this.amount1 != null) {
   frr.Forecast_Month__c = this.month1;
   frr.Forecast_Amount__c = this.amount1;
   frList.add(frr);
  }

  Forecast_Revenue_Report__c frr2 = new Forecast_Revenue_Report__c();
  frr2.opp_id__c = opp.Id;
  // frr= null;
  if (this.amount2 != null) {
   System.debug('this is for total' + frList);
   frr2.Forecast_Month__c = this.month2;
   frr2.Forecast_Amount__c = this.amount2;
   frList.add(frr2);
  }

                upsert frList;
  PageReference oppPage = new PageReference('/' + ApexPages.currentPage().getParameters().get('id'));
 
       
  System.debug('this is for testing i above save' + oppId);
     if(oppId != null ){
            System.debug('this is for testing i Update' + oppId);
   update frList;
  } else  {
            insert frList;
   System.debug('this is for testing i saved' + oppId);
          
  }
       
  return oppPage;

when i  click save button the values are getting added, i want the values to be updated

Thanks in advance
Hi
I need to create a list in that i have add 6 values, finally that list should be inserted in db,

My code is as below, 

List < Forecast_Revenue_Report__c > frList = new List < Forecast_Revenue_Report__c > ();

  Forecast_Revenue_Report__c frr = new Forecast_Revenue_Report__c();
  frr.opp_id__c = opp.Id;
           if(frr.Forecast_Amount__c != 0){
                 frr.Forecast_Amount__c = this.amount1; 
                 frList.add(frr);
                 frr= null;
                 
                 frr.Forecast_Amount__c = this.amount2;
                 frList.add(frr);
                 frr= null;

                 frr.Forecast_Amount__c = this.amount3;
                 frList.add(frr);
                 frr= null;

                 frr.Forecast_Amount__c = this.amount4;
                 frList.add(frr);
                frr= null;

                 frr.Forecast_Amount__c = this.amount5;
                 frList.add(frr);
                 frr= null;

                 frr.Forecast_Amount__c = this.amount6;
                 frList.add(frr);
                frr= null;
           }
        insert frList;

In this case i can insert  only frr.Forecast_Amount__c = this.amount6;value(list contain final value), but i need to get all the 6 types of amonut in Forecast_Amount__c filed/ List(frList) can any one help for this!
I have 10 inputtext values each i need to add in a single list.
My code(for eg)
Forecast_Revenue_Report__c frr = new Forecast_Revenue_Report__c();
        List<Forecast_Revenue_Report__c> frList = new List<Forecast_Revenue_Report__c>();
        frr.opp_id__c = opp.Id;
           if(frr.Forecast_Amount__c != 0){
                 frr.Forecast_Month__c = this.month1;
           frr.Forecast_Amount__c = this.amount1;
                 frList.add(frr);
              frr= null;
            System.debug('this is for ffff'+frr);
           }else if(frr.Forecast_Amount__c != 0){
                frr.Forecast_Month__c = this.month2;
           frr.Forecast_Amount__c = this.amount2;
                 frList.add(frr);
              frr= null;
           }


In above coding i can get only values for 1st condition(month1 & amount 1), but i need to get like all the 10 values in loop.
Please help me for this!
Hi 
 
I have two object

1. Opportunity-Std Object
2.Books-custum Object

this both are in Look-up relation 

i created a 

<apex:inputText label="{!amt2}" value="{!month1}"/>---- in std object

in custum Object.
i create a formula field names test and in formula i gave  month1

User-added image

its showing error any any one help me out pls ?

i want to get the value what ever entered in month1 in std object to cust object in test.


I just want to dispaly the fields for getting input, it should Not be created  as Salesforce object's fileds.
The created(in VFP as a apex tag) filed's name should be dynamic based on some other input.
Eg: If i have 6 fields, the first filed's name will be current month's name(Sep-14) respectively next 5 fields Oct-14, Nov-14, Dec-14, Jan-15.

Can any one please help me out?
Hi

I know how to break a text in formula field ,  i gave 

Label1__c &  BR()  &  Label2__c

Now my question is  how should i separate two currency field ?

Month1__c     Month2__c

what should i use inbetween this two field to get in next line.

Thanks In advance
Hi,
I created some fileds for display/ save the values for revenue of a product on Opportunity Object.
API Name is standard for every fields, so  i changed those dynamically in User Interface by using label.

The problem is i could not change those fields name as dynamically in Report view.

Can any one help me out for this?
Hi


I have doubt can any one help me out .

i have created a field in object Opportunity..
          Month1 (Month1__c)
i changed the label name dynamically in front end(VFP) but in report tab i get the same name as Month1 .

instead of Month1 i want to get as Sep'14 in Report tab..
It should be dynamic based on current month.
Is their any possiable way to figure it out .

User-added image


User-added image

Thanks in adavance 

Hi

After moving to PROD in Opportunity custom  fields defalut value is not displaying of few Opportunity.why?

Thanks in Advance

Hi

I have an Opportunity  and Opportunity Owner Role =Sales  it works fine, when i change the  Opportunity Owner Role = Market i m not able to retrive the Data .
can any one help me out.

Thanks in Advance 

HI

After moving from QA to PROD , i m able to acces all the feild in few Oppprtunity Owners not for all.

For example i have a Opportunity say (opportunity owner =A) i am able to get  all fields when i change the same Opportunity  to (opportunity owner =B) i get
 ( List has no rows for assignment to SObject) Error message can any one help me out.

Thanks in Advance.
Hi, This following code is in my apex class.
In my test clas i can cover up List and followed by if condition, the bold part is not covering up. Please share me if any one have idea.

List < Forecast_Revenue_Report__c > getFlagVal = [SELECT Flag__c FROM Forecast_Revenue_Report__c WHERE Forecast_Month__c = : this.month1];
if(!getFlagVal.isEmpty()){

     this.flag = getFlagVal[0].Flag__c;

Thanks.
List < Report__c > frList = new List < Report__c > ();

How sholud i use the code for covering above line in apex test class? can any one have idea!!
Hi I created test class and called save method through the reference(CustomObj__c co = new CustomObj__c(); co.save()), its covering only true part.

I need cover up the list creating/ inserting part, Please find the below image for your reference.

User-added image
Thanks
Hi
In the pick list i have six values like 6,12,18,24,30 &36.
In VFP, if i choosed 18 it shold get it in controller's/onload method of apex class.

Can any one share the idea to get this?
Hi- I just want to delete the existing records in contructor itself. 
This code is working in action method but its not working in constructor, Please share me idea if any one have. 

List<Forecast_Revenue_Report__c> foreRevRepOutput = [SELECT Forecast_Amount__c, Forecast_Month__c, opp_id__c FROM Forecast_Revenue_Report__c WHERE opp_id__c = :this.oppId];
for(Forecast_Revenue_Report__c frDelete : foreRevRepOutput ) {
                    delete frDelete;
       }

Thanks,
Hi
I need to create a list in that i have add 6 values, finally that list should be inserted in db,

My code is as below, 

List < Forecast_Revenue_Report__c > frList = new List < Forecast_Revenue_Report__c > ();

  Forecast_Revenue_Report__c frr = new Forecast_Revenue_Report__c();
  frr.opp_id__c = opp.Id;
           if(frr.Forecast_Amount__c != 0){
                 frr.Forecast_Amount__c = this.amount1; 
                 frList.add(frr);
                 frr= null;
                 
                 frr.Forecast_Amount__c = this.amount2;
                 frList.add(frr);
                 frr= null;

                 frr.Forecast_Amount__c = this.amount3;
                 frList.add(frr);
                 frr= null;

                 frr.Forecast_Amount__c = this.amount4;
                 frList.add(frr);
                frr= null;

                 frr.Forecast_Amount__c = this.amount5;
                 frList.add(frr);
                 frr= null;

                 frr.Forecast_Amount__c = this.amount6;
                 frList.add(frr);
                frr= null;
           }
        insert frList;

In this case i can insert  only frr.Forecast_Amount__c = this.amount6;value(list contain final value), but i need to get all the 6 types of amonut in Forecast_Amount__c filed/ List(frList) can any one help for this!
Hi


I have doubt can any one help me out .

i have created a field in object Opportunity..
          Month1 (Month1__c)
i changed the label name dynamically in front end(VFP) but in report tab i get the same name as Month1 .

instead of Month1 i want to get as Sep'14 in Report tab..
It should be dynamic based on current month.
Is their any possiable way to figure it out .

User-added image


User-added image

Thanks in adavance 

Hi

I have an Opportunity  and Opportunity Owner Role =Sales  it works fine, when i change the  Opportunity Owner Role = Market i m not able to retrive the Data .
can any one help me out.

Thanks in Advance 

HI

After moving from QA to PROD , i m able to acces all the feild in few Oppprtunity Owners not for all.

For example i have a Opportunity say (opportunity owner =A) i am able to get  all fields when i change the same Opportunity  to (opportunity owner =B) i get
 ( List has no rows for assignment to SObject) Error message can any one help me out.

Thanks in Advance.
Hi

 After moving from QA to PROD  i m able to acces all the feild in few Opp.for example i have 6 opportunity (A,B,C,D,E & F).
i am able to see the vf page For A,B,C,D Opportunity but E& F I get ( List has no rows for assignment to SObject) Error message can any one help me out 

Thanks in Advance

Hi,

I moved from QA to Prod I m able to acces all the field through my account but not able to Edit from other User  Name  why can anyone help me out.

Thanks In advance