You need to sign in to do that
Don't have an account?
Bill Woodson
Field value in controller
Hello,
I have a custom VF page that works exactly how I need, I am successfully inserting a new custom object (CO). However I want to modify the Body property of CO before inserting it. The code below shows what I am trying to do. However the custom object record created has the following resulting string in the Body property (I put the word "test") into the orginal custom object body
"null null work at null
test"
Can someone tell me what I am missing? The if statement does execute so I know that the custom object has properties set.
Here is the code...
At the top of the controller I have this line
public final LT_Note__c Note{get;set;}
public PageReference saveCO() {
if(CO.Backdoor__c) {
CO.Body__c = CO.Contact__r.FirstName + ' ' + CO.Contact__r.LastName + ' work at ' + CO.Client__r.Name + '\n' CO.Body__c;
}
insert CO;
}
I have a custom VF page that works exactly how I need, I am successfully inserting a new custom object (CO). However I want to modify the Body property of CO before inserting it. The code below shows what I am trying to do. However the custom object record created has the following resulting string in the Body property (I put the word "test") into the orginal custom object body
"null null work at null
test"
Can someone tell me what I am missing? The if statement does execute so I know that the custom object has properties set.
Here is the code...
At the top of the controller I have this line
public final LT_Note__c Note{get;set;}
public PageReference saveCO() {
if(CO.Backdoor__c) {
CO.Body__c = CO.Contact__r.FirstName + ' ' + CO.Contact__r.LastName + ' work at ' + CO.Client__r.Name + '\n' CO.Body__c;
}
insert CO;
}
Because your traversing a relationship to Contact from your CO I would most likely guess that you have not queried or set the properties of the contact correctly.
Unfortunately without more details on your VF page and the controller (where the CO property and the contact information is being set) I can not help further.
Tyler