• AJAY KRISHNA R
  • NEWBIE
  • 45 Points
  • Member since 2017

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

I've run across what seems to be a bug. I've contact support but they closed my case. Hopefully I can get that re-opened, but until then maybe somebody here can help file an official bug and I hope this can help somebody else. I've been tearing my hair out over this!

 

This has happened on a few objects so it's not object specific. However in this example I have an object called CustomerSpecialInstruction which has a Master-Detail field to account.

 

BUG OVERVIEW

 

When using <apex:inlineEditSupport/> within a pageBlockTable which outputs columns and headers automatically using <apex:column value="{!someField}"/> just like the example in the pageBlockTable documentation, only the last row of the table updates when the page is saved. The inline editing quick start documentation also lists taht the inlineEditSupport tage can be a descendant of pageBlockTable so according to the documentation this should work.

 

These screenshots show the issue:

 

BEFORE SAVING

 

Here, I've edited all 3 rows. When clicking save you'd expect that all 3 rows are updated to the values you see here.

To reproduce, try saving multiple rows of data in an inline editable pageBlockTable which doesn't use apex:outputField

 

AFTER SAVING

 

You see that updates are only applied to the last row for the column that didn't use an outputField to display the value (Archived). The Name column was updated for all records because the value was outputted using outputField instead of apex:column. To see where I made this workaround, see where I have a comment saying DEBUG TESTING in my VisualForce code below.

 

Perhaps there's some internal ID conflict with the auto generated code that makes inline editing work.

 

Saving does not work\

 

DETAILS / CODE

 

I've made an extension to Account to create a getter to query any CustomerSpecialInstruction__c objects where Account__c == Account.Id as follows:

 

global without sharing class CustomerSpecialInstructionsDebug {
	
	private Account customer;
	private CustomerSpecialInstruction__c[] customerSpecialInstructions; 
	
	public CustomerSpecialInstructionsDebug(ApexPages.StandardController stdController) {
		this.customer = (Account) stdController.getRecord();
	}
	
	public PageReference saveAll() {
		update customerSpecialInstructions;
		return null;
	}
	
	public CustomerSpecialInstruction__c[] getCustomerSpecialInstructions() {
		if (customerSpecialInstructions == null) {
			customerSpecialInstructions = [ SELECT Name, Description__c, Archived__c
				FROM CustomerSpecialInstruction__c
				WHERE Account__c = :customer.Id ];
		}
		return customerSpecialInstructions;
	}
}

 

Then I have a page with a pageBlockTable with inlineEditing enabled:

 

<apex:page standardController="Account" extensions="CustomerSpecialInstructionsDebug" showHeader="false" sidebar="false">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton action="{!saveAll}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Customer Special Instructions" columns="1">
            	<apex:pageBlockTable value="{!customerSpecialInstructions}" var="instruction">
            		<apex:inlineEditSupport />
            		<apex:column width="40">
            			<apex:outputLink value="{!URLFOR($Action.CustomerSpecialInstruction__c.View, instruction)}">View</apex:outputLink>
            		</apex:column>
            		<apex:column value="{!instruction.Archived__c}"/>
            		<!-- DEBUG TESTING: Removed inline edit column and replaced with an inputField and everything works as expected! -->
            		<!-- <apex:column value="{!instruction.Name}"/> -->
            		<apex:column >
            			 <apex:outputField value="{!instruction.Name}"/>  
            		</apex:column>
            	</apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

I should be able to use this format for every column but I've discovered that when I do so, only 1 record saves: <apex:column value="{!instruction.Archived__c}"/> 

 

While writing up this simplified test case, I realized that if I explcitly define outputField here with inline editing (see instruction.Name vs the commented out version above it), everything works fine!

 

How can I get this bug fixed? Am I doing something wrong?

 

Thanks!

  • October 16, 2012
  • Like
  • 0
Challenge Not yet complete... here's what's wrong:  There was an unexpected error while verifying this challenge. Usually, this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: HGSGLHNZ
 
I have successfully implemented Einstein bot with Skill based Routing. But when I change the routing to Omni-Channel I am not getting connected to the Bot. I use snap-ins and fill my Pre-chat page it then shows connecting to a an agent then chat gets timed out. However it works fine when I use Skill based routing.
Hi All,

I am invoking a @InvocableMethod from my Einstein Bot and unfortunately, it seems to have some error and the chat get transferred to a Live agent and stops. I need to debug my @InvocableMethod in order to understand the error. I have tried with logs in developer console and Debug Logs but nothing gets recorded when Invoking the method. Please share your insights on this issue.

Thanks and Regards
Ajay Krishna R
Challenge Not yet complete... here's what's wrong:  There was an unexpected error while verifying this challenge. Usually, this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: HGSGLHNZ
 
Hi,
Here is my component. with the help of this component m trying to insert record in my Custom object Mentotr__c. But my records is nnot saving on button click
Component:
<aura:component controller="createMentor" implements="lightning:actionOverride,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
    <aura:attribute name="newMentor" type="Mentor__c" default="{'sobjectType': 'Mentor__c',
                                                               'Name': '',
                                                               'Email__c': '',
                                                               'Phone__c': '',
                                                               'No_of_Inters__c': '',
                                                               'No_of_Sessions__c': '',
                                                               'No_of_Sessions_Taken__c': '',
                                                               'Session__c': ''}"/>
    <!-- Create attribute to store lookup value as a sObject--> 
    <aura:attribute name="selectedLookUpRecord" type="sObject" default="{}"/>
    
    <ui:button class="slds-align_absolute-center" label="Click Me To Popup!!!" press="{!c.openmodal}"  /> 
    <div role="dialog" tabindex="-1" aria-labelledby="header43" aura:id="Modalbox" class="slds-modal slds-modal_large">
        <div class="slds-modal__container" style="width: 65%;">
            <div class="slds-modal__header">
                CREATE
            </div>
            <div class="slds-modal__content slds-p-around--medium">
                <!--FIRSTSECTION-->
                <div class="slds-p-left_xx-large slds-p-right_xx-large">
                    <div class="slds-page-header" style="padding-top: 9px; padding-bottom: 9px;, padding-right: 9px;, padding-left: 10px;">
                        <h3 style="font-size: 1rem;" title="">Intern Information</h3>
                    </div> 
                </div>    
                <div class="slds-grid slds-p-top_medium">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <lightning:input label="Name" name="myname"  /> 
                    </div>
                    <div class="slds-size_5-of-12 slds-p-left_xx-small slds-p-horizontal_x-large " >
                        <lightning:input label="Email" name="myname" /> 
                    </div>
                </div>
                <div class="slds-grid slds-p-top_x-small">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <lightning:input label="Phone" name="myname"  /> 
                    </div>
                    <div class="slds-size_5-of-12 slds-p-left_xx-small slds-p-horizontal_x-large " >
                        <c:customLookupCmp objectAPIName="Intern__c"
                                               IconName="standard:Intern__c" 
                                               selectedRecord="{!v.selectedLookUpRecord}" 
                                               label="Intern Name"/>
                    </div>
                </div>
                <div class="slds-grid slds-p-top_x-small">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <c:customLookupCmp objectAPIName="Session__c" 
                                               IconName="standard:Session__c" 
                                               selectedRecord="{!v.selectedLookUpRecord}" 
                                               label="Session Name"/> 
                    </div>
                    
                </div>
                
                <!--SECONDSECTION-->
                <div class="slds-p-left_xx-large slds-p-right_xx-large slds-p-top_medium">
                    <div class="slds-page-header" style="padding-top: 9px; padding-bottom: 9px;, padding-right: 9px;, padding-left: 10px;">
                        <h3 style="font-size: 1rem;" title="">Count Records</h3>
                    </div> 
                </div>    
                <div class="slds-grid slds-p-top_medium">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <lightning:input label="No of Interns" name="myname"  /> 
                    </div>
                    <div class="slds-size_5-of-12 slds-p-left_xx-small slds-p-horizontal_x-large " >
                        <lightning:input label="No of Sessions" name="myname" /> 
                    </div>
                </div>
                <div class="slds-grid slds-p-top_x-small">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <lightning:input label="No of Sessions Taken" name="myname"  /> 
                    </div>
                    </div>
            </div>
            <div class="slds-modal__footer">
                <ui:button label="Save" press="{!c.saveMentor}"/>
                <ui:button label="Close" press="{!c.closeModal}"/>
            </div>
        </div>
    </div>
    <div class="slds-backdrop " aura:id="Modalbackdrop"></div>   
</aura:component>
JS Controller:
({
	closeModal:function(component,event,helper){    
		var cmpTarget = component.find('Modalbox');
		var cmpBack = component.find('Modalbackdrop');
		$A.util.removeClass(cmpBack,'slds-backdrop--open');
		$A.util.removeClass(cmpTarget, 'slds-fade-in-open'); 
    	},
	openmodal:function(component,event,helper) {
		var cmpTarget = component.find('Modalbox');
		var cmpBack = component.find('Modalbackdrop');
		$A.util.addClass(cmpTarget, 'slds-fade-in-open');
		$A.util.addClass(cmpBack, 'slds-backdrop--open'); 
	},
    saveMentor: function(component, event, helper) {
        var mntr = component.get("v.newMentor");
        var action = component.get("c.CreateMentor");
        action.setParams({ 
            "mntr": mntr
        });
        action.setCallback(this, function(a) {
            var state = a.getState();
            if (state === "SUCCESS") {
               // var name = a.getReturnValue();
                document.getElementById("backGroundSectionId").style.display = "none";
                document.getElementById("newMentorSectionId").style.display = "none";
            }else if (a.getState() === "ERROR") {
                $A.log("Errors", a.getError());
            }
        });
        $A.enqueueAction(action)
    },
})

Apex Class:
public class createMentor {
    @AuraEnabled
    public static void CreateMentor(Mentor__c mntr){
        insert mntr;
    }
}
Thanks
Hi,
I have a vf page which has several page block tables on all with inline edit support enabled. Within the tables there are controlling(Product_Category__c) and dependent(Make__c) picklists. My issue is that the the controlling picklist has a FLS of read only as it is set via a trigger, when I put this field onto the vf page, I get the error of 'The inline edit-enabled dependent picklist 'Make' requires its controlling field 'Product Category' to be present on the page.' when a profile other than system admin views the page. If I remove the read only flags from the FLS and set it at a page layout level, the user can then view the vf page, but the controlling field becomes editable.
Does anyone have any suggestions how I can get around this?

This is my vf page.  I have several pageblocktables within the page, but I've removed all but one for ease of reading.

Many thanks for any help
<apex:page standardController="Account" extensions="SiteSurvey"> 
    <apex:form >        
        <apex:pageBlock id="Block1" title="Active assets for {!Account.Name}" >
            <apex:panelGrid columns="2">
                <apex:commandButton value="View as PDF" action="{!printAsPDF}"/>
                <apex:commandButton value="View as xls" action="{!printAsXLS}"/>
            </apex:panelGrid>
            <apex:pageBlockButtons >
                <apex:commandbutton value="Save" action="{!updateAssets}" id="saveButton" style="display:none"/>
                <apex:commandButton value="Cancel" action="{!cancelAssets}" id="cancelButton" style="display:none"/>
            </apex:pageBlockButtons>
            
            <apex:pageBlockSection id="tsSection" collapsible="true" title="Touchscreens [{!TouchscreenAssets.size}]" columns="1" rendered="{!TouchscreenAssets.size >0}" >
                <apex:pageBlockTable value="{!TouchscreenAssets}" var="a" style="table-layout:fixed">
                    <apex:column headerValue="Asset Name:">
                        <apex:outputLink value="/{!a.ID}" target="_blank">
                            {!a.Name}
                        </apex:outputLink>
                    </apex:column>
                    <apex:column headerValue="Contract Status">
                        <apex:outputField value="{!a.Service_Contract_Status__c}"/>
                    </apex:column>                 
                    <apex:column headerValue="Category">
                        <apex:outputField value="{!a.Product_Category__c}" />
                    </apex:column>
                    <apex:column headerValue="Make" >
                        <apex:outputField value="{!a.Make__c}"/>
                    </apex:column>
                    <apex:column headerValue="Model" >
                        <apex:outputField value="{!a.Model__c}"/>
                    </apex:column>
                    <apex:column headerValue="OS" >
                        <apex:outputField value="{!a.Operating_System__c}"/>
                    </apex:column>
                    <apex:column headerValue="Location #" >
                        <apex:outputField value="{!a.Location_Number__c}"/>
                    </apex:column>
                    <apex:column headerValue="IP" >
                        <apex:outputField value="{!a.IP_Address__c}"/>
                    </apex:column>
                    <apex:column headerValue="User Name" >
                        <apex:outputField value="{!a.User_Name__c}"/>
                    </apex:column>
                    <apex:column headerValue="Password" >
                        <apex:outputField value="{!a.Password__c}"/>
                    </apex:column>
                    <apex:column headerValue="Drawer" >
                        <apex:outputField value="{!a.Drawer_Type__c}"/>
                    </apex:column>
                    <apex:column headerValue="Network" >
                        <apex:outputField value="{!a.Network_Communication__c}"/>
                    </apex:column>
                    <apex:column headerValue="Comms" >
                        <apex:outputField value="{!a.Communication_Method__c}"/>
                    </apex:column>
                    <apex:column headerValue="Prox" >
                        <apex:outputField value="{!a.Prox_Type__c}"/>
                    </apex:column>
                    <apex:column headerValue="Desc" >
                        <apex:outputField value="{!a.Description}" style="white-space:normal"/>
                    </apex:column>
                    <apex:inlineEditSupport event="onClick" showOnEdit="saveButton, cancelButton"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
            <script> 
            twistSection(document.getElementById('{!$Component.Block1.tsSection}').getElementsByTagName('img')[0])
            </script>
      </apex:pageBlock>
    </apex:form>
</apex:page>

 
Hi,
I am new to Salesforce and i facing problem in making a test class for this trigger.
Any help would be appreciated.
Thanks in advance

trigger PreventContactDeletion on Contact (before delete) {

    Id id1 = userinfo.getProfileId();
    
    String  profileName = [select name from profile where id=:id1].Name;   
        
    for(Contact con : Trigger.old)
    {
        if(profileName =='Sales' & con.Contact_Type__c=='Billing')
        {
            con.addError('Contact with type Billing cannot be deleted');
        }
    }

}
Hi All,

I am invoking a @InvocableMethod from my Einstein Bot and unfortunately, it seems to have some error and the chat get transferred to a Live agent and stops. I need to debug my @InvocableMethod in order to understand the error. I have tried with logs in developer console and Debug Logs but nothing gets recorded when Invoking the method. Please share your insights on this issue.

Thanks and Regards
Ajay Krishna R

I've run across what seems to be a bug. I've contact support but they closed my case. Hopefully I can get that re-opened, but until then maybe somebody here can help file an official bug and I hope this can help somebody else. I've been tearing my hair out over this!

 

This has happened on a few objects so it's not object specific. However in this example I have an object called CustomerSpecialInstruction which has a Master-Detail field to account.

 

BUG OVERVIEW

 

When using <apex:inlineEditSupport/> within a pageBlockTable which outputs columns and headers automatically using <apex:column value="{!someField}"/> just like the example in the pageBlockTable documentation, only the last row of the table updates when the page is saved. The inline editing quick start documentation also lists taht the inlineEditSupport tage can be a descendant of pageBlockTable so according to the documentation this should work.

 

These screenshots show the issue:

 

BEFORE SAVING

 

Here, I've edited all 3 rows. When clicking save you'd expect that all 3 rows are updated to the values you see here.

To reproduce, try saving multiple rows of data in an inline editable pageBlockTable which doesn't use apex:outputField

 

AFTER SAVING

 

You see that updates are only applied to the last row for the column that didn't use an outputField to display the value (Archived). The Name column was updated for all records because the value was outputted using outputField instead of apex:column. To see where I made this workaround, see where I have a comment saying DEBUG TESTING in my VisualForce code below.

 

Perhaps there's some internal ID conflict with the auto generated code that makes inline editing work.

 

Saving does not work\

 

DETAILS / CODE

 

I've made an extension to Account to create a getter to query any CustomerSpecialInstruction__c objects where Account__c == Account.Id as follows:

 

global without sharing class CustomerSpecialInstructionsDebug {
	
	private Account customer;
	private CustomerSpecialInstruction__c[] customerSpecialInstructions; 
	
	public CustomerSpecialInstructionsDebug(ApexPages.StandardController stdController) {
		this.customer = (Account) stdController.getRecord();
	}
	
	public PageReference saveAll() {
		update customerSpecialInstructions;
		return null;
	}
	
	public CustomerSpecialInstruction__c[] getCustomerSpecialInstructions() {
		if (customerSpecialInstructions == null) {
			customerSpecialInstructions = [ SELECT Name, Description__c, Archived__c
				FROM CustomerSpecialInstruction__c
				WHERE Account__c = :customer.Id ];
		}
		return customerSpecialInstructions;
	}
}

 

Then I have a page with a pageBlockTable with inlineEditing enabled:

 

<apex:page standardController="Account" extensions="CustomerSpecialInstructionsDebug" showHeader="false" sidebar="false">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton action="{!saveAll}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Customer Special Instructions" columns="1">
            	<apex:pageBlockTable value="{!customerSpecialInstructions}" var="instruction">
            		<apex:inlineEditSupport />
            		<apex:column width="40">
            			<apex:outputLink value="{!URLFOR($Action.CustomerSpecialInstruction__c.View, instruction)}">View</apex:outputLink>
            		</apex:column>
            		<apex:column value="{!instruction.Archived__c}"/>
            		<!-- DEBUG TESTING: Removed inline edit column and replaced with an inputField and everything works as expected! -->
            		<!-- <apex:column value="{!instruction.Name}"/> -->
            		<apex:column >
            			 <apex:outputField value="{!instruction.Name}"/>  
            		</apex:column>
            	</apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

I should be able to use this format for every column but I've discovered that when I do so, only 1 record saves: <apex:column value="{!instruction.Archived__c}"/> 

 

While writing up this simplified test case, I realized that if I explcitly define outputField here with inline editing (see instruction.Name vs the commented out version above it), everything works fine!

 

How can I get this bug fixed? Am I doing something wrong?

 

Thanks!

  • October 16, 2012
  • Like
  • 0