• Kimberly Aronson
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
I want to try and create a button that will save the record I am in and then close it. Is this feasible and if so how would I accommplish such a task? I am not very savy with coding so the more details/ explaination/ instruction the better. 
 
I created a VF page in SFDC lightening sandbox to covert a lead with workflow. It works, but keeps opening in classic instead of lightening and I cant figure out why. This is very new to me so I am sure I am just missign something. Code used as follows: 
<apex:page standardController="Lead" >
<apex:form>
  <div style="visibility:hidden;">
    <apex:inputField value="{!Lead.Cancel_Workflow__c}" id="cancelWorkflow" style="visibility:hidden; "/>
  </div>
  <apex:actionFunction name="quickSave" action="{!quickSave}" oncomplete="standardConvert();"/>
  <apex:actionFunction name="standardConvert"
    action="{!URLFOR($Action.Lead.Convert, lead.id, [retURL=$CurrentPage.parameters.retURL], true)}" />
  <script language="JavaScript">
    var previousOnload = window.onload;
    window.onload = function() {
      if (previousOnload) previousOnload();
      fixLead();
    }
    function fixLead() {
      var elemCancelWorkflow = document.getElementById('{!$Component.cancelWorkflow}');
      elemCancelWorkflow.checked = true;
      quickSave();
    }
  </script>
</apex:form>
</apex:page>
How do I create and apex trigger to update a chatter feed post based on the child object changes 
I want to try and create a button that will save the record I am in and then close it. Is this feasible and if so how would I accommplish such a task? I am not very savy with coding so the more details/ explaination/ instruction the better.