1

I have an inline VF component grid on the Contacts page layout that I implemented using VF page and custom Apex class. The grid works absolutely fine in the Enterprise Edition; the main code for the VF page is:

<apex:page standardController="Contact" extensions="VFforEmailTemplateController">
<apex:form >
 <apex:pageBlock id="theBlock" mode="inlineEdit">
  <apex:pageBlockButtons >
    <apex:commandButton action="{!saveRecord}" id="saveButton" value="Save"/>
  </apex:pageBlockButtons>

<!-- first row -->
    <apex:pageBlockTable value="{!contact}" var="c"> 

                <apex:commandButton action="{!saveRecord}" id="saveButton" value="Save"/>

        <apex:column headerValue="Fund/Status" width="111">
            <apex:outputText >
                <b>EJF</b>
            </apex:outputText>
        </apex:column>
          <apex:column headerValue="On Approved List" width="111">
            <apex:outputField value="{!c.EJF_On_Approved__c}">
               <apex:inlineEditSupport event="ondblclick"
                                       showOnEdit="saveButton"
                                       changedStyleClass="myBoldClass" 
                                       resetFunction="resetInlineEdit"/>
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="Pending Approval" width="111">
            <apex:outputField value="{!c.EJF_Pend_App__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="Denied Approval" width="111">
           <apex:outputField value="{!c.EJF_Denied__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="Removed From Approved" width="127">
            <apex:outputField value="{!c.EJF_Removed__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="ADV Part II Sent" width="123">
            <apex:outputField value="{!c.EJF_ADV__c}"> 
                <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield> 
This code repeats for additional rows and columns.

Now the Apex class saves the users' checkbox selection; the code:

public class VFforEmailTemplateController

{
    public Contact cont { get; set; }
    public ApexPages.StandardController c;

    public VFforEmailTemplateController(ApexPages.StandardController controller)
    {
    this.cont = (Contact)controller.getRecord();
        c = controller;

    }
    public PageReference saveRecord(){
        try{
            c.save();
        }
        catch(Exception e){
        }
        return null;
    }

}

Now, I need your help to determine if the same thing can be implemented in the Pro Edition. After checking it out, my initial thoughts are it may not be possible because you can't create an Apex class. But is there a workaround as far as doing this in Pro? How would you implement the same grid if you only had Pro to work with? Thanks.

Adding a picture of my inline VF component so you understand better how the grid looks like.

enter image description here

Using the standard {!save} only accomplishes this:

enter image description here

4
  • It looks like you are just using the saveRecord method in the extension? Have you tried just using the standard controller {!save}? Commented Jul 10, 2013 at 23:48
  • Thanks for your response. Yes, I did. Since this is an inline VF component on the Contacts page, when I invoke {!save}, the entire Contacts page gets loaded in the small window/section that's meant for the grid. And I found this funny - it appears as a contact page within a contact page; a mini standard contact page (instead of my grid) within the usual contact page. I hope this makes sense.
    – Rosh
    Commented Jul 11, 2013 at 0:24
  • 2
    how about using {!quicksave}? See http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_std_actions.htm Commented Jul 11, 2013 at 4:03
  • 1
    Perfect! This works like a charm. If you can place this as an answer, I will be the first to vote it up and mark it as the right answer. Thank you very much, Daniel.
    – Rosh
    Commented Jul 11, 2013 at 5:53

3 Answers 3

1

If you switch from using a custom controller to using the standard contact controller and change the action to action="{!quicksave}", it should work. See this info on all the actions available in the standard controller.

2
  • It's been a while since I've read the new features, I suppose. I'm going to take a look at the docs again.
    – sfdcfox
    Commented Jul 11, 2013 at 14:43
  • Gentlemen, I need your help on a similar topic. Would you be able to help out? salesforce.stackexchange.com/questions/13884/…
    – Rosh
    Commented Jul 11, 2013 at 14:46
1

Generally speaking, no, Professional Edition doesn't allow custom Apex development. Last I checked you could purchase access to the development features if you're on Professional edition at an extra cost.

An alternative could be to build a managed package, hosted on AppExchange. I don't know the full details of it, but AppExchange packages that include custom Apex can be set up such that they can be installed into Professional Edition orgs.

5
  • Actually, I you can do Visualforce on PE, but only if you are using standard controllers. Commented Jul 10, 2013 at 23:49
  • Correct, I did the same thing too on PE - it's in my code: <apex:page standardController="Contact"> but Apex classes can't be created
    – Rosh
    Commented Jul 11, 2013 at 0:13
  • Ah! Good to know, will modify my response accordingly. Thanks! Commented Jul 11, 2013 at 0:13
  • PE supports Apex Code, if it is in a managed package and the package has passed a security review. In general, this means you can't generally bypass the restriction via the AppExchange. But you can certainly build the page without an extension in this case.
    – sfdcfox
    Commented Jul 11, 2013 at 2:43
  • Packages also have to be classified as 'Aloha' to be used on these other editions. Once you've put the package up and it's passed review, you then have to file a case via the partner portal to request Aloha status.
    – Matt Lacey
    Commented Jul 11, 2013 at 2:48
1

Yes, you can implement your page on Professional Edition. Remove the extension and change {!saveRecord} to just {!save}. StandardController.save() basically does what you're trying to do in your controller. In fact, the try-catch block isn't necessary anyways, since StandardController.save() doesn't throw exceptions. Instead, it returns a null PageReference on error, or StandardController.view() on success.

4
  • Since my requirement is for an inline VF component on the Contacts page, when I invoke {!save}, the entire Contacts page gets loaded in the small section that is actually meant only for the grid (entire Contacts page replaces the grid). And if, in that inline VF component (which is actually the entire Contacts page instead of the grid alone), I again trigger {!save} by clicking a checkbox, I see the whole Contacts page loaded again in the second-level (undesired) inline VF component - page within page within page! Hence the custom save method to load JUST the grid. Please share thoughts.
    – Rosh
    Commented Jul 11, 2013 at 3:19
  • Not sure you can accomplish that much. You'd be better off making it a button that the users can click to edit that info, so when they save it goes back to the page.
    – sfdcfox
    Commented Jul 11, 2013 at 3:26
  • I don't think I explained myself clearly enough. My contacts page has a simple inline VF component, which is a 6 x 8 grid. When I use {!saveRecord}, the 6 x 8 grid reloads with updated user input entered thru checkboxes. This is a simple requirement accomplished with a VF page and an extension controller that defines a custom Apex class. On the other hand, when I use standard {!save}, the 6 x 8 grid (which covers like 5% of the contacts page) is replaced with the whole contacts page itself. Please let me know if this makes sense and why I can't use {!save}
    – Rosh
    Commented Jul 11, 2013 at 3:47
  • sfdcfox, I've added pictures to the question so it is better understood. Let me know what's on your mind. Thanks.
    – Rosh
    Commented Jul 11, 2013 at 3:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .