Skip to main content
meghna m a posé une question dans #Apex
Can any one help me on this. I have a visual force page created in PDF format. Based on the Condition i need to Display the Value.

1)If the product line for the product selected in opportunity items is equal to ‘ DIE’ make following changes .

a) unit price should change to $0.01.

b)Extension =Qty*0.01

c)Subtotal =(Non_pick_total)

But Extension is formula field which is (Extension=qty*1) and

Non_pick_total is a Roll up summary field which Aggregates the Extension.

 

​The issue is the "Extension" field value is getting calculated based on the formula field but it should get calculated as per the changes made in visual force page and display (Extension =Qty*0.01) on the subtotal .

2)If the product line for the product selected in opportunity items is other than ‘ DIE’ make following changes .

a) unit price should change to $1.

b)Extension =Qty*1

Code :

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;

}

else {

tempObj.unitprice=1;

//tempObj.unitprice=OPplineitem[i].ListPrice;

tempobj.extension=OPplineitem[i].Extension__c;

}

PFA Screen Shot :

Extension Value display on visual force page

Any help very much appreciated.
2 réponses
  1. 9 mars 2015, 15:57
    Hi Gaurav ,

    Thanks for your reply.

    Their are no Errors.At step 1 the sub steps a (unit price should change to $0.01.) and  b(Extension =Qty*0.01) works fine but at c we the Subtotal is getting calculated as per the Extension Formula,but it should get calculated as per the changes in VF page.

    In the Screen shot ,the red mark of the Extension when caluclated it is - 11 but the SUBTOTAL is reflecting as 1100 but it should be 11.

    ​The issue is the "Extension" field value is getting calculated based on the formula field but it should get calculated as per the changes made in visual force page and display (Extension =Qty*0.01) on the subtotal .

    Any help very much appreciated.

     
0/9000