0

Is it possible to update a different visualforce page using the "oncomplete" function?

I have a visualforce page that I would like to have the ability to refresh various other Visualforce pages when saved.

Apprentice Details

<apex:page lightningStylesheets="true" showHeader="false" standardController="Apprentice__c">
      <apex:form>
           <apex:detail oncomplete="Rerender{VisualforcePage1, VisualforcePage2}" id="AppDetails" title="false" inlineEdit="true"/> 
      </apex:form> 
</apex:page>

Here is the visualforce page I would like to update:-

<apex:page lightningStylesheets="true" showHeader="false" standardController="Opportunity">
    <apex:form >
        <apex:detail id="OppDetails" inlineEdit="true"/> 
    </apex:form>
</apex:page>

enter image description here

Can I cross reference visualforce pages to update with Apex:detail oncomplete?

EDIT:- Here is a link to one of my previous questions to help clear up what all this is doing. Previous Question. Originally I started off just showing one visualforce page but now Im showing other visualforce pages that use the details function to display across objects.

<apex:page lightningStylesheets="False" showHeader="false" standardController="Apprentice__c">
<apex:form >
    <font size="3"><B><apex:outputField Value="{! Apprentice__c.Apprentice_name__c}"/></B></font>
    <apex:detail id="AppDetails" title="false" inlineEdit="true"/> 
</apex:form> 

Sorry for poor explanation.

  • Can you share details on how both VF pages are related to one another? are they displayed together somehow? It looks like they are both contained inside of a larger page? Can you share more details? – Sebastian Kessel Apr 11 '19 at 15:46
  • The VF pages are iframes of related objects so I can edit all related Items within one object and hop across tabs. – Daniel Bleasdale Apr 11 '19 at 17:24
  • "iframes of related objects"? Would you be able to be more specific, ideally with technical details? Feel free to update your question. – Sebastian Kessel Apr 11 '19 at 17:41
0

What I have done in last for this is, on onComplete you can make a checkbox true on the object page layout or UI your VF page is added on. In the other visualforce page you just render the specific block or the entire page when the checkbox is tru/false based on your need. That’s only way to link them if they are on same layout for an object.

If that doesn’t work, I think you can look at reloading the whole other page from your hs function and call the js function in oncomplete.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.