-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
6Questions
-
6Replies
std controller save() didn't save the change of the field.
controller.save(); didn't save the change of the field.
Checking...
after clicking a button in a detail page
the VF page with this extension opened in a new window, showing some message correctly
close and go back to the detail page, do a refresh, the field remain the same as 'New'.
is it the way to call save() here?
[code partially]
public RequestControllerExtension(ApexPages.StandardController stdController)
{
controller=stdController;
doConfirm();
}
private void doConfirm()
{
this.req=(Request__c)controller.getRecord();
if(req.Status__c=='New')
{
req.Status__c='Dispatched';
controller.save();
Msg='Change status:' + req.Status__c + '.';
}
else
{
Msg='Invalid status:' + req.Status__c + '.';
}
}
Question found after :
- maxout2
- February 22, 2011
- Like
- 0
- Continue reading or reply
can std getrecord() be used in extension's constructor
the getrecord() of the standard controller is used within a constructor method of custom object's extension controller.
when accessing a field of the custom object afterwords, error comes:
System.SObjectException: SObject row was retrived via SOQL without querying the requested field: Status__c
Class.xxxControllerExtension.<init>: line ? colum ?
is this banned to use getrecord in constructor?
Tryed moving doConfirm() out of constructor, say a public void test method, got the same error?
Tryed accessing standard field [Id], ok, return the right id passed in through a custom button click;
Tryed accessing standard field [Name], same error;
the code seems normal after looking around. but what's wrong or missing? idea? any doc?
[code partially]
public RequestControllerExtension(ApexPages.StandardController stdController)
{
controller=stdController;
doConfirm();
}
private void doConfirm()
{
this.req=(Request__c)controller.getRecord();
if(req.Status__c=='New')
{
req.Status__c='Dispatched';
controller.save();
Msg='Change status:' + req.Status__c + '.';
}
else
{
Msg='Invalid status:' + req.Status__c + '.';
}
}
I found a similar Q:
- maxout2
- February 21, 2011
- Like
- 0
- Continue reading or reply
Parent ID is null when creating child object through related list
Parent ID is null when creating child object through related list if the parent id field isn't in the child's layout.
Does it make sense.
- maxout2
- February 15, 2011
- Like
- 0
- Continue reading or reply
Tracking related metadata files in IDE
After creating a 'field dependencies' at the web site, the related metadata files cannot be found in the IDE [add/remove metadata component] yet.
The question is how to find the match items when you create an item online. Is there a matching table, since some items are not found by name matching only, though some common objects are easy to find.
Then, after checking the custom object's file, the details are included. The thing is when the details are kept in separate metadata files.
BTW, what is [object translation]? Wondering how it is related to one of the custom object I am working on. some components are name after the custom object, and kept in this group.
- maxout2
- February 14, 2011
- Like
- 0
- Continue reading or reply
Is there a limitation for dataloader to connect to free force.com test org?
I have both IE and IDE login successful. but fail on trying dataloader.
- maxout2
- February 01, 2011
- Like
- 0
- Continue reading or reply
Error when deploy standard profile from IDE to test org
# Deploy Results:
File Name: profiles/Force%2Ecom - Free User.profile
Full Name: Force%2Ecom - Free
User Action: NO ACTION
Result: FAILED
Problem: Cannot rename standard profile
with or without some security settings
Is this normal? Cheers
http://boards.developerforce.com/t5/Apex-Code-Development/problems-deploying-profiles/m-p/206696
- maxout2
- January 31, 2011
- Like
- 0
- Continue reading or reply
Adding the Salesforce Standard "View" elements to my Custom Tab
I'm overriding the default tab view for the Case object. It's all easy enough to add access to existing views via a dropdown, just like the default tab would have
<apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="list"/> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList>
But of course an overriden tab should provide the preexisting functionality which enables the user to create new views, edit existing ones, etc. So is there a way I can leverage salesforce's code to provide the standard view links like below (Create New View | Edit | Delete | Refresh) in my custom visual force page?
Cheers,
Tyler
- MrTheTyler
- February 26, 2011
- Like
- 0
- Continue reading or reply
std controller save() didn't save the change of the field.
controller.save(); didn't save the change of the field.
Checking...
after clicking a button in a detail page
the VF page with this extension opened in a new window, showing some message correctly
close and go back to the detail page, do a refresh, the field remain the same as 'New'.
is it the way to call save() here?
[code partially]
public RequestControllerExtension(ApexPages.StandardController stdController)
{
controller=stdController;
doConfirm();
}
private void doConfirm()
{
this.req=(Request__c)controller.getRecord();
if(req.Status__c=='New')
{
req.Status__c='Dispatched';
controller.save();
Msg='Change status:' + req.Status__c + '.';
}
else
{
Msg='Invalid status:' + req.Status__c + '.';
}
}
Question found after :
- maxout2
- February 22, 2011
- Like
- 0
- Continue reading or reply
can std getrecord() be used in extension's constructor
the getrecord() of the standard controller is used within a constructor method of custom object's extension controller.
when accessing a field of the custom object afterwords, error comes:
System.SObjectException: SObject row was retrived via SOQL without querying the requested field: Status__c
Class.xxxControllerExtension.<init>: line ? colum ?
is this banned to use getrecord in constructor?
Tryed moving doConfirm() out of constructor, say a public void test method, got the same error?
Tryed accessing standard field [Id], ok, return the right id passed in through a custom button click;
Tryed accessing standard field [Name], same error;
the code seems normal after looking around. but what's wrong or missing? idea? any doc?
[code partially]
public RequestControllerExtension(ApexPages.StandardController stdController)
{
controller=stdController;
doConfirm();
}
private void doConfirm()
{
this.req=(Request__c)controller.getRecord();
if(req.Status__c=='New')
{
req.Status__c='Dispatched';
controller.save();
Msg='Change status:' + req.Status__c + '.';
}
else
{
Msg='Invalid status:' + req.Status__c + '.';
}
}
I found a similar Q:
- maxout2
- February 21, 2011
- Like
- 0
- Continue reading or reply
Is there a limitation for dataloader to connect to free force.com test org?
I have both IE and IDE login successful. but fail on trying dataloader.
- maxout2
- February 01, 2011
- Like
- 0
- Continue reading or reply
Field dependencies don't work with custom controllers?
- Steve Chadbourn
- March 18, 2008
- Like
- 0
- Continue reading or reply