Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <apex:page standardController="Opportunity" extensions="CreateOpp" tabStyle="Opportunity">
  2. <apex:PageBlock>
  3. <apex:pageBlockSection title="Opportunity Information" columns="2">
  4. <apex:inputField value="{!Opportunity.AccountId}">
  5. </apex:inputField>
  6. <apex:inputField value="{!Opportunity.Text__C}" />
  7. <apex:commandLink action="{!SelectValPage}" target="_blank">Open</apex:commandLink>
  8. <apex:inputfield value="{!Opportunity.Name}" />
  9. <apex:inputField value="{!OppString.State__c}" />
  10.  
  11. <apex:inputField value="{!OppString.Country__c }" />
  12. </apex:pageblocksection >
  13. </apex:pageBlock>
  14.  
  15. </apex:form>
  16. </apex:page>
  17.  
  18. public class CreateOpp{
  19. Opportunity record;
  20. Public Id selectVal{get;set;}
  21. public CreateNewOpportunity(ApexPages.StandardController controller) {
  22. record = (Opportunity)controller.getRecord();
  23. selectVal= Apexpages.currentPage().getParameters().get('selectVal');
  24. record.Text__C = selectVal;
  25. }
  26. public PageReference SelectValPage()
  27. {
  28. PageReference pr = new PageReference('/apex/SelectValuePage?id='+record.AccountID);
  29. return pr;
  30. }
  31. }
  32.  
  33. <apex:page standardController="Account" extensions="selectValController" sidebar="false" showHeader="No">
  34. <apex:includeLightning />
  35.  
  36. <apex:form id="myForm">
  37. <apex:PageBlock id="PageBlock">
  38. <apex:pageBlockSection columns="1" >
  39. <div id="lightning"/>
  40. <script>
  41. var accountId = "{!$CurrentPage.parameters.id}";
  42.  
  43. $Lightning.use("c:LAPP", function() {
  44. var recordId = '{!$CurrentPage.parameters.recordId}';
  45. $Lightning.createComponent(
  46. "c:Lcomp",
  47. {"accountId" : accountId
  48. },
  49. "lightning",
  50. function(cmp) {
  51. console.log('component created');
  52. console.log(cmp);
  53. });
  54. });
  55. </script>
  56.  
  57. </apex:pageBlockSection>
  58. <apex:pageblockButtons >
  59. <apex:commandButton value="Select" id="Select" styleClass="hideButton" action="{!goToprevPage}" />
  60.  
  61. </apex:pageblockButtons>
  62. <apex:pageMessages />
  63. </apex:PageBlock>
  64. </apex:form>
  65. </apex:page>
  66.  
  67. public PageReference goToprevPage()
  68. {
  69. selectedVal='Texting..';
  70. PageReference pr = new PageReference('/apex/CreateOppPage?selectVal='+selectedVal );
  71. return pr;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement