• Ruchika Choudhary
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 1
    Replies
I can't find a way to insert the field values of the parent object that are being used in the fieldset on the child object. Below is my code and I get the null values. I can only successfully insert the values in the Job object. Not sure if my approach is correct to use the parent object fields in the child fieldset.


public with sharing class fieldsetJobApplication
{
// Job object has a lookup to the Candidate object
// The fieldset is on the Job object and is referring few fields on the Candidate object
// From the VF page on insert the values into the Job object are inserted fine but the fieldset values on the Candidate object remain null

public Job__c jA {get;set;}
public Candidate__c jC {get;set;}

public fieldsetJobApplication()
{
jA = new Job__c();
jC = new Candidate__c();
}

public PageReference save()
{
assignValues();

// Insert Candidate record
insert jC;
// Provide the parent Id to child record for reference
jA.Candidate__c = jC.Id;

// All below show as null values on System.debug
System.debug('jA.Interviewer__c : ' + jA.Candidate__r.Interviewer__c);
System.debug('jA.Start_Date__c : ' + jA.Candidate__r.Start_Date__c);
System.debug('jA.Education__c : ' + jA.Candidate__r.Education__c);

System.debug('jC.Interviewer__c : ' + jC.Interviewer__c);
System.debug('jC.Start_Date__c : ' + jC.Start_Date__c);
System.debug('jC.Education__c : ' + jC.Education__c);

insert jA;

return new pagereference('/'+jA.id);
}

public List getFldsJA()
{
return SObjectType.Job__c.FieldSets.JA_Fieldset.getFields();
}
}

// VF Markup

<apex:page controller="fieldsetJobApplication">
     <apex:form >
        <apex:pageMessages />
        <apex:pageBlock title="Job Application">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" />
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Job Application and Candidate Fields" >
                <apex:repeat value="{!FldsJA}" var="j">
                    <apex:inputField value="{!jA[j]}" />
                </apex:repeat>
            </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>      
</apex:page>


Hi All,
Do anyone has ever worked on building UB-04 form in VF page?

UB-04 Form:
http://www.bcbsnc.com/assets/providers/public/pdfs/ub04.pdf

It would be helpful if any one have dimensions for each of the cell present in the form.

Thanks,

Shivangi