You need to sign in to do that
Don't have an account?
Frank Timmons
Changes not getting saved to record
I created a VF page that will be used on the SF homepage, a checkbox users will click whenever they are going to be out of the office. I'm testing the function but when I place a checkmark in the field, the change isn't getting saved to my own user record. I thought everything was set up correctly but it's not working as expected. Can someone help?
<apex:page standardController="User" standardStylesheets="true">
<apex:form >
<apex:pageBlock mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value=" Save "> </apex:commandButton>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2">
<apex:inputField value="{!User.Out_of_Office__c}"></apex:inputField>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>
<apex:page standardController="User" standardStylesheets="true">
<apex:form >
<apex:pageBlock mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value=" Save "> </apex:commandButton>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2">
<apex:inputField value="{!User.Out_of_Office__c}"></apex:inputField>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>
Apex Page:
Extension class:
I tested it and it worked for me.
Thx
All Answers
Frank,
that should work.
Be sure to load the page with your user context that is, add ?id=0051a000000odGL after your apex page.
to find your id go to setup/administer/Manage users/users click on you name,
you should see in the URL: https://na24.salesforce.com/0051a000000odGL?noredirect=1 where 0051a000000odGL is the ID for you as the user.
add ?id=0051a000000odGL to the end of the apex page like below: my apex page is ooo (for out of office).
https://c.na24.visual.force.com/apex/ooo?id=0051a000000odGL
now load the page, change it, save and you should see it reflected.
Thx
Apex Page:
Extension class:
I tested it and it worked for me.
Thx