• Gopal yadav (ASY)
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
vf page:-

<apex:page StandardController="Student__c" extensions="StudentController" tabStyle="Contact">
    <apex:slds />
    <apex:form >
        <apex:pageBlock title="Student Details">
            <apex:pageBlockSection title="Student Interface" columns="2">
                <apex:pageBlockSectionItem >
                    <div></div> 
                    <apex:outputLabel > Student Name
                        <apex:inputField styleClass="slds-input" value="{!Student__c.Name}"/>
                    </apex:outputLabel>               
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem >
                    <div class="slds-align_absolute-center"></div>
                    <apex:outputLabel >Student Id
                        <apex:inputField styleClass="slds-input" value="{!Student__c.Student_ID__c}"/> </apex:outputLabel>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem >
                    <div class="slds-align_absolute-center"></div>
                    <apex:outputLabel >Batch
                        <apex:inputField styleClass="slds-input" value="{!Student__c.Batch__c}"/></apex:outputLabel>
                </apex:pageBlockSectionItem>                   
                <apex:pageBlockSectionItem >
                    <div class="slds-align_absolute-center"></div>
                    <apex:outputLabel >Section
                        <apex:inputField styleClass="slds-input" value="{!Student__c.Section__c}"/> </apex:outputLabel>
                </apex:pageBlockSectionItem>              
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Student Functions" columns="1">
                <apex:pageBlockSectionItem >                   
                    <apex:pageBlockTable value="{!Student__c}" var="s" title="Marks" rows="1">
                        <apex:facet name="header">Marks</apex:facet>
                        <apex:column > 
                            1sem
                            <apex:facet name="header">Serial Number</apex:facet>                       
                        </apex:column>                   
                        <apex:column >                       
                            <apex:inputField value="{!s.Maths__c}"/>
                            <apex:facet name="header">Maths</apex:facet>                       
                        </apex:column>
                        <apex:column >
                            <apex:inputField value="{!s.English__c}"/>
                            <apex:facet name="header">English</apex:facet>
                        </apex:column>
                        <apex:column >
                            <apex:inputField value="{!s.Science__c}"/>
                            <apex:facet name="header">Science</apex:facet>
                        </apex:column>
                        <apex:column >
                            <apex:inputField value="{!s.Total__c}" required="true"/>
                            <apex:facet name="header">Total</apex:facet>
                        </apex:column>                   
                    </apex:pageBlockTable>
                </apex:pageBlockSectionItem>               
            </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Save" action="{!save}"/>  
            </apex:pageBlockButtons>         
        </apex:pageBlock>       
    </apex:form>   
</apex:page>




and controller is:-

public with sharing class StudentController {
    public Student__c admin{ get; set; }
    public ApexPages.StandardController stdCtrl;
    public StudentController(ApexPages.StandardController controller) {
        stdCtrl = controller;
    }
    
    public PageReference save() {
        admin=(Student__c)stdCtrl.getRecord(); 
        upsert admin;  
        system.debug(admin);
        PageReference pageRef = new ApexPages.StandardController(admin).view();
        pageRef.setRedirect(true);
        return pageRef;
    }
}





everything is working fine but the proble is i want to use method name in vf page as "admin" instead of custom object name "Student__c"  as admin.Name  not Student__c.Name

plzz help me in editing my code
Hello everyone, I've been working on this challenge in the Date Security portion of Trailhead for some time but need some help (See below)

The challenge requires a profile to be created with the following traits:
    Name: Account Reviewer
    Salesforce license type
    Only read access to Account object. (And no access to any other object in the Org)

Understand that I did read the indepth reading before hand and I created a read-only clone profile in the Accounts profile list but am stuck as how to proceed from there. Challenge error states: Challenge not yet complete ... here's what's wrong: The 'Account Reviewer' profile does not work as expected. Please Advise.
After importing all Contacts, it is still showing this error. I have tried many times but stuck with the same error. In other org it is working as expected but I am facing this issue in my org. Do not know what is happening here!