• Amoun777
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies

I may be missing something simple but I cannot seem to get a default Number value to appear in an object I instantiate in apex.  The value is always == null.  My variable is Mileage_Rate__c and in my org the default value = 0.58.  When I create an instance using the following code this value is always null.  I do not want to hardcode this in my apex class.  Any suggestions? 

 

apex:

 

Expense_Report = new Expense_Report__c(Status__c = 'Unsaved');

...

if(Expense_Report.Mileage_Rate__c == null)

{

   // This code will always execute 

}

 

Thanks in advance for any help on this!

 

Adam

I'm using ajax in a VF page via the actionsupport call and can rerender a section (notes) based on the column, but can't see how to determine the current row of a pageBlockTable.  Here's a snippet:
 

VF:

<apex:column headerValue="{!sunTitle}">

    <apex:inputField id="sunday"value="{!hoursList.Sunday__c}" style="width: 40px">

    <apex:actionsupport event="onfocus" action="{!sunNotes}" rerender="notes"/>

    </apex:inputField>

</apex:column>

 

Apex:

public PageReference sunNotes()

{

   refreshTotals();

   currentNote = 'Sunday';

   notesValue = Hours[currentHour].SundayNotes__c;

   noteIsActive = true;

   return null;

}

 

Where currentHour (an integer) would equal the current row in my pageBlockTable, ideally.  Any help you could provide would be seriously appreciated.

 

Thanks!!

Adam

I'm using ajax in a VF page via the actionsupport call and can rerender a section (notes) based on the column, but can't see how to determine the current row of a pageBlockTable.  Here's a snippet:
 

VF:

<apex:column headerValue="{!sunTitle}">

    <apex:inputField id="sunday"value="{!hoursList.Sunday__c}" style="width: 40px">

    <apex:actionsupport event="onfocus" action="{!sunNotes}" rerender="notes"/>

    </apex:inputField>

</apex:column>

 

Apex:

public PageReference sunNotes()

{

   refreshTotals();

   currentNote = 'Sunday';

   notesValue = Hours[currentHour].SundayNotes__c;

   noteIsActive = true;

   return null;

}

 

Where currentHour (an integer) would equal the current row in my pageBlockTable, ideally.  Any help you could provide would be seriously appreciated.

 

Thanks!!

Adam