• ivantsy
  • NEWBIE
  • 50 Points
  • Member since 2010

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
I have been playing around with creating approval processes and I can make it so that when one user submits a new record for approval another user gets an email.  I was thinking there would be a way to cause the user whose approval is needed to get an item added to their "My Tasks" lists on their home tab, but I can't figure out how to do this?  Is there a way?  If not, is there any other way to get pending approvals to show up on the home tab?  I was able to create a report to find unapproved records and put it on a dashboard, but I'm hoping there is a simpler way.  Thanks!

Hello!

 

When I am using {!item.SubmittedBy__c} field, I am always getting an error:

 

SObject row was retrieved via SOQL without querying the requested field: FLOGS_Access_Request__c.SubmittedBy__c

 

When I am using another fields from query, like {!item.AccessLevel__c}, I have no problem - the page is shown with AccessLevel__c field on it;

when I am using SubmittedBy__c and some other fields, I am getting that error.

 

Could somebody, please,  explain me, why page reads one filelds and does not see others?

 

SOQL statement in a custom controller:

 

      public List<FLOGS_Access_Request__c> getReq() {
            rqs = [select Id, CreatedById, CreatedDate, RequestedFor__c, RequestType__c, AccessLevel__c, 
                          LastModifiedDate, LastModifiedById, LastActivityDate, IsDeleted, SystemModstamp,
                          OwnerId, Name, Comments__c, Approver__c, ApprovalStatus__c,
                          Submitter_E_mail__c, Submitted_Date__c, SubmittedBy__c, TestField__c
                   from FLOGS_Access_Request__c
                   order by id];
                   return rqs;
      }
 

On VF page:

 

        <apex:pageBlockTable value="{!Req}" var="item" rowClasses="odd,even">
           <apex:column headerValue="Submitted By:">
              <apex:outputLink value="FLOGS_Access_Request_Detail">{!item.SubmittedBy__c}
                 <apex:param name="parReqBy" value="{!item.ID}"/>
              </apex:outputLink>
           </apex:column>

           ...
        </apex:pageBlockTable>
 

 

Thank you.

Hello!

I just started using VF with Developer license, without any previous experience in Java and HTML and trying to create approval process with custom Objects and pages using standard (built in) approval setup.

I want to show Approval history on my VF page.

As I read on I-net, I need to extend standard controller (I think there should be some Approval controller) and now, for curiosity too, I am trying to extend any standard controller (as in example below - from the Internet), but I am always getting an error:

 

Compile Error: Method does not exist or incorrect signature: stdController.getRecord() at...

 

Is it related to my Developer license, or something wrong in this code (but from other posts, i see, that many people using same code)? 

Thank you. 

 

The following class is a simple example of a controller extension:

swfobject.registerObject("clippy.d3703e55", "9");
public class myControllerExtension {    private final Account acct;        // The extension constructor initializes the private member         // variable acct by using the getRecord method from the standard         // controller.         public myControllerExtension(ApexPages.StandardController stdController) {        this.acct = (Account)stdController.getRecord();    }    public String getGreeting() {        return 'Hello ' + acct.name + ' (' + acct.id + ')';    }}

The following Visualforce markup shows how the controller extension from above can be usedin a page:

swfobject.registerObject("clippy.d3703e64", "9");
<apex:page standardController="Account" extensions="myControllerExtension">    {!greeting} <p/>    <apex:form>        <apex:inputField value="{!account.name}"/> <p/>        <apex:commandButton value="Save" action="{!save}"/>    </apex:form></apex:page>

I'm trying to display a string stored as a public variable in the controller apex class onto the visualforce page.

 

Is this even possible? Here's my test code so far (it doesn't display anything...) Thanks in advance!

 

VF:

<apex:page controller="VFController">

 

  <apex:form >

      <apex:commandButton value="numCases" onclick="execute_numCases()"/>

      <apex:actionFunction action="{!numCases}" name="execute_numCases" rerender="showstate" >

   </apex:actionFunction> 

  </apex:form>

  

  <apex:outputtext style="border:1px;background-color:#F3F3EC;" value="{!log}"/>

  

  

</apex:page>

 

Controller:

 

    public String log {get; set;}

   

 

    //a test method that returns a string saying how many cases are in the system

    public string numCases(){

     Integer count= 0;

     log ='something is wrong';

     Boolean done = false;

     Case mark = [select id, CaseNumber from case order by CaseNumber limit 1];

     if (mark != null) {count++;}

     else {log = 'There are currently 0 cases in our database.'; return log;}

     while (!done){

     Case[] cases = [select id, CaseNumber from case where CaseNumber > :mark.CaseNumber order by CaseNumber limit 499 ];

     count += cases.size();

     if (cases.size() == 0) {done = true; break;}

     mark = cases[cases.size()-1];

     }

     log = 'There are currently ' +count + ' cases in our database.';

     return log;

    } 

The approval process commitsthe change to the record and then locks it down. Is there another process outthere that does not commit the change to the record until the approval has beengranted? I don’t like the idea of having the change attached to the recorduntil the approval has actually been granted. Any ideas?

  • January 28, 2010
  • Like
  • 0

Hello!

I just started using VF with Developer license, without any previous experience in Java and HTML and trying to create approval process with custom Objects and pages using standard (built in) approval setup.

I want to show Approval history on my VF page.

As I read on I-net, I need to extend standard controller (I think there should be some Approval controller) and now, for curiosity too, I am trying to extend any standard controller (as in example below - from the Internet), but I am always getting an error:

 

Compile Error: Method does not exist or incorrect signature: stdController.getRecord() at...

 

Is it related to my Developer license, or something wrong in this code (but from other posts, i see, that many people using same code)? 

Thank you. 

 

The following class is a simple example of a controller extension:

swfobject.registerObject("clippy.d3703e55", "9");
public class myControllerExtension {    private final Account acct;        // The extension constructor initializes the private member         // variable acct by using the getRecord method from the standard         // controller.         public myControllerExtension(ApexPages.StandardController stdController) {        this.acct = (Account)stdController.getRecord();    }    public String getGreeting() {        return 'Hello ' + acct.name + ' (' + acct.id + ')';    }}

The following Visualforce markup shows how the controller extension from above can be usedin a page:

swfobject.registerObject("clippy.d3703e64", "9");
<apex:page standardController="Account" extensions="myControllerExtension">    {!greeting} <p/>    <apex:form>        <apex:inputField value="{!account.name}"/> <p/>        <apex:commandButton value="Save" action="{!save}"/>    </apex:form></apex:page>
I have been playing around with creating approval processes and I can make it so that when one user submits a new record for approval another user gets an email.  I was thinking there would be a way to cause the user whose approval is needed to get an item added to their "My Tasks" lists on their home tab, but I can't figure out how to do this?  Is there a way?  If not, is there any other way to get pending approvals to show up on the home tab?  I was able to create a report to find unapproved records and put it on a dashboard, but I'm hoping there is a simpler way.  Thanks!