You need to sign in to do that
Don't have an account?
Valli K
i want to create a lightning component same functionality as below existing vf page :
<apex:page standardController="Opportunity" extensions="Optydoc">
<script>
var i = 0;
window.onload = function(){
document.getElementById('hiddenform').submit();
}
function countalert(){
i++;
if(i===3){
window.parent.location.reload();
}
}
</script>
<form id="hiddenform" action="{!iframeURL}" target="JavaApplication" method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="source" value="SFDC"/>
<input type="hidden" name="opportunityId" value="{!OppId}"/>
<input type="hidden" name="accountId" value="{!AccId}"/>
<input type="hidden" name="primaryAssociation" value="Opportunity"/>
</form>
<apex:pageblock id="upload">
<apex:pageBlockSection title="Upload Documents" columns="1">
<iframe id="JavaApplication" name="JavaApplication" style="display:block;width:100%;height:550px" scrolling="no" ></iframe>
</apex:pageBlockSection>
<apex:pageMessages ></apex:pageMessages>
</apex:pageblock>
</apex:page>
=====================
public with sharing class Optydoc {
public String iFrameURL { get; set; }
public Id OppID { get; set; }
public Id AccID {
get{
if(OppID!=null){
Opportunity opp = [select AccountId from Opportunity Where Id=: OppID];
return opp.AccountID;
}
return null;
}
set;
}
public Optydoc(ApexPages.StandardController stdController) {
OppID = stdController.getRecord().Id;
try{
iframeURL = CustomSetting__c.getInstance('JavaApplication').endPointURL__c;
System.debug('Exceptionrwrr'+iframeURL);
}catch(Exception e){
System.debug('Exception'+e);
}
}
<script>
var i = 0;
window.onload = function(){
document.getElementById('hiddenform').submit();
}
function countalert(){
i++;
if(i===3){
window.parent.location.reload();
}
}
</script>
<form id="hiddenform" action="{!iframeURL}" target="JavaApplication" method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="source" value="SFDC"/>
<input type="hidden" name="opportunityId" value="{!OppId}"/>
<input type="hidden" name="accountId" value="{!AccId}"/>
<input type="hidden" name="primaryAssociation" value="Opportunity"/>
</form>
<apex:pageblock id="upload">
<apex:pageBlockSection title="Upload Documents" columns="1">
<iframe id="JavaApplication" name="JavaApplication" style="display:block;width:100%;height:550px" scrolling="no" ></iframe>
</apex:pageBlockSection>
<apex:pageMessages ></apex:pageMessages>
</apex:pageblock>
</apex:page>
=====================
public with sharing class Optydoc {
public String iFrameURL { get; set; }
public Id OppID { get; set; }
public Id AccID {
get{
if(OppID!=null){
Opportunity opp = [select AccountId from Opportunity Where Id=: OppID];
return opp.AccountID;
}
return null;
}
set;
}
public Optydoc(ApexPages.StandardController stdController) {
OppID = stdController.getRecord().Id;
try{
iframeURL = CustomSetting__c.getInstance('JavaApplication').endPointURL__c;
System.debug('Exceptionrwrr'+iframeURL);
}catch(Exception e){
System.debug('Exception'+e);
}
}
Valli K
Please help me in creating lightning component for the above code.