• Vigneshwaran G
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 1
    Replies
Am trying to get to know about the InlineEditSupport from the Saleforce documents and used the code provided there with some modifications.

This is my Visualforce page:

<apex:page standardController="Contact" extensions="inlineController">
    <apex:form >
        <apex:pageBlock id="pb">
            <apex:pageBlockButtons >               
                <apex:commandButton id="saveButton" value="Save" reRender="pb" style="display:none;"/>
                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" style="display:none;"/>
                <apex:commandButton value="Refresh" reRender="pb" action="{!refresh}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:outputField value="{!contact.lastname}" rendered="{!boolRender}">
                    <apex:inlineEditSupport showOnEdit="saveButton, cancelButton"
                        event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
                </apex:outputField>
                <apex:outputField value="{!contact.accountId}"/>
                <apex:outputField value="{!contact.phone}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

This is my Controller i added to check a functionality:

public with sharing class inlineController {
    public boolean boolRender {get; set;}
   
    public inlineController(ApexPages.StandardController controller) {
        boolRender = true;
    }
    public void refresh(){
        if(boolRender == false)
            boolRender = true;
        else
            boolRender = false;
    }
}

I used style="display:none;" in both save and cancel buttons because i want them to be invisible at start. Once i double click on the Contact Lastname these two buttons will show up.

Now comes the tricky part in which am facing issues. I used rendered="{!boolRendered}" in the Contact Lastname Outputfield, so that it will be rendered based on the condition which i set in Controller.

In constructor i set it to true and everything works fine. If is set it to false, initially the field will not be shown, on click of refresh it will be shown, but if i double click on the Contact Lastname field the two buttons not showing up.

Cause:
I think the cause for this behaviour is that the field in which inlineEditSupport is binded is not rendred initially and then the binding between the buttons are lost.

Work Around: 
I can remove style="display:none;" from both buttons, but it will always be visible which is not like standard salesforce inlilne edit.

Can anyone explain me why this is happening and can provide me any work around?
When exporting a report from Salesforce.com in either csv or xls format it takes the name as ‘report0000000000000’ in which the last 13 digits are generated randomly. Is there any way to customize this to ‘reportname_DateTime of Export’?

Thanks in advance
Am trying to get to know about the InlineEditSupport from the Saleforce documents and used the code provided there with some modifications.

This is my Visualforce page:

<apex:page standardController="Contact" extensions="inlineController">
    <apex:form >
        <apex:pageBlock id="pb">
            <apex:pageBlockButtons >               
                <apex:commandButton id="saveButton" value="Save" reRender="pb" style="display:none;"/>
                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" style="display:none;"/>
                <apex:commandButton value="Refresh" reRender="pb" action="{!refresh}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:outputField value="{!contact.lastname}" rendered="{!boolRender}">
                    <apex:inlineEditSupport showOnEdit="saveButton, cancelButton"
                        event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
                </apex:outputField>
                <apex:outputField value="{!contact.accountId}"/>
                <apex:outputField value="{!contact.phone}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

This is my Controller i added to check a functionality:

public with sharing class inlineController {
    public boolean boolRender {get; set;}
   
    public inlineController(ApexPages.StandardController controller) {
        boolRender = true;
    }
    public void refresh(){
        if(boolRender == false)
            boolRender = true;
        else
            boolRender = false;
    }
}

I used style="display:none;" in both save and cancel buttons because i want them to be invisible at start. Once i double click on the Contact Lastname these two buttons will show up.

Now comes the tricky part in which am facing issues. I used rendered="{!boolRendered}" in the Contact Lastname Outputfield, so that it will be rendered based on the condition which i set in Controller.

In constructor i set it to true and everything works fine. If is set it to false, initially the field will not be shown, on click of refresh it will be shown, but if i double click on the Contact Lastname field the two buttons not showing up.

Cause:
I think the cause for this behaviour is that the field in which inlineEditSupport is binded is not rendred initially and then the binding between the buttons are lost.

Work Around: 
I can remove style="display:none;" from both buttons, but it will always be visible which is not like standard salesforce inlilne edit.

Can anyone explain me why this is happening and can provide me any work around?
When exporting a report from Salesforce.com in either csv or xls format it takes the name as ‘report0000000000000’ in which the last 13 digits are generated randomly. Is there any way to customize this to ‘reportname_DateTime of Export’?

Thanks in advance
I'm using an Enterprise instance and am getting the following error ever time we try to edit or save a Phone number (Standard Field) on the Contact Object (Standard Object). The error is present even when entering valid us numbers (no dashes, letters, etc.)

Error:Apex trigger updateCustomObjects caused an unexpected exception, contact your administrator: updateCustomObjects: execution of AfterUpdate caused by: System.LimitException: Attempted to schedule too many concurrent batch jobs in this org (limit is 5).: Trigger.updateCustomObjects: line 73, column 1