You need to sign in to do that
Don't have an account?
nikkey
Can any one help me on this? I have a Visualforce page created on Opportunity object which is in PDF format. I have a few RollUp summary fields created on opportunity object. There is a Wrapper class written on Opportunity Product. Now I would like to call these RollUp summary fields in the wrapper class based on a Condition. How do I wrap the RollUp summary field in a class? Any help very much appreciated.
Subtotal__c and Non_Pick_Total__c are Roll up summary fields on Opportunity Object. They give the "Sum" of Opportunity Product aggregates on Extension Field.
Extension(Extension=qty*1) is a Formula field data type as Currency on Opportunity Product.
The issue I'm having is that the "Extension" field value is getting calculated based on the formula field but it should get calculated as per the changes made in the VisualForce page and display (Extension = Qty*0.01) on the subtotal.
When i check in the Debug logs the value gets calculated but it does not get changed in the visual force page.Any help very much appreciated.
Apex Code Logic written to change the value in visualforce page doesnot work
Can any one help me on this? I have a Visualforce page created on Opportunity object which is in PDF format. I have a few RollUp summary fields created on opportunity object. There is a Wrapper class written on Opportunity Product. Now I would like to call these RollUp summary fields in the wrapper class based on a Condition. How do I wrap the RollUp summary field in a class? Any help very much appreciated.
Subtotal__c and Non_Pick_Total__c are Roll up summary fields on Opportunity Object. They give the "Sum" of Opportunity Product aggregates on Extension Field.
Extension(Extension=qty*1) is a Formula field data type as Currency on Opportunity Product.
The issue I'm having is that the "Extension" field value is getting calculated based on the formula field but it should get calculated as per the changes made in the VisualForce page and display (Extension = Qty*0.01) on the subtotal.
for (integer i=0; i < OPplineitem.size(); i++) { tempObj = new wrapperClass(); tempObj.productname= OPplineitem[i].PricebookEntry.Product2.Name; tempObj.BinItemCode=OPplineitem[i].Bin_Item_Code__c; tempObj.quantity=OPplineitem[i].Quantity; tempObj.totalamount=OPplineitem[i].Sys_total_Amount__c; // tempObj.Subtotal =OPplineitem[i].Opportunity.Subtotal__c; // tempObj.NonPickTotal=OPplineitem[i].Opportunity.Non_Pick_Total__c; //Add a conditional statement here if (OPplineitem[i].PricebookEntry.Product2.Product_Line__c=='DIE') { tempObj.unitprice=0.01; tempobj.extension=OPplineitem[i].Quantity * tempObj.unitprice; tempObj.productname=OPplineitem[i].Bin_Item_Code__c; if (i==0) { tempObj2.Subtotal=tempobj.extension; system.debug('@@@@@@@@'+tempObj2.Subtotal); } else { tempObj2.Subtotal=tempObj2.Subtotal+tempObj.extension; } } else { tempObj.unitprice=1; //tempObj.unitprice=OPplineitem[i].ListPrice; tempobj.extension=OPplineitem[i].Extension__c ; } }
When i check in the Debug logs the value gets calculated but it does not get changed in the visual force page.Any help very much appreciated.
VF CODE :
PFA SCREEN SHOT :
Any help very much appreciated.
Subtotal__c and Non_Pick_Total__c are Roll up summary fields on Opportunity Object. They give the "Sum" of Opportunity Product aggregates on Extension Field.
Non_Pick_Total__c --Data Type Roll-Up Summary Summary Type SUM
Summarized Object Opportunity Product
Field to Aggregate Opportunity Product: Extension
Filter Criteria PickEQUALSFalse
Similarly for Pick Total :Data Type Roll-Up Summary Summary Type SUM
Summarized Object Opportunity Product
Field to Aggregate Opportunity Product: Extension
Filter Criteria PickEQUALS TRUE
Subtotal :Data Type Roll-Up Summary Summary Type SUM
Summarized Object Opportunity Product
Field to Aggregate Opportunity Product: Extension
Filter Criteria
Controller : This is the complete controller .
Now Based on the Condition
Condition 1:
If the product line for the product selected in opportunity items is ‘DIE’ make following changes .
1) unit price should change to $.01. // Condition Works
2)Unit price just change on the PDF display only and with extended amount which will be quantity times .01.
Extension = Quantity*0.01 // Condition Works
3)productname =BinItemcode // Condition Works
4)Subtotal = NonPickTotal //Condition doesnot work -------Here the value should change as per the logic written and display on the vf page the total should be 11 but its reflecting as 1100.
Condition 2:
If the product line for the product selected in opportunity items is '!DIE’ make following changes .
1) unit price should change to $1.
2)Extension =Extension
Any help very much appreciated.
So, you need to create in InvoiceController some fields: Which you will be change in getappointmentList.
After that you need to change from: To:
In the Wrapper class , i have the
public Decimal Subtotal{get;set;}
public Decimal NonPickTotal{get;set;}
without changing the Vf code , cant we go in writing the logic to change the value.
So the 'total data' we have to get from the controller, thats why you need these fields in the controller, when you add them to controller, you will be able to get data in VF using {!fieldName}.
So add these fields to controller and inside getAppointmentList calculate these fields, then you will get them in VF page as i mention above.