πŸ“™μΌμ§€_230727(EP.8)

__Dev_1Β·2023λ…„ 7μ›” 27일
0

Salesforce

λͺ©λ‘ 보기
7/15
post-thumbnail

Use Components in Salesforce Targets

πŸ’‘ Targets

🎈 targetConfig

https://developer.salesforce.com/docs/platform/lwc/guide/reference-configuration-tags.html

πŸš— sampleTarget.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordPage">
            <objects>
                <object>Contact</object>
                <object>Opportunity</object>
            </objects>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

customLwcforFlow

πŸš“ customLwcforFlow.html
<<template>
    <lightning-card title="LWC in Flow" icon-name="custom:custom63">
        <div class="slds-m-around_medium">
            <b> Account Name : {AccountName}  </br>
                Account Phone : {AccountPhone}
            </b>
        </div>
    </lightning-card>
</template>
πŸš“ customLwcforFlow.js
import { LightningElement, api } from 'lwc';

export default class CustomLWCforFlow extends LightningElement {
    @api AccountName;
    @api AccountPhone;
}
πŸš“ customLwcforFlow.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__FlowScreen</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__FlowScreen">
            <property name="AccountName" type="String" label="Account Name" />
            <property name="AccountPhone" type="String" label="Account Phone" />
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

✨ λ§Œλ“€μ—ˆλ˜ Flow λ₯Ό 디버그λ₯Ό ν–ˆμ„ λ•Œ!

SampleScreenAction

πŸš• SampleScreenAction.html
<<template>
    <b>Hello World</b>
</template>
πŸš• SampleScreenAction.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordAction</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordAction">
            <actionType>ScreenAction</actionType>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

SampleHeaderAction

πŸ›Ί SampleHeaderAction.js
import { LightningElement, api} from 'lwc';

export default class SampleHeaderAction extends LightningElement {
    @api invoke(){
        console.log("###Hello World");
    }
}
πŸ›Ί SampleHeaderAction.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordAction</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordAction">
            <actionType>ScreenAction</actionType>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>
salesforce setup-> Object νŽΈμ§‘ -> Buttons, Links and action




λ²„νŠΌ 생성!!

profile
λ©”λͺ¨μž₯ :)

0개의 λŒ“κΈ€