• maxout2
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies

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 :

http://boards.developerforce.com/t5/General-Development/can-std-getrecord-be-used-in-extension-s-constructor/m-p/249103#M51890

 

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:

 

http://boards.developerforce.com/t5/Apex-Code-Development/Trouble-adding-a-getRecord-to-an-existing-Extension/m-p/128543

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.

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.

I have both IE and IDE login successful. but fail on trying dataloader.

# 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

http://boards.developerforce.com/t5/General-Development/BUG-Force-com-Migration-Tool-quot-Cannot-rename-standard-profile/m-p/184171

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

 

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 :

http://boards.developerforce.com/t5/General-Development/can-std-getrecord-be-used-in-extension-s-constructor/m-p/249103#M51890

 

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:

 

http://boards.developerforce.com/t5/Apex-Code-Development/Trouble-adding-a-getRecord-to-an-existing-Extension/m-p/128543

I have both IE and IDE login successful. but fail on trying dataloader.

I have a checkbox field and a picklist field. I set up a field dependency so that if the checkbox is checked, all the picklist values are available but if the checkbox is unchecked none of them are. It all works fine in the preview.
 
The dependency does not work however on my visualforce page.
 
The page it should work on is one of a number of wizard pages controlled by a custom controller. Should dependencies work with a custom controller?
 
When I refresh my Eclipse object from the server I cannot see any dependency information. Where is this defined?