This file contains hidden or 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
import { LightningElement} from "lwc"; | |
import { ShowToastEvent} from 'lightning/platformShowToastEvent'; | |
import CONTACT_OBJECT from '@salesforce/schema/Contact'; | |
import NAME_FIELD from '@salesforce/schema/Contact.name'; | |
export default class criarContato extends LightningElement { | |
objectApiName=CONTACT_OBJECT; |
This file contains hidden or 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
<template> | |
<lightning-card> | |
<lightning-record-form | |
object-api-name={objectApiName} | |
fields={fields} | |
onsucess={handleSuccess}> | |
</lightning-record-form> | |
</lightning-card> | |
</template> |
This file contains hidden or 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
import { LightningElement } from 'lwc'; | |
export default class NovaOportunidadeView extends LightningElement { | |
visivel = false; | |
recordId; | |
handleSuccess(event){ | |
console.log('Oportunidade criada'); | |
console.log('Id da oportunidade' + event.detail.id); | |
this.recordId = event.detail.id; | |
this.visivel = true; |
This file contains hidden or 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
<template> | |
<lightning-card title="Nova Oportunidade" icon-name="action:new_opportunity"> | |
<div class="slds-m-around_medium"> | |
<lightning-record-edit-form object-api-name="Opportunity" onsuccess={handleSuccess}> | |
<p><lightning-input-field field-name="Name"></lightning-input-field></p> | |
<p><lightning-input-field field-name="CloseDate"></lightning-input-field></p> | |
<p><lightning-input-field field-name="StageName"></lightning-input-field></p> | |
<p> |
This file contains hidden or 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
import { LightningElement, wire } from 'lwc'; | |
import getListOpportunity from '@salesforce/apex/OpportunityController.getListOpportunity'; | |
export default class UltimasOportunidades extends LightningElement { | |
opportunities; | |
error; | |
columns = [ | |
{label:'Id', fieldName:'Id'}, | |
{label:'Nome', fieldName:'Name'}, | |
{label:'Valor', fieldName:'Amount'}, | |
{label:'Data de Fechamento', fieldName:'CloseDate'}, |
This file contains hidden or 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
public with sharing class OpportunityController { | |
@AuraEnabled(cacheable=true) | |
public static List<Opportunity> getListOpportunity(){ | |
return[SELECT id, name, amount, CloseDate, stagename from opportunity WHERE StageName = 'Negotiation/Review' Order By createdDate ASC LIMIT 5]; | |
} | |
} |
This file contains hidden or 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
import { LightningElement } from 'lwc'; | |
export default class CalculadoraLwc extends LightningElement { | |
resultadoValue; | |
handlePrimeiroNumero(event) { | |
this.primeiroNumero = parseInt(event.target.value); | |
} | |
handleSegundoNumero(event) { |
This file contains hidden or 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
<template> | |
<div title="Calculadora braba" class="slds-box slds-theme_shade"> | |
<lightning-input type="number" name="input2" label="Digite o primeiro número:" onchange={handlePrimeiroNumero} value={primeiroNumero}></lightning-input> | |
<lightning-input type="number" name="input2" label="Digite o segundo número:" onchange={handleSegundoNumero} value={segundoNumero}></lightning-input> | |
</div> | |
<div class="slds-box slds-theme_shade"> | |
<b>Resultado : </b> | |
<P>{resultadoValue}</p> | |
</div> | |
<div class="slds-box slds-theme_shade"> |
NewerOlder