• Scott Kimminau
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
We have a visualforce page that has an action that basically makes a callout (after the constructor gets the contact record) and updates the contact with an attachment that is an image of the contacts drivers license. The problem is, now that we are moving to lightning, when we try to do an inline edit on the record it causes a collision detection. In console and classic we don't get the issue because lightning first does a page refresh when an inline edit is invoked (triggering the action) while classic does not. Anyone know of a possible alternative to doing to visualforce action or some way to not get the collision detection error? 
Thanks!

page: 
<apex:page standardController="Contact" extensions="IdentificationImageController" action="{!loadrecord}" >    
      <apex:form >
           <apex:inputHidden value="{!c.External_ID__c}" id="theHiddenInput"/>
    </apex:form> 
</apex:page>


controller: 
public without sharing class IdentificationImageController {
    public Contact c { get; private set; }

    public IdentificationImageController(ApexPages.StandardController controller) {

        if (!test.isRunningTest()) {
            controller.addFields(new String[]{
                    'External_Id__c'
            });
        }
        this.c = (Contact) controller.getRecord();
        system.debug(c);
    }

    public void loadRecord() {
        loadDriverIdentity();
    }

    public void loadDriverIdentity() {
        try {
            String dlName = c.External_ID__c + 'DL';
            String sigName = c.External_ID__c + 'SIG';

            .....make api callout and then update Contact info. 

}
Hi,

We have a visualforce page in our salesforce org whose contoller class makes an API call and then display the result back on the page. This was placed on a record Detail page section in classic experince. It was working as expected. And we recently switched on Lightning Experience. The problem now is the visualforce page is working fine when the user clicks on command button in the page. It is getting the expected results. But it is gving an error when the user tries to update fields on the other sections after doing the API call(clicking the command button in the visualforce page).
This is the error:

This record was modified by USER during your edit session. Make a note of the data you entered, then reload the record and enter your updates again.

I am not sure what is causing this error.

Has anyone faced this issue?
It would be great if anyone can help.
Thanks,
Yamini.