Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Apex Code Development
- :
- Need in Help in multiplying values in Two Fields
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Need in Help in multiplyin g values in Two Fields
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-01-2013 08:52 AM - edited 01-01-2013 08:55 AM
Request help in multiplying values in Two Fields (UnitPrice__c & QuantitySold__c}
& display the value in edit mode in 3rd Field (TotalSale__c)
All the 03 Fields are Number type
-----------------------------------VF Page----------------------------------------------
<apex:inputField id="IDUnitPrice" value="{!opportunity.UnitPrice__c}" ></apex:inputField>
<apex:inputField id="IDQtySold" value="{!opportunity.QuantitySold__c}" onkeyup="javascript:CalculateAmount();">
</apex:inputField>
<apex:inputField id="IDTotalSale" label="Total Sale" value="{!opportunity.TotalSale__c}"></apex:inputFi
------------------------------------Script --------------------------------------------------
function CalculateAmount()
{
var Price = VALUE(UnitPrice__c.);
var Qty = VALUE(QuantitySold__c);
var Amount = Price * Qty;
VALUE(TotalSale__c) = Amount;
}
Re: Need in Help in multiplyin g values in Two Fields
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-01-2013 10:08 PM - edited 01-02-2013 08:50 AM
function CalculateAmount()
{
var Price = '{!opportunity.UnitPrice__c}';
var Qty = '{!opportunity.QuantitySold__c}';
var TotSal = '{!opportunity.TotalSale__c};
var Amount = Price * Qty;
TotSal = Amount;
}
If this answers your question make this as a solution.

