I'm trying to create a single visualforce page to update existing records on related custom objects. I've reviewed and experimented with several of the examples on the Stack Exchange but no luck. Most of the examples seem to be for creating new records. I need to show fields from both records, allow the user to make changes and then save the changes.
ObjectA - Job Order
ObjectB - Job Applicant (Job Applicant is unique and there are multiple applicants for every Job. )
A button from the Job Applicant Page will open the VisualForce Page.
apex:inputfield value="{!ObjectA.Stage__c}"<br>
apex:inputfield value="{!ObjectB.Status__c}"
I'm a 3 year Admin, 2 months into Visualforce and just starting Apex Controllers/Extensions. Examples are appreciated.
Thanks, Ed
Updated Code below
I leveraged this from LaceySnr Visualforce - Display fields from multiple objects
Here is my code... I'm still getting an error when saving the VF Page Error: Unknown property 'AVTRRT__Job_Applicant__cStandardController.AVTRRT__Job__c'
Apex Class
public with sharing class SaveExtension
{
ApexPages.StandardController sc;
public AVTRRT__Job__c objBJob {get; set;}
public SaveExtension(ApexPages.StandardController sc)
{
this.sc = sc;
objBJob = new AVTRRT__Job__c();
}
public ApexPages.PageReference SaveBoth()
{
insert objBJob;
return sc.Save();
}
}
VF Page - I've removed everything but the essentials. It works fine with the filed from the StandardController. I just can't add a field from the other object.
<apex:page StandardController="AVTRRT__Job_Applicant__c" extensions="SaveExtension">
<apex:form >
<apex:pageblock mode="edit">
<apex:inputField value="{!AVTRRT__Job_Applicant__c.AVTRRT__Stage__c}" />
<apex:inputField value="{!AVTRRT__Job__c.Job_Type__c}" />
<apex:CommandButton action="{!saveboth}" value="Save"/>
</apex:pageblock>
</apex:form>
</apex:page>
Thanks for any help!