• bivhitscar
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies

I'm going nuts and I know this is going to be something dead simple, but for some reason I can't work it out.

 

Signee__c is a Master-Detail to the Contact object. All I want to do is display the name from the contact record and at the moment it's just coming up blank. If I change the value in the repeat to a.Signee__c, I get the Id as expected. However I can't seem to access any actual data in the parent. I get no errors and I've been scouring google to work out what's wrong.

 

Ideas?

 

 

Extension:

 

public class SignOnExtension{
    ApexPages.StandardController controller;
    public SWMS_SignOn__c thisSignOn {get; set;}
    public List<SWMS_SignOn__c> attendees {get; set;}
    
    public SignOnExtension(ApexPages.StandardController c) {
        controller = c;
        thisSignOn = (SWMS_SignOn__c) controller.getRecord();
        attendees = new List<SWMS_SignOn__c>();
    }
    
    public void addSignee() {
        //create new signon and add to list
        attendees.add(new SWMS_SignOn__c(Signee__c = thisSignOn.Signee__c));
    }

}

 

 

Page:

 

<apex:page id="page" standardController="SWMS_SignOn__c" extensions="SignOnExtension" >
<apex:form id="form" >
<apex:pageBlock title="Add Attendee">
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton action="{!addSignee}" value="Add" reRender="attendeesBlock"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection >
            <apex:inputField value="{!signOn.Signee__c}"/>
        </apex:pageBlockSection>
    </apex:pageBlock>

<apex:pageBlock title="Attendees" id="attendeesBlock"> <apex:pageBlockSection columns="1"> <apex:repeat value="{!attendees}" var="a"> <apex:pageBlockSectionItem > <apex:outputLabel >Attendee</apex:outputLabel> <apex:outputLabel value="{!a.Signee__r.Name}" /> </apex:pageBlockSectionItem> </apex:repeat> </apex:pageBlockSection> </apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

 

 

 

I have a site that worked in my dev sandbox and I have now promoted to a full copy sandbox. As salesforce seems unable to add sites settings to a changeset, I've had to recreate the site.

 

My page works fine if I navigate to it from the sites, using the 'Preview as Admin' link. However, if I try to access the site as a public user, it pops up the authorisation required page. Having followed some instructions at http://www.tgerm.com/2010/10/debugging-sites-authorization-required.html I have managed to see that the actual error is 'Id value a1He00000004ZME is not valid for the Plant_RFI__c standard controller' - however, this is false, as that Id works perfectly when I am logged in.

 

The public user has full access to the object in question. It also has it's OWD set to public read/write. I am assuming I'm missing something simple, but cannot work out what I've done wrong.

Hi guys,

 

I've searched high and low for some info on what I've done wrong and can't work it out.

 

I basically want to return a list of Prestart_Checklist__c that fall within a given date range and location - this works.

 

Then for each item in the list, I want to present a text box so that a user can update the name of the record. This displays correctly and retrieves the existing data - but the save button seems ineffectual. If I change any values in the inputfields and click save, the page refreshes, but no data is saved.

 

I know I'm missing something simple, but I've wasted too much time on this one to keep hacking away at it, so any suggestions are very welcome.

 

Page:

 

<apex:page action="{!initPage}" standardController="Prestart_Checklist__c" extensions="PSCLEditExtension" >

<apex:form >
    <apex:pageBlock title="Filter results" >
        <apex:pageBlockButtons location="bottom" >
            <apex:commandButton value="Go" reRender="dataTable" />
        </apex:pageBlockButtons>
        <apex:pageBlockSection columns="1">
            <apex:inputField value="{!plantForLocation.Location__c}" />
            <apex:inputField value="{!psclForDate.Week_Ending__c}" />
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>

<apex:form >
    <apex:pageBlock title="Prestart Checklists" >
        <apex:pageBlockButtons location="bottom" >
            <apex:commandButton value="Save" action="{!save}" />
        </apex:pageBlockButtons>
        <apex:pageBlockTable id="dataTable" value="{!thisWeeksPSCLs}" var="pscl">
            <apex:column headerValue="Plant Name"> <apex:outputText value="{!pscl.Plant__r.Name}" /></apex:column>
            <apex:column headerValue="Plant Registration"> <apex:outputText value="{!pscl.Plant__r.Registration_Number__c}" /></apex:column>
            <apex:column headerValue="Prestart Checklist Number"><apex:inputField value="{!pscl.Name}" /></apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

 

public with sharing class PSCLEditExtension {
    
    public Prestart_Checklist__c psclForDate{get; set;}
    public Plant__c plantForLocation{get; set;}
    
    public List<Plant__c> listPlant {
        get {
            return [select Id, Name from Plant__c];
        }
    }
    
    public List<Prestart_Checklist__c> listPSCL{get; set;}
    
    public List<Prestart_Checklist__c> thisWeeksPSCLs{
    	get {
	    	return [select Id, Name, Plant__r.Name, Plant__r.Registration_Number__c 
	                from Prestart_Checklist__c 
	    	        where Week_Ending__c = :psclForDate.Week_Ending__c 
	    	        and Plant__r.Location__c = :plantForLocation.Location__c];
} } } public PSCLEditExtension(ApexPages.StandardController controller) { psclForDate = new Prestart_Checklist__c(Week_Ending__c = Date.today().toStartOfWeek()); plantForLocation = new Plant__c(); } public void initPage() { } }

 

I'm going nuts and I know this is going to be something dead simple, but for some reason I can't work it out.

 

Signee__c is a Master-Detail to the Contact object. All I want to do is display the name from the contact record and at the moment it's just coming up blank. If I change the value in the repeat to a.Signee__c, I get the Id as expected. However I can't seem to access any actual data in the parent. I get no errors and I've been scouring google to work out what's wrong.

 

Ideas?

 

 

Extension:

 

public class SignOnExtension{
    ApexPages.StandardController controller;
    public SWMS_SignOn__c thisSignOn {get; set;}
    public List<SWMS_SignOn__c> attendees {get; set;}
    
    public SignOnExtension(ApexPages.StandardController c) {
        controller = c;
        thisSignOn = (SWMS_SignOn__c) controller.getRecord();
        attendees = new List<SWMS_SignOn__c>();
    }
    
    public void addSignee() {
        //create new signon and add to list
        attendees.add(new SWMS_SignOn__c(Signee__c = thisSignOn.Signee__c));
    }

}

 

 

Page:

 

<apex:page id="page" standardController="SWMS_SignOn__c" extensions="SignOnExtension" >
<apex:form id="form" >
<apex:pageBlock title="Add Attendee">
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton action="{!addSignee}" value="Add" reRender="attendeesBlock"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection >
            <apex:inputField value="{!signOn.Signee__c}"/>
        </apex:pageBlockSection>
    </apex:pageBlock>

<apex:pageBlock title="Attendees" id="attendeesBlock"> <apex:pageBlockSection columns="1"> <apex:repeat value="{!attendees}" var="a"> <apex:pageBlockSectionItem > <apex:outputLabel >Attendee</apex:outputLabel> <apex:outputLabel value="{!a.Signee__r.Name}" /> </apex:pageBlockSectionItem> </apex:repeat> </apex:pageBlockSection> </apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

 

 

 

Hi guys,

 

I've searched high and low for some info on what I've done wrong and can't work it out.

 

I basically want to return a list of Prestart_Checklist__c that fall within a given date range and location - this works.

 

Then for each item in the list, I want to present a text box so that a user can update the name of the record. This displays correctly and retrieves the existing data - but the save button seems ineffectual. If I change any values in the inputfields and click save, the page refreshes, but no data is saved.

 

I know I'm missing something simple, but I've wasted too much time on this one to keep hacking away at it, so any suggestions are very welcome.

 

Page:

 

<apex:page action="{!initPage}" standardController="Prestart_Checklist__c" extensions="PSCLEditExtension" >

<apex:form >
    <apex:pageBlock title="Filter results" >
        <apex:pageBlockButtons location="bottom" >
            <apex:commandButton value="Go" reRender="dataTable" />
        </apex:pageBlockButtons>
        <apex:pageBlockSection columns="1">
            <apex:inputField value="{!plantForLocation.Location__c}" />
            <apex:inputField value="{!psclForDate.Week_Ending__c}" />
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>

<apex:form >
    <apex:pageBlock title="Prestart Checklists" >
        <apex:pageBlockButtons location="bottom" >
            <apex:commandButton value="Save" action="{!save}" />
        </apex:pageBlockButtons>
        <apex:pageBlockTable id="dataTable" value="{!thisWeeksPSCLs}" var="pscl">
            <apex:column headerValue="Plant Name"> <apex:outputText value="{!pscl.Plant__r.Name}" /></apex:column>
            <apex:column headerValue="Plant Registration"> <apex:outputText value="{!pscl.Plant__r.Registration_Number__c}" /></apex:column>
            <apex:column headerValue="Prestart Checklist Number"><apex:inputField value="{!pscl.Name}" /></apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

 

public with sharing class PSCLEditExtension {
    
    public Prestart_Checklist__c psclForDate{get; set;}
    public Plant__c plantForLocation{get; set;}
    
    public List<Plant__c> listPlant {
        get {
            return [select Id, Name from Plant__c];
        }
    }
    
    public List<Prestart_Checklist__c> listPSCL{get; set;}
    
    public List<Prestart_Checklist__c> thisWeeksPSCLs{
    	get {
	    	return [select Id, Name, Plant__r.Name, Plant__r.Registration_Number__c 
	                from Prestart_Checklist__c 
	    	        where Week_Ending__c = :psclForDate.Week_Ending__c 
	    	        and Plant__r.Location__c = :plantForLocation.Location__c];
} } } public PSCLEditExtension(ApexPages.StandardController controller) { psclForDate = new Prestart_Checklist__c(Week_Ending__c = Date.today().toStartOfWeek()); plantForLocation = new Plant__c(); } public void initPage() { } }