Last active
May 11, 2021 17:11
-
-
Save rapsacnz/e813550f8fcc4e0357c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page applyBodyTag="false" controller="YourController" extensions="LookupController" docType="html-5.0" showHeader="true" sidebar="false" standardStylesheets="false"> | |
<html xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> | |
<head> | |
<apex:includeScript value="/lightning/lightning.out.js"/> | |
<apex:stylesheet value="{!URLFOR($Resource.SLDS0110, 'assets/styles/salesforce-lightning-design-system-vf.css')}"/> | |
</head> | |
<body > | |
<div class="slds"> | |
<div class="slds-form-element slds-m-top--xx-small"> | |
<div class="slds-m-right--x-small" id="account_lookup"></div> | |
</div> | |
</div> | |
</body> | |
<script> | |
function initLookup() { | |
$Lightning.use("c:LookupContainer", function () { | |
$Lightning.createComponent("c:Lookup", { | |
recordId: "{!contact.AccountId}", | |
label: "Account", | |
pluralLabel: "Accounts", | |
sObjectAPIName: "Account", | |
listIconSVGPath: "/resource/SLDS0110/assets/icons/standard-sprite/svg/symbols.svg#account", | |
listIconClass: "slds-icon-standard-account", | |
callback: function(){ alert('done!'); }, | |
filter: " WHERE Name = 'Some Name' ", | |
required: required | |
}, 'account_lookup', function (cmp) {}); | |
}); | |
} | |
initLookup(); | |
</script> | |
</html> | |
</page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can we add this on vf page button click? I tried it and not working.
<button id="test" onclick="initLookup()" >sync</button>