Can any one help me on this. I have a visual force page created in PDF format. If the product line for the product selected in opportunity items is ‘DIE’ make following changes .
1) Field label name to be changed from "Item" to "Binitemcode".
2)Unit price to be changed to $0.01.
Im trying to add the lines ,it throws an Error as expecting a semi-colon, found '{'
I get this error at :public string productname{
Code :
public List<wrapperClass> getappointmentList (){
wrapperClass tempObj ;
tempObj = new wrapperClass();
List<wrapperClass> aReList = new List<wrapperClass>();
List<Opportunity> opp=[select id,Name,AccountId from Opportunity where id=:oppid limit 1];
List<opportunity> Opp1=[select id,name,CreatedDate from opportunity where id=:oppid];
//Opportunity opp1=[select id,Name,AccountId from Opportunity where id=:oppid limit 1];
//Opportunity Opp=[select id,name,CreatedDate from opportunity where id=:oppid ];
List<OpportunityLineItem> OPplineitem= [SELECT OpportunityId,Quantity,PricebookEntry.Product2.Name,Sys_total_Amount__c,LN__c,Extension__c,ListPrice
,Pick__c,Schedule_Ship_date__c,Bin_Item_Code__c ,PricebookEntry.Product2.Product_Line__c
FROM OpportunityLineItem where OpportunityId=:oppId];
system.debug('HHHHHHHHHH'+OPplineitem.size());
public String productname{
get{
if(OPplineitem[0].PricebookEntry.Product2.Product_Line__c=='DIE')
{
string productname='BinItemCode';
}
else
{string productname='Item';
}
return productname;
}
set;
}
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.productline=OPplineitem[i].PricebookEntry.Product2.Product_Line__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;
//string productname='BinItemCode';
}
else
{
tempObj.unitprice=OPplineitem[i].ListPrice;
tempobj.extension=OPplineitem[i].Extension__c;
//String productname='Item';
}
tempobj.LineNumber=OPplineitem[i].LN__c;
tempobj.Pick= OPplineitem[i].Pick__c;
tempobj.ScheduledShipDate = Opplineitem[i].schedule_ship_date__c;
if(tempobj!=null){
aReList.add(tempObj);
}
}
return aReList;
}