2

I have a VF page where I am retrieving Employee records (detail) when clicking on particular Department (master) name using CommandLink. The records are retrieved using repeater. The thing is, Employee records has salary field and is rendered as in inputField on the page with total on the last row. When salary value is changed, the total is calculated and is rendered via JavaScript. It works well until the value exceeds 99999. After that error is shown 'Error: Number is too large'. What to do? Here is the table that shows Employee records that are related to Department.

    <table width="80%" border="1px" style="margin-left:100px;" id="table2">
    <thead>        
        <tr>
            <th>No.</th>
            <th>Name</th>
            <th>Date of Birth</th>                        
            <th>Salary</th>                
        </tr>        
    </thead>
    <apex:variable id="indexvar" var="iterator1" value="{!1}"/>
    <apex:repeat value="{!lstemployee}" var="emp" id="repeat2"> 
        <tr id="row" onmouseover="mouseover()" onmouseout="mouseout()">               
            <td id="col1">{!iterator1}</td>

            <td id="col2"><apex:commandLink value="{!emp.name}" action="/{!emp.id}" target="_blank" id="commandlink"/></td>

            <td id="col3"><apex:outputText value="{0,date,MM'/'dd'/'yyyy}" id="date">
                <apex:param value="{!emp.Date_of_Birth__c}" id="parameter"/>
            </apex:outputText></td>

            <td id="col3"><apex:inputField value="{!emp.Salary__c}" styleClass="ipSalary"  id="inputsalary" onchange="salarychanged()"> </apex:inputfield></td>
            <apex:variable var="iterator1" value="{!iterator1+1}"/>                                                    
        </tr>                
    </apex:repeat>  
    <tfoot id="footer">        
        <tr id="footerrow">
            <th colspan="3" style="text-align:right;">Total</th>
            <th><apex:outputText styleclass="totalsalary" value="0" id="totalsalarytext"></apex:outputText></th>            
        </tr>
    </tfoot>        
</table>
2

I think it's linked to the field definition - go the field emp.Salary__c in the system and allow it to have a number length greater than 5 digits.

Here is the area that needs to be changed:

enter image description here

| improve this answer | |
  • Hah, no worries, happens to us all! – Caspar Harmer May 15 '15 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.