You need to sign in to do that
Don't have an account?

Getting Null Field Values
Hello.
I was wondering if I could get some guidance here.
I am setting up a new Visualforce work order input screen and am having issues. Specifically...
1) A Master Object record value (Services_Type__c) is used to name each Work Order record.
2) This Master Object record also has a corresponding numerical value that represents the duration required for each piece of work (Days_to_Complete__C).
3) Each VF entry screen is comprised of three work order records.
4) For reasons not relevant to this discussion, I need to compute the largest value of the Days_to_Complete__C value for each three-record group - and place this value in the Longest_Component__C field for each member of the three-record group.
My problem is that I am seeing null values in the Longest_Component__C field for all records. I am pretty sure my problem is that I am not using the getRecord or getParameters command...but I am confused as how to best approach things.
Also, I am using a custom controller.
Below is the relevant code...thanks in advance for any guidance.
LargestValue = 0;
for (Integer x = 0; x < 3; x++)
{
if(myList[x].Services_Type__r.Days_to_Complete__C > LargestValue)
{
LargestValue = myList[x].Services_Type__r.Days_to_Complete__C;
}
myList[x].Longest_Component__C = LargestValue;
}
insert myList;
It does not make sense to me that you are getting a null value, because LargestValue is being initialized with 0. I do however have some recommendations:
Regards,
Mark
One note. The Days_to_Complete__c variable is not included in my VF code...so I was wondering if I needed to something in the controller to explicitly note this field.
Thanks again.