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="Criar um novo lead"> | |
| <div class="slds-p-horizontal_small"> | |
| <lightning-record-edit-form object-api-name="Lead" onsuccess={handleSuccess} > | |
| <lightning-messages> </lightning-messages> | |
| <lightning-input-field field-name="Name"> | |
| </lightning-input-field> | |
| <lightning-input-field field-name="Rating"> | |
| </lightning-input-field> | |
| <lightning-input-field field-name="Company"> |
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
| ({ | |
| result : function(component, event, helper) { | |
| var num1 = component.get("v.numero1"); | |
| var opp = component.get("v.temp"); | |
| if(opp == 'cf'){ | |
| var soma = (num1 * 9/5) + 32; | |
| }else if(opp == 'ck'){ | |
| var soma = num1 + 273.15; | |
| }else if(opp == 'fc'){ |
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
| ({ | |
| resultBotao : function(component, event, helper) { | |
| var num1 = component.get("v.numero1"); | |
| var num2 = component.get("v.numero2"); | |
| var opp = component.get("v.operacao"); | |
| if(opp == '+'){ | |
| var soma = num1 + num2; | |
| }else if(opp == '-'){ |
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
| trigger AccountTrigger on Account (before insert, before update, after insert) { | |
| //Inserir Prospect como padrão se o campo Type estiver em branco. | |
| //before | |
| if(Trigger.isBefore){ | |
| for(Account account: trigger.new){ | |
| if(String.isblank(account.Type) && Trigger.isInsert){ | |
| account.Type='Prospect'; | |
| //For acessa a nova trigger, passa para o if e valida se o campo TIPO está preenchido. | |
| //IsBefore = ANTES e isInsert =Ação Durante a inserção |
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
| trigger RestrictContactByName on Contact (before insert) { | |
| //verificar contatos antes de inserir ou atualizar para dados inválidos | |
| For (Contact c : Trigger.New) { | |
| if(c.LastName == 'INVALIDNAME') { //invalidname is invalid | |
| c.AddError('The Last Name "'+c.LastName+'" is not allowed for DML'); | |
| } | |
| } | |
| } |
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
| @isTest | |
| public class TestVerifyDate { | |
| @isTest static void TestVerify(){ | |
| date dateTest = VerifyDate.CheckDates(date.parse('10/11/2022'), date.parse('22/04/2021')); | |
| system.assertEquals(date.parse('30/11/2022'), dateTest); | |
| } | |
| @isTest static void TestVerify2(){ | |
| date dateTest = VerifyDate.CheckDates(date.parse('10/11/2022'), date.parse('22/12/2022')); | |
| system.assertEquals(date.parse('30/11/2022'), dateTest); | |
| } |
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 class Bicho { | |
| public static void sortear(){ | |
| list<string> nomes = new list<string>{'Felipe', 'Pedro', 'Cristiam', 'gabriel' , 'Rodrigo', 'Luana','ygor'}; | |
| list<string> aposta = new list<string>{'pavao','galo', 'cachorro', 'gato', 'coelho', 'cobra','burro'}; | |
| list<integer> numeroSorteados = new list<integer>(); | |
| list<string> Bicho = new list<string>(); | |
| list<string> Grupo = new list<string>(); | |
| for(integer i=0; i < 5; i++){ | |
| numeroSorteados.add(integer.valueOf(math.random() * 99)); |
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 class CalculadoraMagica { | |
| public list<string> funcoes(integer a, integer b){ | |
| list<string> resultado = new list<string>(); | |
| integer soma = a + b; | |
| resultado.add('Soma = ' + string.valueOf(soma)); | |
| integer subtracao = a - b; | |
| resultado.add('Subtração = ' + string.valueOf(subtracao)); | |
| integer dividir = a / b; | |
| resultado.add('Dividir = ' + string.valueOf(dividir)); |
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
| //Anonymous apex code | |
| Calculadora fun = new Calculadora(); | |
| fun.somar( 10, '+', 20); | |
| fun.somar( 20, '-', 10); | |
| fun.somar( 20, '/', 10); | |
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
| List<integer> MegaSena = new List<integer>(); | |
| for(integer i = 0; i <= 60; i++){ | |
| MegaSena.add(i); | |
| } | |
| system.debug('Os numeros sorteados são: ' + | |
| MegaSena[integer.valueof(system.Math.random() * 6 )] + ' ' + | |
| MegaSena[integer.valueof(system.Math.random() * 10 )] + ' ' + | |
| MegaSena[integer.valueof(system.Math.random() * 20 )] + ' ' + |
NewerOlder