├── .eslintignore ├── .forceignore ├── .gitignore ├── .husky └── pre-commit ├── .prettierignore ├── .prettierrc ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── README.md ├── config └── project-scratch-def.json ├── force-app └── main │ └── default │ ├── aura │ ├── .eslintrc.json │ └── flowRedirect │ │ ├── flowRedirect.auradoc │ │ ├── flowRedirect.cmp │ │ ├── flowRedirect.cmp-meta.xml │ │ ├── flowRedirect.css │ │ ├── flowRedirect.design │ │ ├── flowRedirect.svg │ │ ├── flowRedirectController.js │ │ ├── flowRedirectHelper.js │ │ └── flowRedirectRenderer.js │ ├── classes │ ├── AccountCreateUtility.cls │ ├── AccountCreateUtility.cls-meta.xml │ ├── AccountDetailController.cls │ ├── AccountDetailController.cls-meta.xml │ ├── ApexPostRequest.cls │ ├── ApexPostRequest.cls-meta.xml │ ├── ApexPostResponse.cls │ ├── ApexPostResponse.cls-meta.xml │ ├── ApexRestCallExample.cls │ ├── ApexRestCallExample.cls-meta.xml │ ├── ApexTriggerHandler.cls │ ├── ApexTriggerHandler.cls-meta.xml │ ├── BatchApexExample.cls │ ├── BatchApexExample.cls-meta.xml │ ├── CallFromCustomeButton.cls │ ├── CallFromCustomeButton.cls-meta.xml │ ├── CheckInUtility.cls │ ├── CheckInUtility.cls-meta.xml │ ├── ContactController.cls │ ├── ContactUtility.cls │ ├── ContactUtility.cls-meta.xml │ ├── DepartmentData.cls │ ├── DepartmentData.cls-meta.xml │ ├── EmailUtility.cls │ ├── EmailUtility.cls-meta.xml │ ├── ExchangeController.cls │ ├── ExchangeController.cls-meta.xml │ ├── FieldSetController.cls │ ├── FieldSetController.cls-meta.xml │ ├── FlexiLightningTableController.cls │ ├── FormField.cls │ ├── FormField.cls-meta.xml │ ├── FutureMethdExample.cls │ ├── FutureMethdExample.cls-meta.xml │ ├── GetRecordTypeHelper.cls │ ├── GetRecordTypeHelper.cls-meta.xml │ ├── GoogleApiCreateContact.cls │ ├── GoogleContactController.cls │ ├── OTPUtility.cls │ ├── OTPUtility.cls-meta.xml │ ├── OlderAccountsUtility.cls │ ├── OlderAccountsUtility.cls-meta.xml │ ├── OpportunityTriggerHandler.cls │ ├── OpportunityTriggerHandler.cls-meta.xml │ ├── PANRequest.cls │ ├── PANRequest.cls-meta.xml │ ├── PaymentCallback.cls │ ├── PaymentUtility.cls │ ├── SchedulabeExample.cls │ ├── SchedulabeExample.cls-meta.xml │ ├── StudentController.cls │ ├── StudentController.cls-meta.xml │ ├── TestClassExample.cls │ ├── TestClassExample.cls-meta.xml │ ├── UPIPayment.cls │ ├── UPIPayment.cls-meta.xml │ ├── UPISettings.cls │ ├── WhatsAppApiController.cls │ └── lwcSortingDataTableCtrl.cls │ ├── lwc │ ├── .eslintrc.json │ ├── birdDetail │ │ ├── birdDetail.html │ │ ├── birdDetail.js │ │ └── birdDetail.js-meta.xml │ ├── birdList │ │ ├── birdList.css │ │ ├── birdList.html │ │ ├── birdList.js │ │ └── birdList.js-meta.xml │ ├── childComponant │ │ ├── childComponant.html │ │ ├── childComponant.js │ │ └── childComponant.js-meta.xml │ ├── countDownTimer │ │ ├── countDownTimer.css │ │ ├── countDownTimer.html │ │ ├── countDownTimer.js │ │ └── countDownTimer.js-meta.xml │ ├── createAccount │ │ ├── createAccount.html │ │ ├── createAccount.js │ │ └── createAccount.js-meta.xml │ ├── createContactFieldSet │ │ ├── __tests__ │ │ │ └── createContactFieldSet.test.js │ │ ├── createContactFieldSet.html │ │ ├── createContactFieldSet.js │ │ └── createContactFieldSet.js-meta.xml │ ├── createContactFlow │ │ ├── __tests__ │ │ │ └── createContactFlow.test.js │ │ ├── createContactFlow.html │ │ ├── createContactFlow.js │ │ └── createContactFlow.js-meta.xml │ ├── createContactManually │ │ ├── __tests__ │ │ │ └── createContactManually.test.js │ │ ├── createContactManually.html │ │ ├── createContactManually.js │ │ └── createContactManually.js-meta.xml │ ├── createContactUsingFieldSet │ │ ├── __tests__ │ │ │ └── createContactUsingFieldSet.test.js │ │ ├── createContactUsingFieldSet.html │ │ ├── createContactUsingFieldSet.js │ │ └── createContactUsingFieldSet.js-meta.xml │ ├── displayRecordType │ │ ├── displayRecordType.html │ │ ├── displayRecordType.js │ │ └── displayRecordType.js-meta.xml │ ├── displayYearDataComponent │ │ ├── displayYearDataComponent.html │ │ ├── displayYearDataComponent.js │ │ └── displayYearDataComponent.js-meta.xml │ ├── displaydata │ │ ├── displaydata.html │ │ ├── displaydata.js │ │ └── displaydata.js-meta.xml │ ├── dtExample │ │ ├── __tests__ │ │ │ └── dtExample.test.js │ │ ├── dtExample.css │ │ ├── dtExample.html │ │ ├── dtExample.js │ │ └── dtExample.js-meta.xml │ ├── exchangeRate │ │ ├── exchangeRate.html │ │ ├── exchangeRate.js │ │ └── exchangeRate.js-meta.xml │ ├── filterselection │ │ ├── filterselection.css │ │ ├── filterselection.html │ │ ├── filterselection.js │ │ └── filterselection.js-meta.xml │ ├── myChildComponant │ │ ├── myChildComponant.html │ │ ├── myChildComponant.js │ │ └── myChildComponant.js-meta.xml │ ├── myParentCOmponant │ │ ├── myParentCOmponant.html │ │ ├── myParentCOmponant.js │ │ └── myParentCOmponant.js-meta.xml │ ├── paginator │ │ ├── __tests__ │ │ │ └── paginator.test.js │ │ ├── paginator.html │ │ ├── paginator.js │ │ └── paginator.js-meta.xml │ ├── parentComponant │ │ ├── parentComponant.html │ │ ├── parentComponant.js │ │ └── parentComponant.js-meta.xml │ ├── passwordValidation │ │ ├── passwordValidation.html │ │ ├── passwordValidation.js │ │ └── passwordValidation.js-meta.xml │ ├── passwordValidator │ │ ├── passwordValidator.css │ │ ├── passwordValidator.html │ │ ├── passwordValidator.js │ │ └── passwordValidator.js-meta.xml │ ├── propertyExample │ │ ├── propertyExample.html │ │ ├── propertyExample.js │ │ └── propertyExample.js-meta.xml │ ├── qrCodeGenarator │ │ ├── __tests__ │ │ │ └── qrCodeGenarator.test.js │ │ ├── qrCodeGenarator.html │ │ ├── qrCodeGenarator.js │ │ └── qrCodeGenarator.js-meta.xml │ ├── relatedContact │ │ ├── __tests__ │ │ │ └── relatedContact.test.js │ │ ├── relatedContact.html │ │ ├── relatedContact.js │ │ └── relatedContact.js-meta.xml │ ├── selectYearComponent │ │ ├── selectYearComponent.html │ │ ├── selectYearComponent.js │ │ └── selectYearComponent.js-meta.xml │ ├── sendOtpComponant │ │ ├── sendOtpComponant.css │ │ ├── sendOtpComponant.html │ │ ├── sendOtpComponant.js │ │ └── sendOtpComponant.js-meta.xml │ ├── showPaymentPopup │ │ ├── __tests__ │ │ │ └── showPaymentPopup.test.js │ │ ├── showPaymentPopup.html │ │ ├── showPaymentPopup.js │ │ └── showPaymentPopup.js-meta.xml │ ├── testDatatableExample │ │ ├── __tests__ │ │ │ └── testDatatableExample.test.js │ │ ├── testDatatableExample.css │ │ ├── testDatatableExample.html │ │ ├── testDatatableExample.js │ │ └── testDatatableExample.js-meta.xml │ ├── translator │ │ ├── __tests__ │ │ │ └── translator.test.js │ │ ├── translator.html │ │ ├── translator.js │ │ └── translator.js-meta.xml │ ├── validateMobileNumber │ │ ├── validateMobileNumber.html │ │ ├── validateMobileNumber.js │ │ └── validateMobileNumber.js-meta.xml │ └── validatePPAN │ │ ├── __tests__ │ │ └── validatePPAN.test.js │ │ ├── validatePPAN.html │ │ ├── validatePPAN.js │ │ └── validatePPAN.js-meta.xml │ ├── messageChannels │ ├── Animal_Detail.messageChannel-meta.xml │ ├── Filter_Detail.messageChannel-meta.xml │ └── Selected_Filter_Detail.messageChannel-meta.xml │ ├── pages │ ├── datadisp.page │ └── datadisp.page-meta.xml │ └── triggers │ ├── AccountTriggerClass.trigger │ ├── AccountTriggerClass.trigger-meta.xml │ ├── ContactTrigger.trigger │ ├── OppourtunityTrigger.trigger │ └── OppourtunityTrigger.trigger-meta.xml ├── jest.config.js ├── manifest └── package.xml ├── package.json ├── scripts ├── apex │ └── hello.apex └── soql │ └── account.soql └── sfdx-project.json /.eslintignore: -------------------------------------------------------------------------------- 1 | **/lwc/**/*.css 2 | **/lwc/**/*.html 3 | **/lwc/**/*.json 4 | **/lwc/**/*.svg 5 | **/lwc/**/*.xml 6 | **/aura/**/*.auradoc 7 | **/aura/**/*.cmp 8 | **/aura/**/*.css 9 | **/aura/**/*.design 10 | **/aura/**/*.evt 11 | **/aura/**/*.json 12 | **/aura/**/*.svg 13 | **/aura/**/*.tokens 14 | **/aura/**/*.xml 15 | **/aura/**/*.app 16 | .sfdx 17 | -------------------------------------------------------------------------------- /.forceignore: -------------------------------------------------------------------------------- 1 | # List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status 2 | # More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm 3 | # 4 | 5 | package.xml 6 | 7 | # LWC configuration files 8 | **/jsconfig.json 9 | **/.eslintrc.json 10 | 11 | # LWC Jest 12 | **/__tests__/** -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used for Git repositories to specify intentionally untracked files that Git should ignore. 2 | # If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore 3 | # For useful gitignore templates see: https://github.com/github/gitignore 4 | 5 | # Salesforce cache 6 | .sf/ 7 | .sfdx/ 8 | .localdevserver/ 9 | deploy-options.json 10 | 11 | # LWC VSCode autocomplete 12 | **/lwc/jsconfig.json 13 | 14 | # LWC Jest coverage reports 15 | coverage/ 16 | 17 | # Logs 18 | logs 19 | *.log 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | 24 | # Dependency directories 25 | node_modules/ 26 | 27 | # Eslint cache 28 | .eslintcache 29 | 30 | # MacOS system files 31 | .DS_Store 32 | 33 | # Windows system files 34 | Thumbs.db 35 | ehthumbs.db 36 | [Dd]esktop.ini 37 | $RECYCLE.BIN/ 38 | 39 | # Local environment variables 40 | .env -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run precommit -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # List files or directories below to ignore them when running prettier 2 | # More information: https://prettier.io/docs/en/ignore.html 3 | # 4 | 5 | **/staticresources/** 6 | .localdevserver 7 | .sfdx 8 | .vscode 9 | 10 | coverage/ -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "none", 3 | "overrides": [ 4 | { 5 | "files": "**/lwc/**/*.html", 6 | "options": { "parser": "lwc" } 7 | }, 8 | { 9 | "files": "*.{cmp,page,component}", 10 | "options": { "parser": "html" } 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "salesforce.salesforcedx-vscode", 4 | "redhat.vscode-xml", 5 | "dbaeumer.vscode-eslint", 6 | "esbenp.prettier-vscode", 7 | "financialforce.lana" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Launch Apex Replay Debugger", 9 | "type": "apex-replay", 10 | "request": "launch", 11 | "logFile": "${command:AskForLogFileName}", 12 | "stopOnEntry": true, 13 | "trace": true 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "search.exclude": { 3 | "**/node_modules": true, 4 | "**/bower_components": true, 5 | "**/.sfdx": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Salesforce DX Project: Next Steps 2 | 3 | Now that you’ve created a Salesforce DX project, what’s next? Here are some documentation resources to get you started. 4 | 5 | ## How Do You Plan to Deploy Your Changes? 6 | 7 | Do you want to deploy a set of changes, or create a self-contained application? Choose a [development model](https://developer.salesforce.com/tools/vscode/en/user-guide/development-models). 8 | 9 | ## Configure Your Salesforce DX Project 10 | 11 | The `sfdx-project.json` file contains useful configuration information for your project. See [Salesforce DX Project Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm) in the _Salesforce DX Developer Guide_ for details about this file. 12 | 13 | ## Read All About It 14 | 15 | - [Salesforce Extensions Documentation](https://developer.salesforce.com/tools/vscode/) 16 | - [Salesforce CLI Setup Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm) 17 | - [Salesforce DX Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm) 18 | - [Salesforce CLI Command Reference](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm) 19 | -------------------------------------------------------------------------------- /config/project-scratch-def.json: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "Demo company", 3 | "edition": "Developer", 4 | "features": ["EnableSetPasswordInApi"], 5 | "settings": { 6 | "lightningExperienceSettings": { 7 | "enableS1DesktopEnabled": true 8 | }, 9 | "mobileSettings": { 10 | "enableS1EncryptedStoragePref2": false 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /force-app/main/default/aura/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@salesforce/eslint-plugin-aura"], 3 | "extends": ["plugin:@salesforce/eslint-plugin-aura/recommended"], 4 | "rules": { 5 | "vars-on-top": "off", 6 | "no-unused-expressions": "off" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /force-app/main/default/aura/flowRedirect/flowRedirect.auradoc: -------------------------------------------------------------------------------- 1 | 2 | Documentation 3 | 4 | Example Description 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/aura/flowRedirect/flowRedirect.cmp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/aura/flowRedirect/flowRedirect.cmp-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | A Lightning Component Bundle 5 | -------------------------------------------------------------------------------- /force-app/main/default/aura/flowRedirect/flowRedirect.css: -------------------------------------------------------------------------------- 1 | .THIS { 2 | } 3 | -------------------------------------------------------------------------------- /force-app/main/default/aura/flowRedirect/flowRedirect.design: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /force-app/main/default/aura/flowRedirect/flowRedirect.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /force-app/main/default/aura/flowRedirect/flowRedirectController.js: -------------------------------------------------------------------------------- 1 | ({ 2 | 3 | navHome : function (component, event, helper) { 4 | 5 | 6 | var homeEvent = $A.get("e.force:navigateToObjectHome"); 7 | homeEvent.setParams({ 8 | "scope": "Account" 9 | }); 10 | homeEvent.fire(); 11 | } 12 | 13 | 14 | }) 15 | -------------------------------------------------------------------------------- /force-app/main/default/aura/flowRedirect/flowRedirectHelper.js: -------------------------------------------------------------------------------- 1 | ({ 2 | helperMethod : function() { 3 | 4 | } 5 | }) 6 | -------------------------------------------------------------------------------- /force-app/main/default/aura/flowRedirect/flowRedirectRenderer.js: -------------------------------------------------------------------------------- 1 | ({ 2 | 3 | // Your renderer method overrides go here 4 | 5 | }) 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/AccountCreateUtility.cls: -------------------------------------------------------------------------------- 1 | public with sharing class AccountCreateUtility { 2 | 3 | @AuraEnabled 4 | public static Account create(Account acc){ 5 | try { 6 | 7 | 8 | 9 | 10 | 11 | insert acc; 12 | return acc; 13 | 14 | } catch (Exception e) { 15 | throw new AuraHandledException(e.getMessage()); 16 | } 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /force-app/main/default/classes/AccountCreateUtility.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/AccountDetailController.cls: -------------------------------------------------------------------------------- 1 | public with sharing class AccountDetailController { 2 | 3 | 4 | @AuraEnabled(cacheable=true) 5 | public static List getAccountInfo(){ 6 | 7 | List result = new List(); 8 | result=[select id,name from Account]; 9 | return result; 10 | } 11 | 12 | 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /force-app/main/default/classes/AccountDetailController.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ApexPostRequest.cls: -------------------------------------------------------------------------------- 1 | public class ApexPostRequest { 2 | public String userName; 3 | public String password; 4 | } 5 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ApexPostRequest.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ApexPostResponse.cls: -------------------------------------------------------------------------------- 1 | public with sharing class ApexPostResponse { 2 | 3 | public String responseMessage; 4 | public boolean isSuccess; 5 | public string Id; 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ApexPostResponse.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ApexRestCallExample.cls: -------------------------------------------------------------------------------- 1 | 2 | @RestResource(urlMapping='/Account/*') 3 | global with sharing class ApexRestCallExample { 4 | 5 | @HttpGet 6 | global static String getAccountInfo(){ 7 | 8 | Map request=RestContext.request.params; 9 | 10 | String accountID= request.get('Id'); 11 | String name= request.get('name'); 12 | 13 | Account accountInfo=[select Id,Name from Account where Id=:accountID]; 14 | 15 | return name+Json.serialize(accountInfo); 16 | 17 | } 18 | 19 | @HttpPost 20 | global static String createAccountObjects(){ 21 | 22 | ApexPostRequest postRequest; 23 | String responseMessage; 24 | boolean isSuccess; 25 | String responseRequest; 26 | 27 | 28 | String request=RestContext.request.requestBody.toString(); 29 | 30 | 31 | 32 | if(request==null){ 33 | responseMessage='Bad Request'; 34 | isSuccess=false; 35 | }else{ 36 | // postRequest=(ApexPostRequest)Json.deserialize(request,ApexPostRequest.class); 37 | 38 | Lead sss =(Lead)Json.deserialize(request,Lead.class); 39 | 40 | dddd= Database.upsert(sss,false); 41 | 42 | if(sss.getRe==tr) 43 | 44 | 45 | 46 | 47 | 48 | 49 | Account acc= new Account(); 50 | acc.Name=postRequest.userName; 51 | insert acc; 52 | responseMessage='Record Created '; 53 | isSuccess=true; 54 | } 55 | 56 | ApexPostResponse resposeBody= new ApexPostResponse(); 57 | resposeBody.responseMessage=responseMessage; 58 | resposeBody.isSuccess=isSuccess; 59 | 60 | responseRequest=Json.serialize(resposeBody); 61 | 62 | return RestContext.request.params.get('Id')+responseRequest; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ApexRestCallExample.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ApexTriggerHandler.cls: -------------------------------------------------------------------------------- 1 | public with sharing class ApexTriggerHandler { 2 | 3 | public static void handleBeforeInsert(List saccountList) { 4 | 5 | for (Account variable : saccountList) { 6 | 7 | if(variable.BillingStreet!=null) { 8 | variable.ShippingStreet = variable.BillingStreet; 9 | } 10 | 11 | if(variable.BillingCity!=null) { 12 | variable.shippingCity = variable.BillingCity; 13 | } 14 | 15 | if(variable.BillingCountry!=null) { 16 | variable.ShippingCountry = variable.BillingCountry; 17 | } 18 | 19 | if(variable.billingPostalCode!=null) { 20 | variable.shippingPostalCode = variable.billingPostalCode; 21 | } 22 | 23 | } 24 | 25 | } 26 | 27 | public static void handleAfterInsert(List saccountList) { 28 | 29 | Set accountIdSet = new Set(); 30 | 31 | DateTime days30=System.now()-30; 32 | 33 | List sss= new List(); 34 | List OpportunityListTobeUpdated= new List(); 35 | 36 | 37 | for(Account account : saccountList) { 38 | accountIdSet.add(account.Id); 39 | } 40 | 41 | sss=[select id,stageName,AccountId , createdDate,CloseDate from Opportunity where AccountId in : accountIdSet]; 42 | 43 | 44 | if(sss.size() > 0) { 45 | 46 | for(Opportunity variable: sss){ 47 | 48 | if(variable.createdDate Account) { 61 | 62 | 63 | User user = [select id,profile.name ,email from user where profile.name = 'System Administrator']; 64 | 65 | List mails = new List(); 66 | 67 | 68 | for (Account variable : Account) { 69 | Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 70 | mail.setSenderDisplayName('Salesforce'); 71 | mail.toAddresses = new String[] {user.email}; 72 | mail.setHtmlBody('Hi New Account created '); 73 | mails.add(mail); 74 | } 75 | 76 | Messaging.SendEmailResult[] results = Messaging.sendEmail(mails); 77 | //we are checking if the mails are sent or not. 78 | if (results[0].success) 79 | { 80 | System.debug('The email was sent successfully.'); 81 | } else { 82 | System.debug('The email failed to send: '+ results[0].errors[0].message); 83 | } 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ApexTriggerHandler.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/BatchApexExample.cls: -------------------------------------------------------------------------------- 1 | 2 | 3 | public class BatchApexExample implements Database.Batchable { 4 | 5 | public BatchApexExample() { 6 | } 7 | 8 | public Database.QueryLocator start(Database.BatchableContext BC) { 9 | 10 | String query ='Select Id,Name from Account'; 11 | return Database.getQueryLocator(query); 12 | 13 | } 14 | 15 | public void execute(Database.BatchableContext BC, List scope) { 16 | 17 | List accountToBeUpdated = new List(); 18 | 19 | for (Account objectOfAccount : scope) { 20 | objectOfAccount.Name = 'Mttt'+objectOfAccount.Name; 21 | accountToBeUpdated.add(objectOfAccount); 22 | } 23 | 24 | update accountToBeUpdated; 25 | 26 | 27 | } 28 | 29 | public void finish(Database.BatchableContext BC) { 30 | } 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /force-app/main/default/classes/BatchApexExample.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/CallFromCustomeButton.cls: -------------------------------------------------------------------------------- 1 | public with sharing class CallFromCustomeButton { 2 | 3 | 4 | 5 | 6 | public static boolean method(String name){ 7 | 8 | 9 | return true; 10 | 11 | } 12 | 13 | 14 | 15 | 16 | 17 | @AuraEnabled 18 | public static List getAvailableObjects(String name){ 19 | List listObject = new List(); 20 | Integer counter=0; 21 | 22 | for ( Schema.SObjectType o : Schema.getGlobalDescribe().values() ) 23 | { 24 | Schema.DescribeSObjectResult objResult = o.getDescribe(); 25 | 26 | List keys = new List(); 27 | for(Schema.FieldSet sd:objResult.fieldSets.getMap().values()){ 28 | 29 | for(Schema.FieldSetMember fieldSetMemberObj : sd.getFields()){ 30 | 31 | keys.add(fieldSetMemberObj.getLabel()); 32 | 33 | 34 | } 35 | 36 | 37 | 38 | } 39 | 40 | // system.debug( 'Sobject: ' + objResult ); 41 | // system.debug( 'Sobject API Name: ' + objResult.getName() ); 42 | system.debug( 'keys: ' + keys ); 43 | 44 | listObject.add(new CallFromCustomeButton.ModelSaver(objResult.getName(),++counter,keys)); 45 | 46 | 47 | } 48 | 49 | return listObject; 50 | 51 | 52 | 53 | } 54 | 55 | public class ModelSaver{ 56 | 57 | @AuraEnabled 58 | public String named {get;set;} 59 | @AuraEnabled 60 | public Integer numbers {get;set;} 61 | 62 | @AuraEnabled 63 | public List fieldValues {get;set;} 64 | 65 | 66 | 67 | public ModelSaver(){ 68 | 69 | } 70 | public ModelSaver(String namee,Integer numbere, List mFieldValues){ 71 | 72 | named=namee; 73 | numbers=numbere; 74 | fieldValues=mFieldValues; 75 | 76 | } 77 | 78 | 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /force-app/main/default/classes/CallFromCustomeButton.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 52.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/CheckInUtility.cls: -------------------------------------------------------------------------------- 1 | public with sharing class CheckInUtility { 2 | 3 | public static boolean createCheckinRecord(String otp,Contact contactObject){ 4 | 5 | try{ 6 | 7 | CheckIn__c checkIn= new CheckIn__c(); 8 | checkIn.OTP__c=otp; 9 | checkIn.Contact__c=contactObject.ID; 10 | insert checkIn; 11 | return true; 12 | 13 | }catch(Exception ex){ 14 | System.debug(''+ex); 15 | } 16 | 17 | return false; 18 | 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /force-app/main/default/classes/CheckInUtility.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ContactController.cls: -------------------------------------------------------------------------------- 1 | public with sharing class ContactController { 2 | 3 | @AuraEnabled 4 | public static Contact getContactInfo(String contactId){ 5 | Contact contact; 6 | try { 7 | 8 | contact =[select id,name,MobilePhone from contact where id =:contactId]; 9 | 10 | } catch (Exception e) { 11 | throw new AuraHandledException(e.getMessage()); 12 | } 13 | 14 | return contact; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ContactUtility.cls: -------------------------------------------------------------------------------- 1 | public with sharing class ContactUtility { 2 | 3 | @AuraEnabled 4 | public static Integer TotalRecords(String accountRecordId){ 5 | return [Select count() from Contact where accountId=:accountRecordId]; 6 | } 7 | 8 | 9 | @AuraEnabled(Cacheable = true) 10 | public static List getAccountRelatedContact(String accountRecordId,Integer v_Offset, Integer v_pagesize) { 11 | List contacts = new List(); 12 | contacts=[select id,name,FirstName,lastName ,email from Contact where accountId=:accountRecordId limit :v_pagesize OFFSET :v_Offset]; 13 | return contacts; 14 | } 15 | 16 | 17 | @AuraEnabled(cacheable=true) 18 | public static Integer getNext(Integer v_Offset, Integer v_pagesize){ 19 | v_Offset += v_pagesize; 20 | return v_Offset; 21 | } 22 | 23 | @AuraEnabled(cacheable=true) 24 | public static Integer getPrevious(Integer v_Offset, Integer v_pagesize){ 25 | v_Offset -= v_pagesize; 26 | return v_Offset; 27 | } 28 | 29 | 30 | @AuraEnabled(Cacheable = true) 31 | public static List getContacts() { 32 | return [SELECT Id, Name, FirstName, LastName, Phone, Email 33 | FROM Contact 34 | WHERE Email != null 35 | AND Phone != null 36 | ORDER BY CreatedDate limit 20]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ContactUtility.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/DepartmentData.cls: -------------------------------------------------------------------------------- 1 | public with sharing class DepartmentData { 2 | 3 | @AuraEnabled 4 | public Integer numberOfStudents; 5 | @AuraEnabled 6 | public String departmentName; 7 | @AuraEnabled 8 | public ID departmentId; 9 | 10 | public DepartmentData(Integer mnmberOfStudents,String mdepartmentName,ID mDepartmentId) { 11 | this.numberOfStudents = mnmberOfStudents; 12 | this.departmentName = mdepartmentName; 13 | this.departmentId = mDepartmentId; 14 | } 15 | 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /force-app/main/default/classes/DepartmentData.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/EmailUtility.cls: -------------------------------------------------------------------------------- 1 | public with sharing class EmailUtility { 2 | 3 | public static boolean sendEmail(String emailId,String emailBody){ 4 | 5 | List mails = new List(); 6 | Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 7 | mail.setSenderDisplayName('Salesforce'); 8 | mail.toAddresses = new String[] {emailId}; 9 | mail.setHtmlBody(emailBody); 10 | mails.add(mail); 11 | Messaging.SendEmailResult[] results = Messaging.sendEmail(mails); 12 | 13 | if(results!=null && results[0].success) { 14 | return true; 15 | } 16 | 17 | return false; 18 | 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /force-app/main/default/classes/EmailUtility.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ExchangeController.cls: -------------------------------------------------------------------------------- 1 | public with sharing class ExchangeController { 2 | public ExchangeController() { 3 | 4 | } 5 | 6 | @AuraEnabled 7 | public static String getAvailableSymbols(){ 8 | try { 9 | Http httpObject = new Http(); 10 | HttpRequest request = new HttpRequest(); 11 | request.setEndpoint('https://api.apilayer.com/exchangerates_data/symbols'); 12 | request.setMethod('GET'); 13 | request.setHeader('apikey', 'ewfaPtiJWS85iwwxtlKIyBTf2Iv7cfrp'); 14 | 15 | HttpResponse response = httpObject.send(request); 16 | String responseBody = response.getBody(); 17 | system.debug( 'Response body: ' + responseBody); 18 | 19 | if(response.getStatusCode() == 200) { 20 | return responseBody; 21 | }else { 22 | return null; 23 | } 24 | 25 | } catch (Exception e) { 26 | throw new AuraHandledException(e.getMessage()); 27 | } 28 | 29 | } 30 | 31 | 32 | @AuraEnabled 33 | public static String convert(string fromCountry,String toCountry,String amount ) { 34 | try { 35 | Http httpObject = new Http(); 36 | HttpRequest request = new HttpRequest(); 37 | request.setEndpoint('https://api.apilayer.com/exchangerates_data/convert?to='+toCountry+'&from='+fromCountry+'&amount='+amount); 38 | request.setMethod('GET'); 39 | request.setHeader('apikey', 'ewfaPtiJWS85iwwxtlKIyBTf2Iv7cfrp'); 40 | 41 | HttpResponse response = httpObject.send(request); 42 | String responseBody = response.getBody(); 43 | system.debug( 'Response body: ' + responseBody); 44 | 45 | if(response.getStatusCode() == 200) { 46 | return responseBody; 47 | }else { 48 | return response.getStatusCode()+responseBody; 49 | } 50 | 51 | } catch (Exception e) { 52 | throw new AuraHandledException(e.getMessage()); 53 | } 54 | 55 | } 56 | 57 | @AuraEnabled 58 | public static String checkPANStatus(String panNumber ) { 59 | try { 60 | Http httpObject = new Http(); 61 | HttpRequest request = new HttpRequest(); 62 | request.setEndpoint('https://pan-card-verification1.p.rapidapi.com/v3/tasks/sync/verify_with_source/ind_pan'); 63 | request.setMethod('POST'); 64 | request.setHeader('X-RapidAPI-Host', 'pan-card-verification1.p.rapidapi.com'); 65 | request.setHeader('X-RapidAPI-Key', System.Label.RAPID_API_HOST_KEY); 66 | 67 | 68 | // 69 | 70 | request.setHeader('Content-Type', 'application/json;charset=UTF-8'); 71 | 72 | PANRequest sss= new PANRequest('74f4c926-250c-43ca-9c53-453e87ceacd1','8e16424a-58fc-4ba4-ab20-5bc8e7c3c41e',panNumber); 73 | 74 | request.setBody(JSON.serialize(sss)); 75 | 76 | 77 | HttpResponse response = httpObject.send(request); 78 | String responseBody = response.getBody(); 79 | system.debug( 'Response body: ' + responseBody); 80 | return responseBody; 81 | 82 | // if(response.getStatusCode() == 200) { 83 | // return responseBody; 84 | // }else { 85 | // return response.getStatusCode()+responseBody; 86 | // } 87 | 88 | } catch (Exception e) { 89 | throw new AuraHandledException(e.getMessage()); 90 | } 91 | } 92 | 93 | 94 | @AuraEnabled 95 | public static String convertToBASE64(String ss ) { 96 | 97 | // Blob payloadBlob = EncodingUtil.base64Decode(ss); 98 | //String payload = payloadBlob.toString(); 99 | 100 | 101 | String result = EncodingUtil.Base64Encode( Blob.valueOf( ss ) ); 102 | 103 | 104 | return result; 105 | 106 | } 107 | 108 | 109 | 110 | 111 | 112 | 113 | } 114 | -------------------------------------------------------------------------------- /force-app/main/default/classes/ExchangeController.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/FieldSetController.cls: -------------------------------------------------------------------------------- 1 | public class FieldSetController { 2 | @AuraEnabled 3 | public static FieldSetForm getForm(Id recordId, String objectName, String fieldSetName) { 4 | FieldSetForm form = new FieldSetForm(); 5 | form.Fields = getFields(recordId, objectName, fieldSetName); 6 | 7 | return form; 8 | } 9 | 10 | private static List getFields(Id recordId, String objectName, String fieldSetName) { 11 | Schema.SObjectType objectType = null; 12 | 13 | // if (recordId != null) { 14 | // objectType = recordId.getSobjectType(); 15 | // } 16 | if (String.isNotBlank(objectName)) { 17 | objectType = Schema.getGlobalDescribe().get(objectName); 18 | } 19 | 20 | Schema.DescribeSObjectResult objectDescribe = objectType.getDescribe(); 21 | Map fieldSetMap = objectDescribe.fieldSets.getMap(); 22 | Schema.FieldSet fieldSet = fieldSetMap.get(fieldSetName); 23 | List fieldSetMembers = fieldSet.getFields(); 24 | 25 | List fields = new List(); 26 | for (Schema.FieldSetMember fsm : fieldSetMembers) { 27 | FormField f = new FormField(fsm); 28 | fields.add(f); 29 | } 30 | 31 | return fields; 32 | } 33 | 34 | public class FieldSetForm { 35 | @AuraEnabled 36 | public List Fields { get; set; } 37 | 38 | public FieldSetForm() { 39 | Fields = new List(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /force-app/main/default/classes/FieldSetController.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/FlexiLightningTableController.cls: -------------------------------------------------------------------------------- 1 | public with sharing class FlexiLightningTableController { 2 | 3 | @AuraEnabled 4 | public static resultWrapper listAllFields2(String objName, String columnsName, Integer rowCount, Integer incrementCount, Boolean viewMore){ 5 | String objectName = objName; 6 | String columnNames = columnsName; 7 | Integer counter=0; 8 | fieldDataWrapper wrapper = new fieldDataWrapper(); 9 | 10 | List wrapperList = new List(); 11 | List fieldWrapperList = new List(); 12 | SObjectType sObjectName = Schema.getGlobalDescribe().get(objectName); 13 | Map mfields = sObjectName.getDescribe().fields.getMap(); 14 | List mFieldList = new List(); 15 | for(String s:ColumnNames.split('\\,')){ 16 | mFieldList.add(mfields.get(s)); 17 | } 18 | system.debug('mFieldList '+mFieldList); 19 | 20 | For(Schema.SObjectField field : mFieldList){ 21 | wrapper = new fieldDataWrapper(); 22 | wrapper.label = field.getDescribe().getLabel(); 23 | wrapper.fieldName = field.getDescribe().getName(); 24 | wrapper.type = String.valueOf(field.getDescribe().getType()); 25 | wrapperList.add(wrapper); 26 | } 27 | 28 | wrapper = new fieldDataWrapper(); 29 | wrapper.label = 'Row Number'; 30 | wrapper.fieldName = 'RowNumber'; 31 | wrapper.type = 'Integer'; 32 | wrapperList.add(0,wrapper); 33 | 34 | 35 | system.debug('wrapperList '+wrapperList); 36 | resultWrapper result = new resultWrapper(objectName, columnNames, wrapperList, 37 | rowCount,viewMore); 38 | system.debug('result '+result); 39 | return result; 40 | } 41 | 42 | 43 | 44 | public class resultWrapper{ 45 | @AuraEnabled public string objectType {get; set;} 46 | @AuraEnabled public string columnName {get; set;} 47 | @AuraEnabled public List fieldDetails {get; set;} 48 | @AuraEnabled public Decimal rowCount {get;set;} 49 | @AuraEnabled public Boolean viewMoreOption {get;set;} 50 | public resultWrapper(String obj, String columns, List fields, Decimal noRows, Boolean enableViewMore){ 51 | objectType = obj; 52 | columnName = columns; 53 | fieldDetails = fields; 54 | rowCount = noRows; 55 | viewMoreOption = enableViewMore; 56 | } 57 | } 58 | 59 | public class fieldDataWrapper{ 60 | @AuraEnabled public String label { get; set; } 61 | @AuraEnabled public String fieldName { get; set; } 62 | @AuraEnabled public String type { get; set; } 63 | } 64 | 65 | @AuraEnabled 66 | public static List getData(String ObjectName, String ColumnNames){ 67 | system.debug('ObjectName is '+ObjectName+'****** Columns are '+ColumnNames); 68 | String query='SELECT '+ColumnNames+' FROM '+ObjectName+' ORDER BY Name ASC NULLS LAST'; 69 | List sobjList = Database.query(query); 70 | return sobjList; 71 | } 72 | 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /force-app/main/default/classes/FormField.cls: -------------------------------------------------------------------------------- 1 | public class FormField { 2 | 3 | public FormField(Schema.FieldSetMember f) { 4 | this.IsRequired = f.DBRequired; 5 | this.APIName = f.fieldPath; 6 | this.Label = f.label; 7 | this.Required = f.required; 8 | this.Type = String.valueOf(f.getType()); 9 | } 10 | 11 | public FormField(Boolean required) { 12 | this.IsRequired = required; 13 | } 14 | 15 | @AuraEnabled 16 | public Boolean IsRequired { get;set; } 17 | @AuraEnabled 18 | public String APIName { get;set; } 19 | @AuraEnabled 20 | public String Label { get;set; } 21 | @AuraEnabled 22 | public Boolean Required { get;set; } 23 | @AuraEnabled 24 | public String Type { get; set; } 25 | } -------------------------------------------------------------------------------- /force-app/main/default/classes/FormField.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/FutureMethdExample.cls: -------------------------------------------------------------------------------- 1 | public with sharing class FutureMethdExample { 2 | 3 | 4 | @future 5 | public static void doLondCalculation() { 6 | 7 | for (Integer i = 0; i < 200000; i++) { 8 | 9 | for (Integer j = 0; j < 200000; j++) { 10 | System.debug('future '+i); 11 | } 12 | } 13 | 14 | } 15 | 16 | 17 | 18 | public static void simple() { 19 | 20 | for (Integer i = 0; i < 200000; i++) { 21 | System.debug('simple '+i); 22 | } 23 | 24 | 25 | } 26 | 27 | 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /force-app/main/default/classes/FutureMethdExample.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/GetRecordTypeHelper.cls: -------------------------------------------------------------------------------- 1 | public with sharing class GetRecordTypeHelper { 2 | 3 | 4 | List recType = [SELECT Id, Name FROM RecordType WHERE sObjectType='Account']; 5 | 6 | 7 | 8 | @AuraEnabled(cacheable=true) 9 | public static List getRecordTypeObjectAccount(){ 10 | 11 | List lstAccountRecordTypes = [SELECT Id, Name FROM RecordType WHERE sObjectType='Account']; 12 | 13 | return lstAccountRecordTypes; 14 | 15 | } 16 | 17 | @AuraEnabled(cacheable=true) 18 | public static List getContactWithName(String sssname){ 19 | 20 | String ser='%'+sssname+'%'; 21 | 22 | List lstAccountRecordTypes = [SELECT Id, Name FROM Contact where Name like :ser]; 23 | 24 | return lstAccountRecordTypes; 25 | } 26 | 27 | 28 | @AuraEnabled(cacheable=true) 29 | public static List getAccountDetails(String searchString){ 30 | 31 | String ser='%'+searchString+'%'; 32 | 33 | 34 | List accountList = [SELECT Id, Name , (select Id,Name from Contacts) FROM Account where Name like :ser]; 35 | 36 | return accountList; 37 | } 38 | 39 | 40 | 41 | public List getrecType(){ 42 | recType = [SELECT Id, Name FROM RecordType WHERE sObjectType='Account']; 43 | return recType; 44 | } 45 | 46 | 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /force-app/main/default/classes/GetRecordTypeHelper.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/GoogleApiCreateContact.cls: -------------------------------------------------------------------------------- 1 | public with sharing class GoogleApiCreateContact { 2 | 3 | public List emailAddresses; 4 | public List names; 5 | public List phoneNumbers; 6 | 7 | 8 | public GoogleApiCreateContact(){ 9 | emailAddresses= new List(); 10 | names= new List(); 11 | phoneNumbers= new List(); 12 | 13 | 14 | } 15 | 16 | 17 | public class Names { 18 | public String givenName; 19 | 20 | public Names(String mGivenName){ 21 | this.givenName=mGivenName; 22 | } 23 | 24 | } 25 | 26 | 27 | 28 | public class EmailAddresses { 29 | public String value; 30 | 31 | public EmailAddresses(String mValue){ 32 | this.value=mValue; 33 | } 34 | 35 | } 36 | 37 | public class PhoneNumbers { 38 | public String value; 39 | 40 | public PhoneNumbers(String mValue){ 41 | this.value=mValue; 42 | } 43 | } 44 | 45 | 46 | public static GoogleApiCreateContact parse(String json) { 47 | return (GoogleApiCreateContact) System.JSON.deserialize(json, GoogleApiCreateContact.class); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /force-app/main/default/classes/GoogleContactController.cls: -------------------------------------------------------------------------------- 1 | public with sharing class GoogleContactController { 2 | 3 | 4 | @future(callout=true) 5 | public static void sendContactData(List id,String mApiKey){ 6 | 7 | 8 | System.debug('sendContactData mApiKey'+mApiKey ); 9 | 10 | List contactList=[SELECT Id,LastName,Phone,Email FROM Contact WHERE Id IN :id]; 11 | 12 | System.debug('contactList.size()'+contactList.size() ); 13 | 14 | if(contactList!=null && contactList.size()>0){ 15 | 16 | for(Contact contactObj : contactList){ 17 | system.debug(' *** email '+contactObj.Email); 18 | system.debug(' *** Name '+contactObj.LastName); 19 | system.debug(' *** Phone '+contactObj.Phone); 20 | sendRequestToGoogleAPI(contactObj.Email,contactObj.LastName,contactObj.Phone,mApiKey); 21 | } 22 | //sendRequestToGoogleAPI('email','Name','Name',mApiKey); 23 | } 24 | 25 | } 26 | 27 | 28 | 29 | 30 | public static void sendRequestToGoogleAPI(String email ,String userName,String phoneNumbers,String mApiKey){ 31 | 32 | system.debug('GoogleContactController'); 33 | GoogleApiCreateContact afterss= new GoogleApiCreateContact(); 34 | afterss.emailAddresses.add(new GoogleApiCreateContact.EmailAddresses(email)); 35 | afterss.names.add(new GoogleApiCreateContact.Names(userName)); 36 | afterss.phoneNumbers.add(new GoogleApiCreateContact.PhoneNumbers(phoneNumbers)); 37 | system.debug('GoogleApiCreateContact'+JSON.serialize(afterss)); 38 | 39 | 40 | Http httpObject = new Http(); 41 | HttpRequest request = new HttpRequest(); 42 | request.setHeader('Authorization', 'Bearer '+mApiKey); 43 | request.setHeader('Content-Type', 'application/json'); 44 | request.setHeader('Accept', 'application/json'); 45 | 46 | 47 | 48 | request.setBody(JSON.serialize(afterss)); 49 | 50 | request.setEndpoint('https://people.googleapis.com/v1/people:createContact'); 51 | request.setMethod('POST'); 52 | HttpResponse response = httpObject.send(request); 53 | String responseBody = response.getBody(); 54 | 55 | system.debug( 'responseBody'+responseBody); 56 | 57 | } 58 | 59 | 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /force-app/main/default/classes/OTPUtility.cls: -------------------------------------------------------------------------------- 1 | public with sharing class OTPUtility { 2 | 3 | 4 | @AuraEnabled 5 | public static String sendOtp(String contactId){ 6 | 7 | String message = ''; 8 | String OTP=''; 9 | boolean isEmailSend=false; 10 | boolean isRecordInserted=false; 11 | 12 | try { 13 | 14 | Contact con=[select id,name ,Email from Contact where id=:contactId]; 15 | 16 | if(con!=null && con.Email!=null){ 17 | 18 | OTP=''+getOTP(); 19 | 20 | isRecordInserted=CheckInUtility.createCheckinRecord(OTP,con); 21 | 22 | if(isRecordInserted){ 23 | isEmailSend=EmailUtility.sendEmail(con.Email,''+OTP+' Use this OTP for checkin'); 24 | isEmailSend=true; 25 | } 26 | 27 | 28 | 29 | if(isEmailSend){ 30 | message= 'Email Sent to the contact '+con.Email; 31 | } 32 | }else{ 33 | throw newMessageException('Something went wrong '); 34 | } 35 | 36 | 37 | 38 | } catch (Exception e) { 39 | throw newMessageException('Some thing went wrong jjj'+e.getMessage()); 40 | // message= 'some error'; 41 | } 42 | 43 | return message; 44 | } 45 | 46 | 47 | public static Integer getOTP(){ 48 | 49 | return Math.round((Math.random() * (90000) + 10000)); 50 | 51 | } 52 | 53 | @AuraEnabled 54 | public static String validateOTP(String contactId,String otp){ 55 | 56 | 57 | try { 58 | 59 | CheckIn__c checkinObject= [select id , name ,OTP__c from CheckIn__c where Contact__c=:contactId order by createdDate DESC limit 1]; 60 | 61 | 62 | if(checkinObject!=null && checkinObject.OTP__c==otp){ 63 | return 'OTP VALIDATED'; 64 | }else { 65 | throw newMessageException('INVALID OTP entered '); 66 | } 67 | 68 | 69 | 70 | } catch (Exception e) { 71 | throw newMessageException(e.getMessage()); 72 | } 73 | 74 | } 75 | 76 | 77 | private static AuraHandledException newMessageException(String message) { 78 | AuraHandledException e = new AuraHandledException(message); 79 | e.setMessage(message); 80 | return e; 81 | } 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /force-app/main/default/classes/OTPUtility.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/OlderAccountsUtility.cls: -------------------------------------------------------------------------------- 1 | public with sharing class OlderAccountsUtility { 2 | 3 | public static void updateOlderAccounts() { 4 | // Get the 5 oldest accounts 5 | Account[] oldAccounts = [SELECT Id, Description FROM Account ORDER BY CreatedDate ASC LIMIT 5]; 6 | // loop through them and update the Description field 7 | for (Account acct : oldAccounts) { 8 | acct.Description = 'Heritage Account'; 9 | } 10 | // save the change you made 11 | update oldAccounts; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /force-app/main/default/classes/OlderAccountsUtility.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 52.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/OpportunityTriggerHandler.cls: -------------------------------------------------------------------------------- 1 | public with sharing class OpportunityTriggerHandler { 2 | 3 | public static void handleOpportunityAfterInsert(List accounts) { 4 | 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /force-app/main/default/classes/OpportunityTriggerHandler.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/PANRequest.cls: -------------------------------------------------------------------------------- 1 | public with sharing class PANRequest { 2 | 3 | public String task_id; 4 | public String group_id; 5 | public PANData data; 6 | 7 | public PANRequest(String task_id, String group_id, String panNumber){ 8 | this.task_id = task_id; 9 | this.group_id = group_id; 10 | this.data = new PANData(panNumber); 11 | } 12 | 13 | 14 | 15 | class PANData { 16 | public String id_number; 17 | public PANData(String id_number){ 18 | this.id_number = id_number; 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /force-app/main/default/classes/PANRequest.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/PaymentUtility.cls: -------------------------------------------------------------------------------- 1 | public with sharing class PaymentUtility { 2 | 3 | 4 | @AuraEnabled 5 | public static Payment__c createPaymentRequest(Double amount,Id contactId){ 6 | 7 | Payment__c payment= new Payment__c(); 8 | payment.Amount__c=amount; 9 | payment.Status__c='Created'; 10 | payment.Customer__c=contactId; 11 | insert payment; 12 | return payment ; 13 | } 14 | 15 | 16 | @AuraEnabled 17 | public static string senPaymentLink(string requestString){ 18 | try { 19 | 20 | Http h = new Http(); 21 | HttpRequest req = new HttpRequest(); 22 | req.setEndpoint('https://api.razorpay.com/v1/payment_links/'); 23 | req.setHeader('Content-Type', 'application/json'); 24 | req.setHeader('Authorization', 'Basic '+System.Label.TestAPIKey); 25 | req.setMethod('POST'); 26 | 27 | 28 | String body =requestString; 29 | req.setBody(body); 30 | HttpResponse res = h.send(req); 31 | System.debug('*****************'+res.getBody()); 32 | return body+' ****** \n'+res.getBody(); 33 | 34 | }catch(Exception ew){ 35 | System.debug('EXEPTION '+ew); 36 | return ew.getMessage(); 37 | } 38 | } 39 | 40 | 41 | @AuraEnabled 42 | public static Payment__c getPaymentDetsils(Id referenceId){ 43 | Payment__c payment =[SELECT Id, Amount__c,Customer__r.Name ,Customer__r.email , Customer__r.phone FROM Payment__c WHERE Id =:referenceId]; 44 | return payment ; 45 | } 46 | 47 | 48 | 49 | 50 | @AuraEnabled 51 | public static String getStringBody() { 52 | 53 | String json= '{'+ 54 | ' "amount": "90909000",'+ 55 | ' "currency": "INR",'+ 56 | ' "accept_partial": true,'+ 57 | ' "first_min_partial_amount": 100,'+ 58 | ' "expire_by": 1691097057,'+ 59 | ' "reference_id": "fsksfhksfhsk",'+ 60 | ' "description": "Payment for policy no #23456",'+ 61 | ' "customer": {'+ 62 | ' "name": "Gaurav Kumar",'+ 63 | ' "contact": "+9190963138",'+ 64 | ' "email": "nitin.zdesfdc@gmail.com"'+ 65 | ' },'+ 66 | ' "notify": {'+ 67 | ' "sms": true,'+ 68 | ' "email": true'+ 69 | ' },'+ 70 | ' "reminder_enable": true,'+ 71 | ' "notes": {'+ 72 | ' "policy_name": "Jeevan Bima"'+ 73 | ' },'+ 74 | ' "callback_url": "https://example-callback-url.com/",'+ 75 | ' "callback_method": "get"'+ 76 | '}'; 77 | 78 | return json; 79 | } 80 | 81 | 82 | 83 | } -------------------------------------------------------------------------------- /force-app/main/default/classes/SchedulabeExample.cls: -------------------------------------------------------------------------------- 1 | public class SchedulabeExample implements Schedulable { 2 | 3 | public void execute(SchedulableContext SC) { 4 | System.debug('SchedulabeExample'); 5 | Database.executeBatch(new BatchApexExample()); 6 | } 7 | 8 | } 9 | 10 | -------------------------------------------------------------------------------- /force-app/main/default/classes/SchedulabeExample.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/StudentController.cls: -------------------------------------------------------------------------------- 1 | public with sharing class StudentController { 2 | 3 | 4 | @AuraEnabled(cacheable=true) 5 | public static List getStudentPassedDepartmentWise(String passingYear) { 6 | 7 | List departMentIdList = new List(); 8 | List departmentDataList = new List(); 9 | Map countMap = new Map(); 10 | 11 | 12 | system.debug( 'unique years'+[SELECT count(Id) ,passing_year__c FROM student2__C GROUP BY passing_year__c]); 13 | 14 | 15 | // AggregateResult[] groupedResults= [SELECT count(Id) ,Department2__c FROM student2__C where passing_year__c=:passingYear GROUP BY Department2__c]; 16 | 17 | 18 | for (AggregateResult aggRes : [SELECT count(Id) countofStudents , Department2__c departmentId FROM student2__C where passing_year__c=:passingYear GROUP BY Department2__c]) { 19 | 20 | Id departmentId = (Id) aggRes.get('departmentId'); 21 | departMentIdList.add(departmentId); 22 | countMap.put(departmentId,(Integer) aggRes.get('countofStudents')); 23 | 24 | } 25 | 26 | 27 | for(Department2__c department : [select Name ,id from Department2__c where id in: departmentIdList]){ 28 | departmentDataList.add(new DepartmentData(countMap.get(department.Id),department.name,department.Id)); 29 | } 30 | 31 | system.debug( 'departmentDataList'+departmentDataList); 32 | 33 | return departmentDataList; 34 | } 35 | 36 | 37 | 38 | @AuraEnabled(cacheable=true) 39 | public static List getUniqueYears(String test){ 40 | List listName = new List(); 41 | 42 | for (AggregateResult aggRes : [SELECT count(Id) ,passing_year__c passingYear FROM student2__C GROUP BY passing_year__c]){ 43 | listName.add((String) aggRes.get('passingYear')); 44 | } 45 | 46 | system.debug( 'listName'+listName); 47 | 48 | return listName; 49 | 50 | 51 | } 52 | 53 | 54 | @AuraEnabled(cacheable=true) 55 | public static List getStudentInfo(String passingYear,String depsrtmentId){ 56 | 57 | List studentList = new List(); 58 | studentList=[select id,name from student2__C where passing_year__c=:passingYear and Department2__c=:depsrtmentId]; 59 | system.debug( 'studentList'+studentList); 60 | return studentList; 61 | 62 | 63 | } 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | } 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /force-app/main/default/classes/StudentController.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/TestClassExample.cls: -------------------------------------------------------------------------------- 1 | 2 | @isTest 3 | public with sharing class TestClassExample { 4 | 5 | 6 | @TestSetup 7 | static void makeData(){ 8 | 9 | for (Integer i = 0; i<10;i++){ 10 | System.debug('Creating Account'+i); 11 | Account account = new Account(); 12 | account.name='Test Account'+i; 13 | insert account; 14 | } 15 | } 16 | 17 | 18 | @isTest 19 | static void method1(){ 20 | 21 | string serarch='%Test%'; 22 | 23 | List listName = new List(); 24 | listName=[select Id,Name from Account where name like :serarch]; 25 | System.assertEquals(listName.size(),10); 26 | 27 | } 28 | 29 | @isTest 30 | static void method2(){ 31 | 32 | System.assertEquals(1,1); 33 | 34 | } 35 | 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /force-app/main/default/classes/TestClassExample.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/UPIPayment.cls: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @RestResource(urlMapping='/webhook/') 6 | global without sharing class UPIPayment { 7 | 8 | @HttpDelete 9 | global static void doDelete() { 10 | 11 | } 12 | 13 | @HttpGet 14 | global static void doGet() { 15 | 16 | 17 | } 18 | 19 | @HttpPost 20 | global static void doPost() { 21 | try{ 22 | String fieldName; 23 | String fieldValue; 24 | 25 | String requestBody=''; 26 | 27 | 28 | 29 | RestRequest req = RestContext.request; 30 | RestResponse res = RestContext.response; 31 | 32 | requestBody=req.requestBody.toString(); 33 | JSONParser parser= JSON.createParser(requestBody); 34 | 35 | PaymentCallback l = PaymentCallback.parse(requestBody); 36 | 37 | if(l.event=='order.paid'){ 38 | String paymentId=l.payload.order.entity.receipt; 39 | 40 | Payment__c ddd= new Payment__c(); 41 | ddd.Id=paymentId; 42 | ddd.CallbackString__c=requestBody; 43 | ddd.Status__c='Success'; 44 | update ddd; 45 | } 46 | 47 | 48 | 49 | // while (parser.nextToken()!=null) { 50 | 51 | // if(parser.getCurrentToken()!=JSONToken.END_OBJECT){ 52 | 53 | // fieldName=parser.getCurrentName(); 54 | // fieldValue=parser.getText(); 55 | 56 | // if(fieldName=='event' && fieldValue=='order.paid'){ 57 | // PaymentCallback l = PaymentCallback.parse(requestBody); 58 | 59 | // if(l.event=='order.paid'){ 60 | // String paymentId=l.payload.order.entity.receipt; 61 | 62 | // Payment__c ddd= new Payment__c(); 63 | // ddd.Id=paymentId; 64 | // ddd.Status__c='Success'; 65 | // update ddd; 66 | 67 | 68 | 69 | // //List listPayment=[SELECT Id,name ,amount__c FROM Payment__c]; 70 | // System.debug('* listPayment *'+JSON.serialize(ddd)); 71 | // System.debug('* paymentId *'+paymentId); 72 | 73 | 74 | 75 | 76 | // // //updatePayment(paymentId); 77 | 78 | // // AutoLaunchedFlowExample__c sss= new AutoLaunchedFlowExample__c(); 79 | // // sss.TestText__c=' $$$$$$$'; 80 | // // sss.reachArea__c='payment ' +paymentId+' serialise '+JSON.serialize(ddd); 81 | // // insert sss; 82 | 83 | // } 84 | 85 | // } 86 | 87 | // } 88 | 89 | // } 90 | 91 | 92 | }catch(Exception ew){ 93 | 94 | System.debug('* paymentId *'+ew.getMessage()); 95 | 96 | } 97 | } 98 | 99 | // @future 100 | // public static void updatePayment(String paymentId) { 101 | // try{ 102 | 103 | // Payment__c payment= [select id,name from Payment__c where id=: paymentId]; 104 | 105 | // AutoLaunchedFlowExample__c sss= new AutoLaunchedFlowExample__c(); 106 | // sss.TestText__c=' @@@@@@@@@@@'; 107 | // sss.reachArea__c='payment ' +paymentId+JSON.serialize(payment); 108 | // insert sss; 109 | 110 | // }catch(Exception e){ 111 | // System.debug(' *** updatePayment'+e.getMessage()); 112 | 113 | // } 114 | // } 115 | 116 | 117 | 118 | } 119 | 120 | -------------------------------------------------------------------------------- /force-app/main/default/classes/UPIPayment.cls-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | Active 5 | 6 | -------------------------------------------------------------------------------- /force-app/main/default/classes/UPISettings.cls: -------------------------------------------------------------------------------- 1 | public with sharing class UPISettings { 2 | 3 | @AuraEnabled 4 | public String upiId{get;set;} 5 | @AuraEnabled 6 | public String bankAccountNumber{get;set;} 7 | @AuraEnabled 8 | public String ifscCode{get;set;} 9 | @AuraEnabled 10 | public String selerGstin{get;set;} 11 | 12 | } 13 | -------------------------------------------------------------------------------- /force-app/main/default/classes/WhatsAppApiController.cls: -------------------------------------------------------------------------------- 1 | public with sharing class WhatsAppApiController { 2 | 3 | 4 | @future(callout=true) 5 | public static void sendMessageWAFuture(List recordIds) { 6 | 7 | for(ID contact : recordIds){ 8 | sendMessageWA(''); 9 | } 10 | 11 | } 12 | 13 | 14 | 15 | 16 | 17 | @AuraEnabled 18 | public static void sendMessageWA(String mobNumber){ 19 | try { 20 | 21 | Http h = new Http(); 22 | 23 | HttpRequest req = new HttpRequest(); 24 | req.setEndpoint('https://graph.facebook.com/v13.0/114556351256883/messages'); 25 | req.setHeader('Content-Type', 'application/json'); 26 | req.setMethod('POST'); 27 | 28 | 29 | String boundary = '----------------------------' + String.valueOf(DateTime.now().getTime()); 30 | String body = '--' + boundary + '\r\n'; 31 | 32 | body += 'Content-Disposition: form-data; name="messaging_product"\r\n\n'; 33 | body += 'whatsapp\r\n'; 34 | body += '--' + boundary + '\r\n'; 35 | 36 | body += 'Content-Disposition: form-data; name="to"\r\n\n'; 37 | body += '919096213138\r\n'; 38 | body += '--' + boundary + '\r\n'; 39 | 40 | body += 'Content-Disposition: form-data; name="type"\r\n\n'; 41 | body += 'template\r\n'; 42 | body += '--' + boundary + '\r\n'; 43 | 44 | body += 'Content-Disposition: form-data; name="template"\r\n\n'; 45 | body += (new Template()).getJson() + '\r\n'; 46 | body += '--' + boundary + '--'; 47 | 48 | req.setBody(body); 49 | 50 | System.debug('createJobAppJSONString *** '+(new Template()).getJson()); 51 | 52 | 53 | String apiKEY=System.Label.WAAPITOEKN; 54 | 55 | req.setHeader('Authorization', 'Bearer '+apiKEY); 56 | req.setHeader('Content-Type', 'multipart/form-data; boundary=' + boundary); 57 | req.setHeader('Content-Length', String.valueof(body.length())); 58 | 59 | 60 | //req.setBodyAsBlob(formBlob); 61 | 62 | // Send the request, and return a response 63 | HttpResponse res = h.send(req); 64 | 65 | System.debug(''+res.getBody()); 66 | 67 | 68 | 69 | } catch (Exception e) { 70 | throw new AuraHandledException(e.getMessage()); 71 | } 72 | } 73 | 74 | 75 | 76 | 77 | 78 | public class Template{ 79 | 80 | // public String name='hello_world'; 81 | public String name='test_template'; 82 | 83 | public Language language= new Language(); 84 | 85 | 86 | public String getJson() { 87 | String str = JSON.serialize(this); 88 | return str; 89 | } 90 | } 91 | 92 | public class Language { 93 | public String code='en_US'; 94 | } 95 | 96 | 97 | 98 | } 99 | -------------------------------------------------------------------------------- /force-app/main/default/classes/lwcSortingDataTableCtrl.cls: -------------------------------------------------------------------------------- 1 | public with sharing class lwcSortingDataTableCtrl { 2 | 3 | @AuraEnabled(cacheable=true) 4 | public static List getAccounts(Integer limitSize, Integer offset){ 5 | List accountList = [SELECT Id, Name, Phone, Industry, Description, Type, Website FROM Account 6 | ORDER BY CreatedDate 7 | LIMIT :limitSize 8 | OFFSET :offset 9 | ]; 10 | return accountList; 11 | } 12 | 13 | 14 | @AuraEnabled(cacheable=true) 15 | public static List getCardDetsils(Integer limitSize, Integer offset){ 16 | List accountList = [SELECT Id, Name ,CreatedDate ,Channel__c ,FollowUp__c FROM Cart_Tracker__c 17 | ORDER BY CreatedDate 18 | LIMIT :limitSize 19 | OFFSET: offset 20 | ]; 21 | return accountList; 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@salesforce/eslint-config-lwc/recommended"], 3 | "overrides": [ 4 | { 5 | "files": ["*.test.js"], 6 | "rules": { 7 | "@lwc/lwc/no-unexpected-wire-adapter-usages": "off" 8 | } 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/birdDetail/birdDetail.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/birdDetail/birdDetail.js: -------------------------------------------------------------------------------- 1 | import { LightningElement ,wire} from 'lwc'; 2 | import { subscribe, MessageContext } from 'lightning/messageService'; 3 | import ANIMAL_DETAILS from '@salesforce/messageChannel/Animal_Detail__c'; 4 | 5 | export default class BirdDetail extends LightningElement { 6 | 7 | 8 | 9 | 10 | 11 | subscription = null; 12 | 13 | @wire(MessageContext) 14 | messageContext; 15 | 16 | animalObjectData 17 | 18 | connectedCallback() { 19 | 20 | this.subscribeToMessageChannel(); 21 | } 22 | 23 | 24 | subscribeToMessageChannel() { 25 | this.subscription = subscribe( 26 | this.messageContext, 27 | ANIMAL_DETAILS, 28 | (message) => this.handleMessage(message) 29 | ); 30 | } 31 | 32 | handleMessage(message) { 33 | this.animalObjectData = message.bidrdata; 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/birdDetail/birdDetail.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | lightning__HomePage 7 | 8 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/birdList/birdList.css: -------------------------------------------------------------------------------- 1 | .lll{ 2 | 3 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/birdList/birdList.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/birdList/birdList.js: -------------------------------------------------------------------------------- 1 | import { LightningElement,wire } from 'lwc'; 2 | import { publish, MessageContext,subscribe } from 'lightning/messageService'; 3 | import ANIMAL_DETAILS from '@salesforce/messageChannel/Animal_Detail__c'; 4 | import FILTER_DETAILS from '@salesforce/messageChannel/Filter_Detail__c'; 5 | import SELECTED_FILTER_DETAILS from '@salesforce/messageChannel/Selected_Filter_Detail__c'; 6 | 7 | 8 | export default class BirdList extends LightningElement { 9 | 10 | @wire(MessageContext) 11 | messageContext; 12 | 13 | birdList = []; 14 | filteredBirdList = []; 15 | 16 | connectedCallback() { 17 | // alert('connectedCallback'); 18 | this.hanleClick(); 19 | this.subscribeToMessageChannel(); 20 | 21 | } 22 | 23 | subscribeToMessageChannel() { 24 | 25 | this.subscription = subscribe( 26 | this.messageContext, 27 | SELECTED_FILTER_DETAILS, 28 | (message) => this.handleSelectedFilteredData(message) 29 | ); 30 | 31 | 32 | } 33 | 34 | 35 | hanleClick() { 36 | 37 | fetch('https://zoo-animal-api.herokuapp.com/animals/rand/10').then((response) => { 38 | 39 | if(response.ok) { 40 | return response.json(); 41 | } else { 42 | throw Error(response); 43 | } 44 | 45 | }).then(json => { 46 | 47 | //console.log('json' + Json.stringify(json)); 48 | 49 | 50 | this.birdList = json; 51 | this.filteredBirdList = json; 52 | 53 | 54 | 55 | 56 | // const unique = [...new Set(this.birdList.map(item => item.animal_type))]; // [ 'A', 'B'] 57 | // console.log(JSON.stringify(unique)); 58 | 59 | 60 | var filtered = this.birdList.filter(function({animal_type}) { 61 | var key = `${animal_type}`; 62 | return !this.has(key) && this.add(key); 63 | }, new Set); 64 | 65 | this.publishFilterData(filtered); 66 | 67 | 68 | 69 | 70 | 71 | }).catch((error) => { 72 | alert('Handle catch '+error.message); 73 | 74 | }) 75 | } 76 | 77 | handleDetailsClick(event) { 78 | var id = event.currentTarget.dataset.id; 79 | console.log('IDD' + id); 80 | var obj = this.birdList.find(obj => obj.id == id); 81 | console.log('indexObObject'+obj.name); 82 | this.publishAnimalSelectedFilter(obj); 83 | 84 | } 85 | 86 | 87 | publishAnimalSelectedFilter(selectedDetailObject) { 88 | 89 | const payload = { 90 | operator: 'add', 91 | constant: 1, 92 | bidrdata:selectedDetailObject 93 | }; 94 | 95 | publish(this.messageContext, ANIMAL_DETAILS, payload); 96 | 97 | } 98 | 99 | handleSelectedFilteredData(message) { 100 | 101 | //alert('handleSelectedFilteredData' + message.filterdata) 102 | this.showListAccordingToFilter(message.filterdata); 103 | 104 | } 105 | 106 | showListAccordingToFilter(selectedFilter) { 107 | 108 | //alert('showListAccordingToFilter' + selectedFilter); 109 | 110 | this.filteredBirdList= this.birdList.filter(function (el) { 111 | return el.animal_type === selectedFilter; 112 | }); 113 | 114 | this.publishAnimalSelectedFilter(null); 115 | 116 | } 117 | 118 | 119 | 120 | 121 | publishFilterData(unique) { 122 | 123 | const payload = { 124 | 125 | filterdata:unique 126 | }; 127 | 128 | publish(this.messageContext, FILTER_DETAILS, payload); 129 | 130 | } 131 | 132 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/birdList/birdList.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | 7 | lightning__HomePage 8 | 9 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/childComponant/childComponant.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/childComponant/childComponant.js: -------------------------------------------------------------------------------- 1 | import { LightningElement } from 'lwc'; 2 | 3 | export default class ChildComponant extends LightningElement { 4 | 5 | handleClick(event) { 6 | //alert('handleClick'); 7 | //this.dispatchEvent(new CustomEvent('senddata')); 8 | 9 | this.dispatchEvent(new CustomEvent('child', { 10 | 11 | detail: { 12 | name:"sachinnnnnn" 13 | } 14 | })); 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/childComponant/childComponant.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 52.0 4 | true 5 | 6 | 7 | lightning__AppPage 8 | lightning__HomePage 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/countDownTimer/countDownTimer.css: -------------------------------------------------------------------------------- 1 | .countdown { 2 | display: flex; 3 | justify-content: space-around; 4 | text-align: center; 5 | margin-bottom: 10%; 6 | background-color: blueviolet; 7 | padding: 15px; 8 | margin: 10px; 9 | border-radius: 5px; 10 | } 11 | 12 | .day, 13 | .hour, 14 | .minute, 15 | .second { 16 | font-size: 3rem; 17 | color: brown; 18 | background-color: aqua; 19 | padding: 5px; 20 | border-radius: 10px; 21 | } 22 | 23 | .text{ 24 | color: aqua; 25 | } 26 | 27 | .colon { 28 | font-size: 3rem; 29 | color: aqua; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/countDownTimer/countDownTimer.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/countDownTimer/countDownTimer.js: -------------------------------------------------------------------------------- 1 | import { api, LightningElement, track ,wire} from 'lwc'; 2 | import { getRecord, getFieldValue } from 'lightning/uiRecordApi'; 3 | import CLOSE_DATE from '@salesforce/schema/Opportunity.CloseDate'; 4 | 5 | 6 | export default class CountDownTimer extends LightningElement { 7 | 8 | @track 9 | textSecond; 10 | 11 | @track 12 | textMinute; 13 | 14 | @track 15 | textHour; 16 | 17 | @track 18 | textDay; 19 | 20 | @api 21 | recordId 22 | 23 | @track 24 | isClosedDatePassed=true; 25 | 26 | @track 27 | isDataLoaded=false; 28 | 29 | @track 30 | labelSecond 31 | 32 | 33 | @wire(getRecord, { recordId: '$recordId', fields: [CLOSE_DATE]}) 34 | wiredRecord({ error, data }) { 35 | if (error) { 36 | alert('Data error'); 37 | } else if (data) { 38 | this.isDataLoaded=true; 39 | this.checkDate(getFieldValue(data, CLOSE_DATE)); 40 | } 41 | } 42 | 43 | checkDate(oppCloseDate){ 44 | const closeDate= new Date(oppCloseDate); 45 | const today= new Date(); 46 | if(closeDate>today){ 47 | this.isClosedDatePassed=false; 48 | this.startTimer(oppCloseDate); 49 | } 50 | } 51 | 52 | startTimer(oppCloseDate){ 53 | 54 | setInterval(() => { 55 | const countDate = new Date(oppCloseDate).getTime(); 56 | const now = new Date().getTime(); 57 | const remainingTime = countDate - now; 58 | const second = 1000; 59 | const minute = second * 60; 60 | const hour = minute * 60; 61 | const day = hour * 24; 62 | 63 | this.textDay = Math.floor(remainingTime / day); 64 | this.textHour = Math.floor((remainingTime % day) / hour); 65 | this.textMinute = Math.floor((remainingTime % hour) / minute); 66 | this.textSecond = Math.floor((remainingTime % minute) / second); 67 | 68 | if(this.textSecond>1){ 69 | this.labelSecond='Seconds' 70 | }else{ 71 | this.labelSecond='Second' 72 | } 73 | 74 | 75 | },1000) 76 | } 77 | 78 | 79 | 80 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/countDownTimer/countDownTimer.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | 7 | lightning__RecordPage 8 | 9 | 10 | 11 | 12 | 13 | 14 | Opportunity 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createAccount/createAccount.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createAccount/createAccount.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track } from 'lwc'; 2 | 3 | import ACCOUNT from '@salesforce/schema/Account'; 4 | import ACCOUNT_NAME from '@salesforce/schema/Account.Name'; 5 | import create from '@salesforce/apex/AccountCreateUtility.create' 6 | 7 | 8 | export default class CreateAccount extends LightningElement { 9 | 10 | @track 11 | acountName=ACCOUNT_NAME; 12 | 13 | rec = { 14 | Name: this.acountName 15 | } 16 | 17 | handleNameChange(event) { 18 | 19 | this.rec.Name = event.target.value; 20 | console.log('CreateAccount' + this.rec.Name); 21 | 22 | } 23 | 24 | handleClick(event) { 25 | 26 | create({ acc: this.rec }).then((response) => { 27 | 28 | alert('Record created '); 29 | }).catch((error) => { 30 | 31 | alert('Something went wrong'); 32 | }) 33 | 34 | } 35 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/createAccount/createAccount.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | 7 | lightning__HomePage 8 | lightning__RecordPage 9 | 10 | 11 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactFieldSet/__tests__/createContactFieldSet.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import CreateContactFieldSet from 'c/createContactFieldSet'; 3 | 4 | describe('c-create-contact-field-set', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-create-contact-field-set', { 15 | is: CreateContactFieldSet 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactFieldSet/createContactFieldSet.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactFieldSet/createContactFieldSet.js: -------------------------------------------------------------------------------- 1 | import LightningModal from 'lightning/modal'; 2 | import { api } from 'lwc'; 3 | 4 | export default class CreateContactFieldSet extends LightningModal { 5 | 6 | 7 | @api 8 | accountRecordID 9 | 10 | isLoading=false; 11 | 12 | 13 | handleSuccess(event){ 14 | this.isLoading=false; 15 | this.close('okay'); 16 | } 17 | 18 | 19 | onSubmitHandler(event){ 20 | this.isLoading=true; 21 | event.preventDefault(); 22 | const fields = event.detail.fields; 23 | fields['AccountId'] = this.accountRecordID 24 | // alert(JSON.stringify(fields)); 25 | this.template.querySelector('lightning-record-edit-form').submit(fields); 26 | 27 | } 28 | 29 | 30 | 31 | handleError(event){ 32 | alert(JSON.stringify(event)); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactFieldSet/createContactFieldSet.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | false 5 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactFlow/__tests__/createContactFlow.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import CreateContactFlow from 'c/createContactFlow'; 3 | 4 | describe('c-create-contact-flow', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-create-contact-flow', { 15 | is: CreateContactFlow 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactFlow/createContactFlow.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactFlow/createContactFlow.js: -------------------------------------------------------------------------------- 1 | import { api, LightningElement } from 'lwc'; 2 | import LightningModal from 'lightning/modal'; 3 | 4 | 5 | export default class CreateContactFlow extends LightningModal { 6 | 7 | @api 8 | content 9 | 10 | 11 | handleStatusChange(event) { 12 | 13 | if(event.detail.status=='FINISHED'){ 14 | console.log(' ** handleStatusChange FINISHED'); 15 | 16 | // this.dispatchEvent(new CustomEvent('select')); 17 | this.close('okay'); 18 | 19 | } 20 | } 21 | 22 | get inputVariables() { 23 | return [ 24 | { 25 | name: 'recordId', 26 | type: 'String', 27 | value: this.content 28 | } 29 | ]; 30 | } 31 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactFlow/createContactFlow.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | false 5 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactManually/__tests__/createContactManually.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import CreateContactManually from 'c/createContactManually'; 3 | 4 | describe('c-create-contact-manually', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-create-contact-manually', { 15 | is: CreateContactManually 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactManually/createContactManually.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactManually/createContactManually.js: -------------------------------------------------------------------------------- 1 | import { api } from 'lwc'; 2 | import LightningModal from 'lightning/modal'; 3 | import { createRecord } from "lightning/uiRecordApi"; 4 | import CONTACT_OBJECT from "@salesforce/schema/Contact"; 5 | 6 | 7 | 8 | export default class CreateContactManually extends LightningModal { 9 | 10 | @api 11 | accountRecordID 12 | 13 | isLoading=false; 14 | 15 | fields ={}; 16 | 17 | handleInputChange(event) { 18 | 19 | var value = event.target.value; 20 | var datasetId=event.target.dataset.id; 21 | 22 | if(value.length>0){ 23 | 24 | this.fields =({ 25 | ...this.fields ,[datasetId]:value 26 | }); 27 | 28 | }else{ 29 | delete this.fields [datasetId]; 30 | } 31 | 32 | } 33 | 34 | validateFields() { 35 | let isValid = true; 36 | 37 | this.template.querySelectorAll('.validate').forEach(element => { 38 | 39 | if(!element.checkValidity()) { 40 | element.reportValidity(); 41 | isValid = false; 42 | } 43 | 44 | 45 | }); 46 | 47 | return isValid; 48 | } 49 | 50 | handleSubmit(event){ 51 | 52 | this.fields['AccountId'] = this.accountRecordID 53 | //alert(this.validateFields()); 54 | 55 | if(this.validateFields()){ 56 | this.isLoading=true; 57 | this.createContactRecord(); 58 | }else{ 59 | alert('Please enter all fields'); 60 | } 61 | } 62 | 63 | createContactRecord() { 64 | 65 | const recordInput = { 66 | apiName:'Contact', 67 | fields: this.fields 68 | }; 69 | 70 | 71 | 72 | //5. Invoke createRecord by passing the config object 73 | createRecord(recordInput).then((record) => { 74 | //console.log(record); 75 | // alert('record'); 76 | this.isLoading=false; 77 | this.close('okay'); 78 | }).catch((error)=>{ 79 | this.isLoading=false; 80 | alert('error'+ JSON.stringify(error)); 81 | }); 82 | } 83 | 84 | 85 | 86 | 87 | 88 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactManually/createContactManually.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | false 5 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactUsingFieldSet/__tests__/createContactUsingFieldSet.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import CreateContactUsingFieldSet from 'c/createContactUsingFieldSet'; 3 | 4 | describe('c-create-contact-using-field-set', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-create-contact-using-field-set', { 15 | is: CreateContactUsingFieldSet 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactUsingFieldSet/createContactUsingFieldSet.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactUsingFieldSet/createContactUsingFieldSet.js: -------------------------------------------------------------------------------- 1 | import { api } from 'lwc'; 2 | import LightningModal from 'lightning/modal'; 3 | import { createRecord } from "lightning/uiRecordApi"; 4 | import CONTACT_OBJECT from "@salesforce/schema/Contact"; 5 | 6 | export default class CreateContactUsingFieldSet extends LightningModal { 7 | 8 | @api 9 | fields 10 | 11 | @api 12 | objectName 13 | 14 | @api 15 | accountRecordID 16 | 17 | 18 | isLoading=false; 19 | 20 | 21 | onSubmitHanlder(event) 22 | { 23 | // const inputFields = e.detail.fields; 24 | // this.template.querySelector('lightning-record-edit-form').submit(inputFields); 25 | 26 | this.isLoading=true; 27 | event.preventDefault(); 28 | const fields = event.detail.fields; 29 | fields['AccountId'] = this.accountRecordID 30 | //alert(JSON.stringify(fields)); 31 | this.template.querySelector('lightning-record-edit-form').submit(fields); 32 | 33 | } 34 | validateFields() { 35 | return [...this.template.querySelectorAll("lightning-input-field")].reduce((validSoFar, field) => { 36 | return (validSoFar && field.reportValidity()); 37 | }, true); 38 | } 39 | handleSuccess(e) 40 | { 41 | //this.showMessage('Record Saved Successfully','success'); 42 | this.isLoading=false; 43 | this.close('okay'); 44 | } 45 | handleError(e) 46 | { 47 | this.template.querySelector('[data-id="message"]').setError(e.detail.detail); 48 | e.preventDefault(); 49 | } 50 | 51 | showMessage(message,variant) 52 | { 53 | const event = new ShowToastEvent({ 54 | title: 'Record Save', 55 | variant: variant, 56 | mode: 'dismissable', 57 | message: message 58 | }); 59 | this.dispatchEvent(event); 60 | } 61 | 62 | 63 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/createContactUsingFieldSet/createContactUsingFieldSet.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | false 5 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/displayRecordType/displayRecordType.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/displayRecordType/displayRecordType.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track, wire } from 'lwc'; 2 | 3 | import getRecordTypeObjectAccount from '@salesforce/apex/GetRecordTypeHelper.getRecordTypeObjectAccount' 4 | import getContactWithName from '@salesforce/apex/GetRecordTypeHelper.getContactWithName' 5 | import getAccountDetails from '@salesforce/apex/GetRecordTypeHelper.getAccountDetails' 6 | 7 | 8 | export default class DisplayRecordType extends LightningElement { 9 | 10 | 11 | @track 12 | recordTypeDatass 13 | 14 | @track 15 | accountDetails 16 | 17 | contactData; 18 | 19 | searchParam=""; 20 | 21 | @wire(getRecordTypeObjectAccount) 22 | recordTypeData 23 | 24 | @wire(getContactWithName, { sssname: '$searchParam' }) 25 | wiredData({ error, data }) { 26 | if (data) { 27 | console.log('Data', data); 28 | this.contactData = data; 29 | //alert('Data'); 30 | } else if (error) { 31 | console.error('Error:', error); 32 | alert('Error'); 33 | } 34 | } 35 | 36 | @wire(getAccountDetails, { searchString: '$searchParam' }) 37 | wiredData({ error, data }) { 38 | if (data) { 39 | //console.log('Data', data); 40 | this.accountDetails = data; 41 | 42 | this.accountDetails.forEach(element => { 43 | console.log("Contact "+element.Contacts); 44 | }); 45 | 46 | 47 | // alert('getAccountDetails') 48 | } else if (error) { 49 | console.error('Error:', error); 50 | } 51 | } 52 | 53 | 54 | 55 | handlechange(event) { 56 | 57 | //alert('VALUE' + event.target.value) 58 | 59 | this.searchParam = event.target.value; 60 | 61 | } 62 | 63 | 64 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/displayRecordType/displayRecordType.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | 7 | lightning__HomePage 8 | lightning__RecordPage 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/displayYearDataComponent/displayYearDataComponent.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/displayYearDataComponent/displayYearDataComponent.js: -------------------------------------------------------------------------------- 1 | import { LightningElement,api, wire ,track} from 'lwc'; 2 | import getStudentPassedDepartmentWise from '@salesforce/apex/StudentController.getStudentPassedDepartmentWise'; 3 | 4 | export default class DisplayYearDataComponent extends LightningElement { 5 | 6 | // @AuraEnabled 7 | // public Integer numberOfStudents; 8 | // @AuraEnabled 9 | // public String departmentName; 10 | // @AuraEnabled 11 | // public ID departmentId; 12 | 13 | employeeColumns = [ 14 | 15 | { label: 'Department Id', fieldName: 'numberOfStudents' }, 16 | { label: 'Department Name', fieldName: 'departmentName' }, 17 | { label: 'Department Id', fieldName: 'departmentId' }, 18 | { 19 | type:"button", 20 | fixedWidth: 150, 21 | typeAttributes: { 22 | label: 'Details', 23 | name: 'edit', 24 | variant: 'brand' 25 | } 26 | } 27 | ]; 28 | 29 | 30 | @api 31 | yearSelected = ''; 32 | 33 | @track 34 | departmentData; 35 | 36 | @wire(getStudentPassedDepartmentWise, { passingYear: '$yearSelected' }) 37 | getDataForSelectedYear({ error, data }) { 38 | 39 | if (data && data.length > 0) { 40 | this.departmentData = data; 41 | //alert('data json '+JSON.stringify(data)); 42 | } else if (error) { 43 | alert('error wire '+JSON.stringify(error)); 44 | } 45 | 46 | } 47 | 48 | handleDisplayClick(event) { 49 | var deptName = ''; 50 | 51 | 52 | // alert('' + event.currentTarget.dataset.id); 53 | 54 | // alert(event.detail.row.departmentId); 55 | // // JSON.stringify(event.detail.row) 56 | // alert(JSON.stringify(event.detail.row)); 57 | 58 | var result = this.departmentData.filter(obj => { 59 | return obj.departmentId === event.detail.row.departmentId 60 | }) 61 | 62 | deptName = result[0].departmentName; 63 | 64 | const selectEvent = new CustomEvent('mycustomevent', { 65 | detail: { 66 | id: event.detail.row.departmentId, 67 | selectedyear: this.yearSelected, 68 | departmentName: deptName 69 | } 70 | }); 71 | this.dispatchEvent(selectEvent); 72 | 73 | } 74 | 75 | 76 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/displayYearDataComponent/displayYearDataComponent.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | lightning__HomePage 7 | lightning__AppPage 8 | 9 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/displaydata/displaydata.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/displaydata/displaydata.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, wire } from 'lwc'; 2 | 3 | import getAccountInfo from '@salesforce/apex/AccountDetailController.getAccountInfo' 4 | 5 | export default class Displaydata extends LightningElement { 6 | 7 | columns = [{label: 'ID',fieldName: 'ID'},{label: 'Name',fieldName: 'Name'}]; 8 | 9 | @wire(getAccountInfo) accountList; 10 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/displaydata/displaydata.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | 7 | lightning__RecordPage 8 | 9 | 10 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/dtExample/__tests__/dtExample.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import DtExample from 'c/dtExample'; 3 | 4 | describe('c-dt-example', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-dt-example', { 15 | is: DtExample 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/dtExample/dtExample.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .THIS.slds-icon-utility-error svg { 4 | fill: rgb(239 65 70); 5 | } 6 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/dtExample/dtExample.html: -------------------------------------------------------------------------------- 1 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/dtExample/dtExample.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | lightning__AppPage 7 | lightning__RecordPage 8 | lightning__HomePage 9 | 10 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/exchangeRate/exchangeRate.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/exchangeRate/exchangeRate.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track } from 'lwc'; 2 | import getAvailableSymbols from '@salesforce/apex/ExchangeController.getAvailableSymbols'; 3 | import convert from '@salesforce/apex/ExchangeController.convert'; 4 | 5 | 6 | 7 | export default class ExchangeRate extends LightningElement { 8 | 9 | 10 | @track 11 | res=[]; 12 | 13 | @track 14 | test=[]; 15 | 16 | result; 17 | 18 | fromelSelected; 19 | fromelSelectedText; 20 | 21 | 22 | toSelected; 23 | toSelectedText; 24 | 25 | 26 | convertButtnstateDisabled=true 27 | 28 | inputedAmmount 29 | 30 | 31 | connectedCallback() { 32 | this.handleClick(); 33 | } 34 | 35 | handleFromSelected(event) { 36 | // alert(event.target.value); 37 | 38 | this.result=null; 39 | 40 | const item = this.test.find(item => item.value === event.target.value); 41 | this.fromelSelectedText=item.name; 42 | 43 | this.fromelSelected = event.target.value; 44 | this.checkConvertState(); 45 | 46 | } 47 | 48 | 49 | handleToSelected(event) { 50 | // alert(event.target.value); 51 | 52 | this.result=null; 53 | 54 | const item = this.test.find(item => item.value === event.target.value); 55 | this.toSelectedText=item.name; 56 | 57 | 58 | this.toSelected=event.target.value; 59 | this.checkConvertState(); 60 | } 61 | 62 | checkConvertState(){ 63 | this.convertButtnstateDisabled=! ( (this.fromelSelected) && (this.toSelected) && (this.inputedAmmount) ); 64 | 65 | } 66 | 67 | handleChange(event){ 68 | this.inputedAmmount = event.target.value; 69 | this.checkConvertState(); 70 | } 71 | 72 | handleConvertClick(){ 73 | 74 | convert({fromCountry:this.fromelSelected ,toCountry:this.toSelected,amount:this.inputedAmmount}).then((response)=>{ 75 | 76 | // alert(JSON.stringify(response)); 77 | 78 | if(response!= null) { 79 | 80 | const symbols=JSON.parse(response.replace(/\r?\n|\r/g, '')) 81 | //alert(JSON.stringify(symbols)); 82 | this.result=symbols.result; 83 | 84 | 85 | } 86 | 87 | }).catch((error)=>{ 88 | alert("convert errorMessage"+error); 89 | }); 90 | 91 | } 92 | 93 | 94 | 95 | handleClick(){ 96 | 97 | // alert("handleClick"); 98 | console.log(' ***** sucess *****'); 99 | 100 | getAvailableSymbols({}).then((response)=>{ 101 | 102 | if(response!=null){ 103 | this.processcountryData(response); 104 | } 105 | 106 | 107 | }).catch((error)=>{ 108 | alert("getAvailableSymbols errorMessage"+error); 109 | }); 110 | 111 | 112 | } 113 | 114 | 115 | processcountryData(response){ 116 | 117 | const symbols=JSON.parse(response.replace(/\r?\n|\r/g, '')).symbols; 118 | const keys = Object.keys(symbols); 119 | 120 | for(let i = 0; i (a.name > b.name ? 1 : -1)) 130 | 131 | 132 | }; 133 | 134 | 135 | } 136 | 137 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/exchangeRate/exchangeRate.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | 7 | lightning__HomePage 8 | lightning__AppPage 9 | 10 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/filterselection/filterselection.css: -------------------------------------------------------------------------------- 1 | .filtercardcontainer{ 2 | margin: 10px; 3 | padding: 10px; 4 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/filterselection/filterselection.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/filterselection/filterselection.js: -------------------------------------------------------------------------------- 1 | import { LightningElement ,wire,track} from 'lwc'; 2 | import { publish,subscribe, MessageContext } from 'lightning/messageService'; 3 | import FILTER_DETAILS from '@salesforce/messageChannel/Filter_Detail__c'; 4 | import SELECTED_FILTER_DETAILS from '@salesforce/messageChannel/Selected_Filter_Detail__c'; 5 | 6 | 7 | 8 | 9 | export default class Filterselection extends LightningElement { 10 | 11 | 12 | subscription = null; 13 | 14 | filterdata; 15 | 16 | @track 17 | TypeOptions=[]; 18 | 19 | 20 | @wire(MessageContext) 21 | messageContext; 22 | 23 | 24 | connectedCallback() { 25 | 26 | this.subscribeToMessageChannel(); 27 | } 28 | 29 | 30 | subscribeToMessageChannel() { 31 | 32 | this.subscription = subscribe( 33 | this.messageContext, 34 | FILTER_DETAILS, 35 | (message) => this.handleMessage(message) 36 | ); 37 | 38 | // create array 39 | 40 | 41 | } 42 | 43 | handleMessage(message) { 44 | this.filterdata = message.filterdata; 45 | let options = []; 46 | 47 | 48 | 49 | this.filterdata = this.filterdata.map((item) => 50 | Object.assign({}, item, {label:item.animal_type,value:item.animal_type}) 51 | ) 52 | 53 | this.filterdata.forEach((ele) => { 54 | 55 | options.push({ label: ele.label, value: ele.value }); 56 | 57 | }) 58 | 59 | 60 | // var len = this.filterdata.length; 61 | 62 | // for (var i = 0; i 2 | 3 | 54.0 4 | true 5 | 6 | 7 | lightning__HomePage 8 | 9 | 10 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/myChildComponant/myChildComponant.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/myChildComponant/myChildComponant.js: -------------------------------------------------------------------------------- 1 | import { api, LightningElement, track } from 'lwc'; 2 | import labelName from '@salesforce/label/c.Error_Message'; 3 | 4 | export default class MyChildComponant extends LightningElement { 5 | 6 | 7 | @api 8 | nameFromParent = ""; 9 | 10 | 11 | handleButtonCLick() { 12 | 13 | console.log(this.nameFromParent); 14 | alert('HIii fgfg '+labelName); 15 | 16 | // var ss = new CustomEvent("senddata"); 17 | // this.dispachEvent(ss); 18 | 19 | 20 | this.dispatchEvent(new CustomEvent('child')); 21 | 22 | } 23 | 24 | 25 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/myChildComponant/myChildComponant.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | false 5 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/myParentCOmponant/myParentCOmponant.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/myParentCOmponant/myParentCOmponant.js: -------------------------------------------------------------------------------- 1 | import { LightningElement } from 'lwc'; 2 | 3 | export default class MyParentCOmponant extends LightningElement { 4 | 5 | 6 | onEventDataReciaved(event) { 7 | 8 | alert('onEventDataReciaved'); 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/myParentCOmponant/myParentCOmponant.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | 7 | 8 | lightning__HomePage 9 | lightning__AppPage 10 | lightning__RecordPage 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/paginator/__tests__/paginator.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import Paginator from 'c/paginator'; 3 | 4 | describe('c-paginator', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-paginator', { 15 | is: Paginator 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/paginator/paginator.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/paginator/paginator.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, api, track } from 'lwc'; 2 | /* eslint-disable no-console */ 3 | /* eslint-disable no-alert */ 4 | export default class Paginator extends LightningElement { 5 | 6 | @api 7 | changeView(str){ 8 | if(str === 'trueprevious'){ 9 | // this.template.querySelector('lightning-button.Previous').disabled = true; 10 | this.template.querySelector('[data-id="previous"]').disabled=true; 11 | 12 | } 13 | if(str === 'falsenext'){ 14 | // this.template.querySelector('lightning-button.Next').disabled = false; 15 | this.template.querySelector('[data-id="next"]').disabled=false; 16 | 17 | } 18 | if(str === 'truenext'){ 19 | // this.template.querySelector('lightning-button.Next').disabled = true; 20 | this.template.querySelector('[data-id="next"]').disabled=true; 21 | 22 | } 23 | if(str === 'falseprevious'){ 24 | // this.template.querySelector('lightning-button.Previous').disabled = false; 25 | this.template.querySelector('[data-id="previous"]').disabled=false; 26 | 27 | } 28 | } 29 | renderedCallback(){ 30 | // this.template.querySelector('lightning-button.Previous').disabled = true; 31 | 32 | this.template.querySelector('[data-id="previous"]').disabled=true; 33 | 34 | 35 | // data-id="overview" 36 | } 37 | previousHandler1() { 38 | this.dispatchEvent(new CustomEvent('previous')); 39 | } 40 | 41 | nextHandler1() { 42 | this.dispatchEvent(new CustomEvent('next')); 43 | } 44 | FirstPageHandler1(){ 45 | this.dispatchEvent(new CustomEvent('firstpage')); 46 | } 47 | LastPageHandler1(){ 48 | this.dispatchEvent(new CustomEvent('lastpage')); 49 | } 50 | changeHandler(event){ 51 | event.preventDefault(); 52 | const s_value = event.target.value; 53 | const selectedEvent = new CustomEvent('selected', { detail: s_value}); 54 | 55 | this.dispatchEvent(selectedEvent); 56 | 57 | } 58 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/paginator/paginator.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | false 5 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/parentComponant/parentComponant.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/parentComponant/parentComponant.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track,wire } from 'lwc'; 2 | import getAvailableObjects from '@salesforce/apex/CallFromCustomeButton.getAvailableObjects'; 3 | 4 | 5 | export default class ParentComponant extends LightningElement { 6 | 7 | selectedValue; 8 | 9 | @track 10 | dataList = [] 11 | @track 12 | error 13 | 14 | options = [ 15 | { label: 'New', value: 'new' }, 16 | { label: 'In Progress', value: 'inProgress' }, 17 | { label: 'Finished', value: 'finished' } 18 | ] 19 | sample=[] 20 | 21 | // get options() { 22 | // return [ 23 | // { label: 'New', value: 'new' }, 24 | // { label: 'In Progress', value: 'inProgress' }, 25 | // { label: 'Finished', value: 'finished' }, 26 | // ]; 27 | // } 28 | 29 | 30 | @wire(getAvailableObjects) 31 | getAvailableObjects({ error, data }) { 32 | if (data) { 33 | console.log('Data', data); 34 | } else if (error) { 35 | console.error('Error:', error); 36 | } 37 | } 38 | 39 | 40 | displayEventData(event) { 41 | 42 | //const dataV = event.detail.name; 43 | 44 | //alert('Hidddddd '+dataV) 45 | } 46 | 47 | connectedCallback() { 48 | 49 | // alert('connectedCallback') 50 | 51 | getAvailableObjects().then(result => { 52 | //alert('result' + result.size); 53 | this.dataList = result; 54 | 55 | // console.log('result' + result); 56 | // console.log('this.dataList' + this.dataList); 57 | 58 | for (var i in this.dataList) { 59 | var item = this.dataList[i]; 60 | this.sample.push({ 61 | label : item.named, 62 | value : item.named, 63 | }); 64 | 65 | 66 | //console.log("I is " + i); 67 | 68 | 69 | } 70 | 71 | this.options = this.sample; 72 | 73 | console.log("this.options " + this.options); 74 | 75 | }).catch(err => { 76 | alert('err'); 77 | error = err; 78 | }) 79 | 80 | 81 | } 82 | 83 | handleChange(event) { 84 | this.selectedValue = event.target.value; 85 | 86 | } 87 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/parentComponant/parentComponant.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 52.0 4 | true 5 | 6 | 7 | lightning__AppPage 8 | lightning__HomePage 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/passwordValidation/passwordValidation.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/passwordValidation/passwordValidation.js: -------------------------------------------------------------------------------- 1 | import { LightningElement } from 'lwc'; 2 | 3 | export default class PasswordValidation extends LightningElement { 4 | 5 | 6 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/passwordValidation/passwordValidation.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | false 5 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/passwordValidator/passwordValidator.css: -------------------------------------------------------------------------------- 1 | .validIndicator { 2 | color:green 3 | } 4 | .invalidIndicator { 5 | color: red; 6 | } 7 | 8 | .mainDiv{ 9 | padding: 10px; 10 | } 11 | 12 | .passwordMessageContainer{ 13 | padding: 10px; 14 | background-color:thistle; 15 | border-radius: 3px; 16 | border: 1px solid; 17 | border-color: black; 18 | margin-top: 10px; 19 | } 20 | /* correcticon */ 21 | /* wrong */ 22 | 23 | .validIndicator:before { 24 | content: "✅"; 25 | position: relative; 26 | 27 | 28 | } 29 | 30 | .invalidIndicator:before { 31 | content: "⛔️"; 32 | position: relative; 33 | } 34 | 35 | .imageTest{ 36 | background-image: url(/resource/validimage) 37 | 38 | } 39 | 40 | h1:before { 41 | content: ""; 42 | display: block; 43 | background: url(/resource/wrong) no-repeat; 44 | width: 20px; 45 | height: 20px; 46 | float: left; 47 | margin: 0 6px 0 0; 48 | } 49 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/passwordValidator/passwordValidator.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/passwordValidator/passwordValidator.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track } from 'lwc'; 2 | 3 | export default class PasswordValidator extends LightningElement { 4 | 5 | @track 6 | valid=true; 7 | 8 | 9 | 10 | handleInputChange(event) { 11 | 12 | var inputString = event.target.value; 13 | 14 | //this.inInputPresent=inputString.length>0; 15 | // this.inInputPresent = this.isStrngContainsCharacter(inputString); 16 | 17 | 18 | var isPasswordLenghthValid = this.isPasswordLenghthValid(inputString); 19 | var isValidSpecialCharacter = this.isPasswordContainSpecialCharacter(inputString); 20 | var isValidNumber = this.isPasswordContainNumber(inputString); 21 | var isuppercaseCharacter = this.hasUpperCase(inputString); 22 | var isLowercaseCharacter = this.hasLowerCase(inputString); 23 | 24 | 25 | 26 | 27 | 28 | var divblockPasswordLength = this.template.querySelector('[data-id="lengthValidator"]'); 29 | var divblockSpecialCharacter = this.template.querySelector('[data-id="specialCharacter"]'); 30 | var divblockNumbers = this.template.querySelector('[data-id="validNumbers"]'); 31 | var divblockValidUppercase = this.template.querySelector('[data-id="validUppercase"]'); 32 | var divblockValidLowerCase= this.template.querySelector('[data-id="validlowercase"]'); 33 | 34 | 35 | // divblockPasswordLength.className = isPasswordLenghthValid ? 'validIndicator' : 'invalidIndicator'; 36 | // divblockSpecialCharacter.className = isValidSpecialCharacter ? 'validIndicator' : 'invalidIndicator'; 37 | // divblockNumbers.className = isValidNumber ? 'validIndicator' : 'invalidIndicator'; 38 | // divblockValidUppercase.className = isuppercaseCharacter ? 'validIndicator' : 'invalidIndicator'; 39 | // divblockValidLowerCase.className = isLowercaseCharacter ? 'validIndicator' : 'invalidIndicator'; 40 | 41 | this.updateDiv(divblockPasswordLength, isPasswordLenghthValid); 42 | this.updateDiv(divblockSpecialCharacter, isValidSpecialCharacter); 43 | this.updateDiv(divblockNumbers, isValidNumber); 44 | this.updateDiv(divblockValidUppercase, isuppercaseCharacter); 45 | this.updateDiv(divblockValidLowerCase, isLowercaseCharacter); 46 | 47 | 48 | 49 | 50 | console.log("divblockValidLowerCase " + divblockValidLowerCase); 51 | 52 | 53 | } 54 | 55 | 56 | updateDiv(div, flag) { 57 | div.className = flag ? 'validIndicator' : 'invalidIndicator'; 58 | } 59 | 60 | isPasswordLenghthValid(inputString) { 61 | 62 | var length = inputString.length; 63 | // this.valid = (length === 0 ? false : true); 64 | 65 | console.log("inInputPresent " + this.valid); 66 | 67 | if (length > 8) { 68 | return true; 69 | } 70 | 71 | return false; 72 | 73 | } 74 | 75 | isStrngContainsCharacter(inputString) { 76 | 77 | if (inputString.length > 0) { 78 | return true; 79 | } 80 | 81 | return false; 82 | 83 | } 84 | 85 | isPasswordContainSpecialCharacter(inputString) { 86 | 87 | if (this.getSpecialCharacterCount(inputString) > 1) { 88 | return true; 89 | } 90 | 91 | return false; 92 | 93 | 94 | 95 | } 96 | 97 | getSpecialCharacterCount(inputString) { 98 | 99 | var outPut = inputString.match(/[@!#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/g); 100 | var count = 0; 101 | 102 | if (outPut != null) { 103 | count=outPut.length; 104 | } 105 | //console.log("Count" + count); 106 | 107 | return count; 108 | 109 | } 110 | 111 | isPasswordContainNumber(inputString) { 112 | 113 | if (this.getNumberCount(inputString) > 1) { 114 | return true; 115 | } 116 | 117 | return false; 118 | 119 | } 120 | 121 | getNumberCount(inputString) { 122 | 123 | var outPut = inputString.match(/[1234567890]/g); 124 | var count = 0; 125 | 126 | if (outPut != null) { 127 | count=outPut.length; 128 | } 129 | console.log("Number Count" + count); 130 | 131 | return count; 132 | 133 | } 134 | 135 | hasLowerCase(str) { 136 | console.log("hasLowerCase " + str); 137 | return str.toUpperCase() != str; 138 | } 139 | 140 | hasUpperCase(str) { 141 | console.log("hasUpperCase " + str); 142 | return str.toLowerCase() != str; 143 | } 144 | 145 | 146 | 147 | 148 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/passwordValidator/passwordValidator.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | 7 | lightning__HomePage 8 | lightning__AppPage 9 | 10 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/propertyExample/propertyExample.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/propertyExample/propertyExample.js: -------------------------------------------------------------------------------- 1 | import { api, LightningElement, track } from 'lwc'; 2 | import listAllFields2 from '@salesforce/apex/FlexiLightningTableController.listAllFields2' 3 | import getData from '@salesforce/apex/FlexiLightningTableController.getData' 4 | 5 | export default class PropertyExample extends LightningElement { 6 | 7 | @api 8 | objectFields; 9 | 10 | 11 | 12 | @api 13 | objectName; 14 | 15 | @api 16 | viewMore=false; 17 | 18 | @track 19 | fieldResponse; 20 | 21 | @track 22 | datalist 23 | 24 | @track 25 | columnList; 26 | 27 | @api 28 | rowCount; 29 | 30 | @api 31 | incrementCount; 32 | 33 | @track 34 | apexResponse=[]; 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | connectedCallback(){ 43 | listAllFields2({objName:this.objectName,columnsName:this.objectFields,rowCount:this.rowCount,incrementCount:this.incrementCount,viewMore:this.viewMore}).then((response)=>{ 44 | console.log("** ** ", JSON.stringify(response)) 45 | this.fieldResponse = response; 46 | this.columnList=this.fieldResponse.fieldDetails; 47 | this.getDataFromApex(); 48 | }).catch(()=>{ 49 | alert('Err'); 50 | }) 51 | } 52 | 53 | getDataFromApex(){ 54 | 55 | getData({ObjectName:this.objectName,ColumnNames:this.objectFields}).then((response)=>{ 56 | 57 | var counter=1; 58 | 59 | response= response.map((resultss,index) =>{ 60 | resultss.RowNumber=index+1; 61 | return resultss; 62 | }); 63 | 64 | if(this.viewMore){ 65 | this.datalist=response.slice(0,this.rowCount); 66 | }else{ 67 | this.datalist=response.slice(0,response.length-1); 68 | } 69 | 70 | this.apexResponse=response; 71 | console.log(" ** apexResponse **", JSON.stringify(this.apexResponse)); 72 | //alert('response'+ this.apexResponse.length()); 73 | 74 | 75 | }).catch((err)=>{ 76 | alert('response getDataFromApex'+err); 77 | }) 78 | 79 | 80 | 81 | } 82 | 83 | handleClick(){ 84 | this.rowCount=this.rowCount+this.incrementCount; 85 | this.datalist=this.apexResponse.slice(0,this.rowCount); 86 | 87 | if(this.rowCount>=this.apexResponse.length){ 88 | this.viewMore=false; 89 | } 90 | 91 | 92 | 93 | } 94 | 95 | 96 | 97 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/propertyExample/propertyExample.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | 7 | lightning__AppPage 8 | lightning__HomePage 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/qrCodeGenarator/__tests__/qrCodeGenarator.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import QrCodeGenarator from 'c/qrCodeGenarator'; 3 | 4 | describe('c-qr-code-genarator', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-qr-code-genarator', { 15 | is: QrCodeGenarator 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/qrCodeGenarator/qrCodeGenarator.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/qrCodeGenarator/qrCodeGenarator.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track } from 'lwc'; 2 | import convertToBASE64 from '@salesforce/apex/ExchangeController.convertToBASE64'; 3 | 4 | export default class QrCodeGenarator extends LightningElement { 5 | 6 | @track 7 | srcData=""; 8 | 9 | @track 10 | amount="" 11 | 12 | @track 13 | upiId="" 14 | 15 | @track 16 | validateBtnState=true; 17 | 18 | 19 | connectedCallback(){ 20 | //this.handleCLick(); 21 | // this.convert(); 22 | } 23 | 24 | handleAmountChange(event){ 25 | 26 | this.amount=event.target.value; 27 | this.updateButtonState(); 28 | 29 | } 30 | 31 | handleUPIIDChange(event){ 32 | this.upiId=event.target.value; 33 | this.updateButtonState(); 34 | } 35 | 36 | updateButtonState(){ 37 | 38 | // alert(this.upiId); 39 | 40 | this.validateBtnState=! ( (this.amount.length>0) && (this.upiId.length>0) ) ; 41 | 42 | } 43 | 44 | convert(myData){ 45 | 46 | convertToBASE64({ss: myData}).then((data) => { 47 | 48 | //alert('BASE64: ' + data); 49 | console.log(JSON.stringify(data)); 50 | this.srcData="data:image/svg+xml;base64,"+data; 51 | // base64Data=JSON.stringify(data); 52 | 53 | }).catch((error) => { 54 | alert('BASE64: errrr' + error.message); 55 | 56 | }); 57 | 58 | 59 | } 60 | 61 | handleCLick(){ 62 | 63 | fetch("https://upiqr.in/api/qr?name=SantanuSinha&vpa="+this.upiId+ "&amount="+this.amount) 64 | .then(response => { 65 | // alert(response); 66 | return response.text(); 67 | }) 68 | .then(svg => { 69 | // alert(svg); 70 | this.convert(svg); 71 | }).catch((errr)=>{ 72 | alert(errr); 73 | }) 74 | 75 | 76 | } 77 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/qrCodeGenarator/qrCodeGenarator.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | 7 | lightning__HomePage 8 | lightning__AppPage 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/relatedContact/__tests__/relatedContact.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import RelatedContact from 'c/relatedContact'; 3 | 4 | describe('c-related-contact', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-related-contact', { 15 | is: RelatedContact 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/relatedContact/relatedContact.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/relatedContact/relatedContact.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | lightning__RecordPage 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/selectYearComponent/selectYearComponent.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/selectYearComponent/selectYearComponent.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track,wire } from 'lwc'; 2 | import getUniqueYears from '@salesforce/apex/StudentController.getUniqueYears'; 3 | import getStudentInfo from '@salesforce/apex/StudentController.getStudentInfo'; 4 | 5 | 6 | 7 | 8 | 9 | export default class SelectYearComponent extends LightningElement { 10 | 11 | picklistOptions = []; 12 | selectedYear = ''; 13 | studentData; 14 | 15 | cardTitle = ''; 16 | 17 | 18 | studentColums = [ 19 | 20 | { label: 'Student Id ', fieldName: 'Id' }, 21 | { label: 'Student Name', fieldName: 'Name' } 22 | 23 | ]; 24 | 25 | 26 | 27 | 28 | @wire(getUniqueYears, {test:'jj'}) 29 | getPicklistValues({ error, data }) { 30 | if (data) { 31 | this.picklistOptions = data.map( objPL => { 32 | return { 33 | label: `${objPL}`, 34 | value: `${objPL}` 35 | }; 36 | }); 37 | 38 | } else if (error) { 39 | alert('error wire '+JSON.stringify(error)); 40 | // Handle error 41 | console.log('==============Error ' + error); 42 | console.log(error); 43 | } 44 | } 45 | 46 | handleYearSelected(event) { 47 | this.selectedYear = event.target.value; 48 | this.studentData = null; 49 | } 50 | 51 | handleDepartmentClicked(event) { 52 | 53 | // alert('handleDepartmentClicked' + event.detail.id); 54 | // alert('handleDepartmentClicked' + event.detail.selectedyear); 55 | 56 | this.cardTitle = 'Student who passed in ' + event.detail.selectedyear + ' in ' + event.detail.departmentName + ' Department' ; 57 | 58 | getStudentInfo({ passingYear: this.selectedYear, depsrtmentId: event.detail.id }).then(result => { 59 | alert('result ' + JSON.stringify(result)); 60 | this.studentData = result; 61 | 62 | 63 | }).catch(error => { 64 | alert('error ' + JSON.stringify(error)); 65 | }) 66 | 67 | 68 | } 69 | 70 | 71 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/selectYearComponent/selectYearComponent.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | 7 | lightning__HomePage 8 | lightning__AppPage 9 | 10 | 11 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/sendOtpComponant/sendOtpComponant.css: -------------------------------------------------------------------------------- 1 | .timer { 2 | color: red; 3 | font-weight: bold; 4 | margin-left: 10px; 5 | margin-top: 10px; 6 | } 7 | 8 | .resendotp{ 9 | margin-left: 20px; 10 | margin-bottom: 20px; 11 | 12 | } 13 | 14 | .resendbtncontainer{ 15 | margin-top:5px; 16 | margin-left: 10px; 17 | 18 | } 19 | 20 | .congratsmessage{ 21 | margin-top:15px; 22 | margin-left: 15px; 23 | 24 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/sendOtpComponant/sendOtpComponant.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/sendOtpComponant/sendOtpComponant.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track, api } from 'lwc'; 2 | import sendOtp from '@salesforce/apex/OTPUtility.sendOtp' 3 | import validateOTP from '@salesforce/apex/OTPUtility.validateOTP' 4 | 5 | 6 | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; 7 | 8 | export default class SendOtpComponant extends LightningElement { 9 | 10 | 11 | 12 | @api 13 | recordId; 14 | message; 15 | error; 16 | 17 | @track 18 | timer = 10; 19 | 20 | @track 21 | otpInput='' 22 | 23 | @track 24 | resnedButtonstate = true; 25 | 26 | showSendRsendButton = false; 27 | 28 | @track 29 | isOtpValidate = false; 30 | 31 | 32 | handleSendOtp() { 33 | 34 | sendOtp({ contactId: this.recordId }).then((response) => { 35 | console.log("response" + response); 36 | this.message = response; 37 | this.showToast('Sucess', this.message+'OTP sent to email', 'success'); 38 | this.startTimer(); 39 | }).catch((err) => { 40 | console.log("err" + err); 41 | this.error = 'Error'; 42 | }) 43 | 44 | 45 | } 46 | 47 | 48 | handleResend() { 49 | 50 | this.otpInput = " "; 51 | this.handleSendOtp(); 52 | } 53 | 54 | handleSubmitOtp() { 55 | 56 | const element = this.template.querySelector('[data-id="OTP"]'); 57 | 58 | validateOTP({ contactId: this.recordId , otp:element.value}).then((response) => { 59 | console.log("response" + response); 60 | this.isOtpValidate = true; 61 | this.showToast('Sucess','Hi '+response,'success'); 62 | 63 | }).catch((error) => { 64 | 65 | console.log("err" + error); 66 | let errorMessage = ''; 67 | 68 | 69 | if (error.body.message) { 70 | errorMessage = error.body.message; 71 | } 72 | 73 | this.showToast('FAIL', "Error "+errorMessage,'error'); 74 | 75 | 76 | }) 77 | 78 | 79 | } 80 | 81 | handleOtpInput(event) { 82 | 83 | 84 | let response = event.target.value; 85 | 86 | if (response.length == 5) { 87 | this.resnedButtonstate = false; 88 | } else { 89 | this.resnedButtonstate = true; 90 | } 91 | 92 | } 93 | 94 | showToast(title,message,variant) { 95 | const event = new ShowToastEvent({ 96 | title: title, 97 | message: message, 98 | variant: variant, 99 | mode: 'dismissable' 100 | }); 101 | this.dispatchEvent(event); 102 | } 103 | 104 | 105 | startTimer() { 106 | 107 | const element = this.template.querySelector('[data-id="RESEND-OTP"]'); 108 | 109 | this.timer = 10; 110 | this.showSendRsendButton = false; 111 | var intervalID=setInterval(() => { 112 | this.timer = this.timer - 1; 113 | if (this.timer == 0) { 114 | this.showSendRsendButton = true; 115 | clearInterval(intervalID); 116 | } 117 | 118 | }, 1000); 119 | } 120 | 121 | 122 | 123 | 124 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/sendOtpComponant/sendOtpComponant.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | 7 | 8 | lightning__RecordPage 9 | lightning__HomePage 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/showPaymentPopup/__tests__/showPaymentPopup.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import ShowPaymentPopup from 'c/showPaymentPopup'; 3 | 4 | describe('c-show-payment-popup', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-show-payment-popup', { 15 | is: ShowPaymentPopup 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/showPaymentPopup/showPaymentPopup.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/showPaymentPopup/showPaymentPopup.js: -------------------------------------------------------------------------------- 1 | import { LightningElement ,track,api,wire} from 'lwc'; 2 | import { getRecord } from 'lightning/uiRecordApi'; 3 | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; 4 | 5 | const FIELDS = [ 6 | 'Contact.Name', 7 | 'Contact.Title', 8 | 'Contact.Phone', 9 | 'Contact.Email', 10 | 11 | ]; 12 | import senPaymentLink from '@salesforce/apex/PaymentUtility.senPaymentLink'; 13 | import createPaymentRequest from '@salesforce/apex/PaymentUtility.createPaymentRequest'; 14 | import getStringBody from '@salesforce/apex/PaymentUtility.getStringBody'; 15 | import getPaymentDetsils from '@salesforce/apex/PaymentUtility.getPaymentDetsils'; 16 | import { getRecordNotifyChange } from "lightning/uiRecordApi"; 17 | 18 | 19 | 20 | 21 | 22 | 23 | export default class ShowPaymentPopup extends LightningElement { 24 | 25 | @api recordId; 26 | 27 | @wire(getRecord, { recordId: '$recordId', fields: FIELDS }) 28 | contact; 29 | 30 | @track isModalOpen = false; 31 | 32 | @track 33 | amount 34 | 35 | handleChange(event){ 36 | 37 | this.amount=event.target.value; 38 | } 39 | 40 | get name() { 41 | return this.contact.data.fields.Name.value; 42 | } 43 | 44 | get title() { 45 | return this.contact.data.fields.Title.value; 46 | } 47 | 48 | get phone() { 49 | return this.contact.data.fields.Phone.value; 50 | } 51 | 52 | get email() { 53 | return this.contact.data.fields.Email.value; 54 | } 55 | 56 | 57 | openModal() { 58 | // to open modal set isModalOpen tarck value as true 59 | this.isModalOpen = true; 60 | } 61 | closeModal() { 62 | // to close modal set isModalOpen tarck value as false 63 | this.isModalOpen = false; 64 | } 65 | submitDetails() { 66 | // to close modal set isModalOpen tarck value as false 67 | //Add your code to call apex method or do some processing 68 | this.isModalOpen = false; 69 | this.handleSubmit(); 70 | } 71 | 72 | handleSubmit(){ 73 | //alert(this.panNumber) 74 | 75 | createPaymentRequest({amount:this.amount,contactId:this.recordId}).then((response) =>{ 76 | 77 | // alert('record created successfully'+JSON.stringify(response)); 78 | this.sendPaymentLink(response.Id); 79 | 80 | }).catch((error)=>{ 81 | alert('record created error'+error); 82 | }) 83 | } 84 | 85 | 86 | sendPaymentLink(referenceId){ 87 | getRecordNotifyChange([{ recordId: referenceId }]); 88 | this.getPaymentDetails(referenceId); 89 | 90 | } 91 | 92 | getPaymentDetails(referenceId){ 93 | 94 | getPaymentDetsils({referenceId:referenceId}).then((paymentDetails) =>{ 95 | console.log("paymentDetails "+JSON.stringify(paymentDetails)); 96 | //alert(JSON.stringify(paymentDetails)); 97 | this.genarateRequestBody(paymentDetails); 98 | 99 | }).catch((error)=>{ 100 | alert('Error in getting the payment detsils'+error); 101 | }) 102 | 103 | } 104 | 105 | genarateRequestBody(paymentDetails){ 106 | 107 | 108 | getStringBody({}).then((response) =>{ 109 | console.log("Request string "+JSON.stringify(response)); 110 | let requestObject=JSON.parse(response); 111 | 112 | requestObject.amount=paymentDetails.Amount__c*100; 113 | requestObject.reference_id=paymentDetails.Id; 114 | requestObject.customer.Name=paymentDetails.Customer__r.Name; 115 | requestObject.customer.email=paymentDetails.Customer__r.Email; 116 | requestObject.customer.contact=paymentDetails.Customer__r.Phone; 117 | 118 | // alert(JSON.stringify(requestObject)); 119 | 120 | 121 | senPaymentLink({requestString:JSON.stringify(requestObject)}).then((response) =>{ 122 | console.log('link sent successfully '+JSON.stringify(response)); 123 | //alert('link sent successfully'+JSON.stringify(response)); 124 | this.showToast('Sucess','Link sent successfully on the contact email and phone','success'); 125 | 126 | 127 | }).catch((error) =>{ 128 | alert('error'); 129 | }) 130 | 131 | 132 | 133 | 134 | 135 | 136 | }).catch((error) =>{ 137 | alert('error'+error); 138 | }) 139 | } 140 | 141 | showToast(title,message,variant) { 142 | const event = new ShowToastEvent({ 143 | title: title, 144 | message: message, 145 | variant: variant, 146 | mode: 'dismissable' 147 | }); 148 | this.dispatchEvent(event); 149 | } 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/showPaymentPopup/showPaymentPopup.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | lightning__AppPage 7 | lightning__RecordPage 8 | lightning__HomePage 9 | 10 | 11 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/testDatatableExample/__tests__/testDatatableExample.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import TestDatatableExample from 'c/testDatatableExample'; 3 | 4 | describe('c-test-datatable-example', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-test-datatable-example', { 15 | is: TestDatatableExample 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/testDatatableExample/testDatatableExample.css: -------------------------------------------------------------------------------- 1 | 2 | .redColor{ 3 | fill : green; 4 | color: blueviolet; 5 | background-color: brown; 6 | } 7 | 8 | .slds-text-color_destructive{ 9 | color: blueviolet; 10 | } 11 | 12 | .datatable-full-size { 13 | width: 100% !important; 14 | } 15 | 16 | .ddd { 17 | 18 | overflow: hidden; 19 | -ms-overflow-style: none; /* IE and Edge */ 20 | scrollbar-width: none; /* Firefox */ 21 | 22 | 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/testDatatableExample/testDatatableExample.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/testDatatableExample/testDatatableExample.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track } from "lwc"; 2 | import { loadStyle } from "lightning/platformResourceLoader"; 3 | import lwcDatatableStyle from "@salesforce/resourceUrl/lwcDatatableStyle"; 4 | 5 | export default class TestDatatableExample extends LightningElement { 6 | 7 | 8 | @track 9 | isAllDataLoaded=false; 10 | 11 | actions = [ 12 | { label: "View", name: "view" }, 13 | { label: "Edit", name: "edit" }, 14 | { label: "Delete", name: "delete" }, 15 | ]; 16 | 17 | @track 18 | columns = [ 19 | { label: "Date", fieldName: "leadDate" }, 20 | 21 | { 22 | fieldName: "", 23 | label: "Channel", 24 | hideDefaultActions: true, 25 | cellAttributes: { 26 | iconName: { fieldName: "selectedIcon" }, 27 | }, 28 | }, 29 | 30 | { 31 | fieldName: "", 32 | label: "Cart", 33 | wrapText: false, 34 | hideDefaultActions: true, 35 | cellAttributes: { 36 | iconName: { fieldName: "cartIcon" }, 37 | }, 38 | }, 39 | 40 | { label: "Product", fieldName: "productType", hideDefaultActions: true }, 41 | 42 | { 43 | fieldName: "", 44 | label: "Follo Up", 45 | wrapText: false, 46 | hideDefaultActions: true, 47 | cellAttributes: { 48 | class: { fieldName: "amountColor" }, 49 | iconName: { fieldName: "followUpIcon" }, 50 | }, 51 | }, 52 | 53 | { 54 | type: "action", 55 | typeAttributes: { 56 | rowActions: [ 57 | { label: "View", name: "view" }, 58 | { label: "Edit", name: "edit" }, 59 | { label: "Delete", name: "delete" }, 60 | ], 61 | menuAlignment: "right", 62 | }, 63 | }, 64 | ]; 65 | 66 | @track 67 | datatableData = [ 68 | { 69 | id: 1, 70 | leadDate: "15/02/1990", 71 | leadChannel: "Phone", 72 | productType: "Wireless", 73 | folloUpStatus: true, 74 | selectedIcon: "utility:call", 75 | cartIcon: "utility:cart", 76 | followUpIcon: "utility:error", 77 | }, 78 | { 79 | id: 2, 80 | leadDate: "1/04/1990", 81 | leadChannel: "Web", 82 | productType: "Internet", 83 | folloUpStatus: true, 84 | selectedIcon: "utility:world", 85 | followUpIcon: "utility:error", 86 | }, 87 | { 88 | id: 3, 89 | leadDate: "5/02/2020", 90 | leadChannel: "Home", 91 | productType: "Video", 92 | folloUpStatus: true, 93 | selectedIcon: "utility:home", 94 | amountColor: "slds-text-color_success", 95 | }, 96 | { 97 | id: 4, 98 | leadDate: "15/02/2022", 99 | leadChannel: "Phone", 100 | productType: "Wireless", 101 | folloUpStatus: true, 102 | selectedIcon: "utility:call", 103 | cartIcon: "utility:cart", 104 | }, 105 | { 106 | id: 5, 107 | leadDate: "25/01/2006", 108 | leadChannel: "Web", 109 | productType: "", 110 | folloUpStatus: true, 111 | selectedIcon: "utility:world", 112 | cartIcon: "utility:cart", 113 | followUpIcon: "utility:error", 114 | }, 115 | { 116 | id: 6, 117 | leadDate: "15/02/1999", 118 | leadChannel: "Home", 119 | productType: "Video", 120 | folloUpStatus: true, 121 | selectedIcon: "utility:home", 122 | }, 123 | , 124 | { 125 | id: 7, 126 | leadDate: "9/08/1995", 127 | leadChannel: "Phone", 128 | productType: "Internet", 129 | folloUpStatus: true, 130 | selectedIcon: "utility:call", 131 | }, 132 | , 133 | { 134 | id: 8, 135 | leadDate: "6/02/1996", 136 | leadChannel: "Web", 137 | productType: "Video", 138 | folloUpStatus: true, 139 | selectedIcon: "utility:world", 140 | }, 141 | { 142 | id: 9, 143 | leadDate: "15/02/207", 144 | leadChannel: "Home", 145 | productType: "Wireless", 146 | folloUpStatus: true, 147 | selectedIcon: "utility:home", 148 | followUpIcon: "utility:error", 149 | }, 150 | { 151 | id: 9, 152 | leadDate: "15/02/207", 153 | leadChannel: "Home", 154 | productType: "Wireless", 155 | folloUpStatus: true, 156 | selectedIcon: "utility:home", 157 | followUpIcon: "utility:error", 158 | }, 159 | { 160 | id: 9, 161 | leadDate: "15/02/207", 162 | leadChannel: "Home", 163 | productType: "Wireless", 164 | folloUpStatus: true, 165 | selectedIcon: "utility:home", 166 | followUpIcon: "utility:error", 167 | }, 168 | 169 | { 170 | id: 9, 171 | leadDate: "15/02/207", 172 | leadChannel: "Home", 173 | productType: "Wireless", 174 | folloUpStatus: true, 175 | selectedIcon: "utility:home", 176 | followUpIcon: "utility:error", 177 | }, 178 | 179 | { 180 | id: 9, 181 | leadDate: "15/02/207", 182 | leadChannel: "Home", 183 | productType: "Wireless", 184 | folloUpStatus: true, 185 | selectedIcon: "utility:home", 186 | followUpIcon: "utility:error", 187 | }, 188 | ]; 189 | 190 | @track 191 | displayData=[]; 192 | 193 | connectedCallback(){ 194 | 195 | this.displayData=this.datatableData.slice(0,5); 196 | } 197 | 198 | renderedCallback() { 199 | loadStyle(this, lwcDatatableStyle) 200 | .then(() => { 201 | console.log("Loaded Successfully"); 202 | // alert("Loaded Successfully"); 203 | }) 204 | .catch((error) => { 205 | console.log(error); 206 | alert("err" + error); 207 | }); 208 | } 209 | 210 | handleLoadMoreCLick(){ 211 | 212 | //this.displayData.concat(); 213 | 214 | this.displayData= [].concat(this.displayData,this.datatableData.slice(5,this.datatableData.length-1)); 215 | this.isAllDataLoaded=true; 216 | } 217 | 218 | 219 | } 220 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/testDatatableExample/testDatatableExample.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | 7 | lightning__AppPage 8 | lightning__HomePage 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/translator/__tests__/translator.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import Translator from 'c/translator'; 3 | 4 | describe('c-translator', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-translator', { 15 | is: Translator 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/translator/translator.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/translator/translator.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track } from 'lwc'; 2 | 3 | export default class Translator extends LightningElement { 4 | 5 | @track 6 | languageOptions=[] 7 | 8 | fromLanugage; 9 | tolanguage 10 | languageInputed; 11 | 12 | convertedText 13 | 14 | @track 15 | convertButtnstateDisabled=true; 16 | 17 | connectedCallback(){ 18 | 19 | this.getAllLanguages(); 20 | } 21 | 22 | 23 | getAllLanguages() { 24 | 25 | const options = { 26 | method: 'GET', 27 | headers: { 28 | 'Accept-Encoding': 'application/gzip', 29 | 'X-RapidAPI-Key': 'YOUR_API_KEY', 30 | 'X-RapidAPI-Host': 'google-translate1.p.rapidapi.com' 31 | } 32 | }; 33 | 34 | fetch('https://google-translate1.p.rapidapi.com/language/translate/v2/languages', options) 35 | .then(response => { 36 | 37 | 38 | console.log('***'+response.ok); 39 | //console.log('***'+ response.json()); 40 | 41 | return response.json() 42 | }) 43 | .then(response => { 44 | // alert(JSON.stringify(response)); 45 | //console.log(response) 46 | this.updateDataWithLanguageName(response); 47 | }) 48 | .catch(err => { 49 | console.error(err) 50 | alert('Err'+err); 51 | }); 52 | 53 | } 54 | 55 | 56 | handleSelection(event){ 57 | 58 | if(event.target.dataset.id==='from'){ 59 | this.fromLanugage = event.target.value; 60 | }else{ 61 | this.tolanguage = event.target.value; 62 | } 63 | 64 | // console.log("** this.fromLanugage", this.fromLanugage) 65 | 66 | this.validateButtonState(); 67 | 68 | 69 | } 70 | 71 | 72 | updateDataWithLanguageName(apiData){ 73 | 74 | 75 | 76 | apiData=apiData.data.languages.map(data =>{ 77 | 78 | const option = { 79 | label : ''+this.getLanguage(data.language), 80 | name: ''+this.getLanguage(data.language), 81 | value : data.language 82 | }; 83 | this.languageOptions = [...this.languageOptions, option]; 84 | 85 | 86 | }) 87 | 88 | this.languageOptions= this.languageOptions.sort((a, b) => a.label.toLowerCase() > b.label.toLowerCase() ? 1 : -1); 89 | console.log('** updateDataWithLanguageName **'+JSON.stringify(this.languageOptions)); 90 | 91 | 92 | 93 | } 94 | 95 | 96 | handleTextChange(event){ 97 | // alert('handleTextChange'); 98 | this.languageInputed= event.target.value 99 | this.validateButtonState(); 100 | 101 | } 102 | 103 | validateButtonState(){ 104 | 105 | if(( this.languageInputed!=null && this.languageInputed.length>0) && (this.fromLanugage!=null) && (this.tolanguage!=null)){ 106 | this.convertButtnstateDisabled=false; 107 | } 108 | 109 | console.log(" ** this.languageInputed", this.languageInputed) 110 | console.log("** this.fromLanugage", this.fromLanugage) 111 | 112 | console.log("** this.tolanguage", this.tolanguage) 113 | } 114 | 115 | 116 | getLanguage = (code) => { 117 | const lang = new Intl.DisplayNames(['en'], {type: 'language'}); 118 | return lang.of(code); 119 | } 120 | 121 | convertText(){ 122 | 123 | const encodedParams = new URLSearchParams(); 124 | encodedParams.append("q", this.languageInputed); 125 | encodedParams.append("target", this.tolanguage); 126 | encodedParams.append("source", this.fromLanugage); 127 | 128 | const options = { 129 | method: 'POST', 130 | headers: { 131 | 'content-type': 'application/x-www-form-urlencoded', 132 | 'Accept-Encoding': 'application/gzip', 133 | 'X-RapidAPI-Key': 'YOUR_API_KEY', 134 | 'X-RapidAPI-Host': 'google-translate1.p.rapidapi.com' 135 | }, 136 | body: encodedParams 137 | }; 138 | 139 | fetch('https://google-translate1.p.rapidapi.com/language/translate/v2', options) 140 | .then(response => { 141 | return response.json() 142 | }) 143 | .then(response => { 144 | // alert(JSON.stringify(response)); 145 | console.log(response) 146 | this.convertedText=response.data.translations[0].translatedText 147 | alert(this.convertedText); 148 | }) 149 | .catch(err => { 150 | alert(JSON.stringify(err)); 151 | console.error(err) 152 | }); 153 | 154 | } 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/translator/translator.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | 7 | lightning__AppPage 8 | lightning__HomePage 9 | 10 | 11 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/validateMobileNumber/validateMobileNumber.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/validateMobileNumber/validateMobileNumber.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, api } from 'lwc'; 2 | import APIKEY from '@salesforce/label/c.APIKEY'; 3 | import getContactInfo from '@salesforce/apex/ContactController.getContactInfo' 4 | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; 5 | 6 | 7 | 8 | export default class ValidateMobileNumber extends LightningElement { 9 | 10 | @api 11 | recordId; 12 | 13 | @api 14 | invoke() { 15 | 16 | this.getContactNumber(this.recordId); 17 | } 18 | 19 | getContactNumber(mRecordId) { 20 | 21 | 22 | getContactInfo({contactId: mRecordId}).then(response => { 23 | // alert('contactId' + response.Id); 24 | // alert('Name' + response.Name); 25 | // alert('MobilePhone' + response.MobilePhone); 26 | 27 | if (response != null && response.MobilePhone != null) { 28 | this.callNumberValidAPI("+91"+response.MobilePhone); 29 | 30 | } 31 | 32 | 33 | 34 | }).catch(err => { 35 | alert('catch'); 36 | }) 37 | } 38 | 39 | 40 | callNumberValidAPI(number) { 41 | 42 | fetch('https://api.apilayer.com/number_verification/validate?number='+number, { 43 | method: 'GET', 44 | headers: { 45 | apikey:APIKEY 46 | }, 47 | redirect: 'follow' 48 | }).then(response => { 49 | return response.json(); 50 | } 51 | ).then(json => { 52 | if (json.valid) { 53 | this.showToast('Sucess','Valid Indian Number','success'); 54 | } else { 55 | this.showToast('FAIL','InValid Indian Number','error'); 56 | } 57 | 58 | 59 | }).catch(error => { 60 | alert('error message ' + error.message); 61 | console.log(error); 62 | 63 | }) 64 | 65 | 66 | } 67 | 68 | showToast(title,message,variant) { 69 | const event = new ShowToastEvent({ 70 | title: title, 71 | message: message, 72 | variant: variant, 73 | mode: 'dismissable' 74 | }); 75 | this.dispatchEvent(event); 76 | } 77 | 78 | 79 | 80 | 81 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/validateMobileNumber/validateMobileNumber.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | true 5 | 6 | 7 | lightning__RecordAction 8 | 9 | 10 | 11 | 12 | Action 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/validatePPAN/__tests__/validatePPAN.test.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'lwc'; 2 | import ValidatePPAN from 'c/validatePPAN'; 3 | 4 | describe('c-validate-ppan', () => { 5 | afterEach(() => { 6 | // The jsdom instance is shared across test cases in a single file so reset the DOM 7 | while (document.body.firstChild) { 8 | document.body.removeChild(document.body.firstChild); 9 | } 10 | }); 11 | 12 | it('TODO: test case generated by CLI command, please fill in test logic', () => { 13 | // Arrange 14 | const element = createElement('c-validate-ppan', { 15 | is: ValidatePPAN 16 | }); 17 | 18 | // Act 19 | document.body.appendChild(element); 20 | 21 | // Assert 22 | // const div = element.shadowRoot.querySelector('div'); 23 | expect(1).toBe(1); 24 | }); 25 | }); -------------------------------------------------------------------------------- /force-app/main/default/lwc/validatePPAN/validatePPAN.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/validatePPAN/validatePPAN.js: -------------------------------------------------------------------------------- 1 | import { LightningElement, track } from 'lwc'; 2 | import checkPANStatus from '@salesforce/apex/ExchangeController.checkPANStatus'; 3 | 4 | 5 | export default class ValidatePPAN extends LightningElement { 6 | 7 | @track 8 | panNumber 9 | 10 | @track 11 | validateBtnState=true; 12 | 13 | @track 14 | finalOutPUT 15 | 16 | @track 17 | source 18 | 19 | @track 20 | error 21 | 22 | handleChange(event){ 23 | 24 | this.panNumber = event.target.value.toUpperCase(); 25 | this.updateButtonState(); 26 | this.error=null; 27 | this.finalOutPUT=null; 28 | 29 | } 30 | 31 | handleCheckStatusClick(){ 32 | //alert(this.panNumber) 33 | 34 | checkPANStatus({panNumber:this.panNumber}).then((response) =>{ 35 | //alert('Something'); 36 | //alert(JSON.stringify(JSON.parse(response.replace(/\r?\n|\r/g, '')))); 37 | 38 | if(response!= null) { 39 | const dataResponse=JSON.parse(response.replace(/\r?\n|\r/g, '')) 40 | this.checkData(dataResponse); 41 | } 42 | 43 | }).catch((error) =>{ 44 | alert('error'); 45 | }) 46 | 47 | } 48 | 49 | updateButtonState(){ 50 | 51 | this.validateBtnState=!(this.panNumber.length==10); 52 | 53 | } 54 | 55 | checkData(panResponses){ 56 | 57 | if(panResponses.status=='completed' && panResponses.result.source_output.status=='id_found'){ 58 | // alert(panResponses.result); 59 | this.finalOutPUT= panResponses.result.source_output.name_on_card 60 | this.source= panResponses.result.source_output.source; 61 | }else if(panResponses.status=='completed' && panResponses.result.source_output.status=='id_not_found'){ 62 | //alert('Detatils not found'); 63 | this.error='Detatils not found'; 64 | }else{ 65 | this.error=panResponses.message; 66 | //alert(panResponses.message); 67 | } 68 | 69 | } 70 | 71 | } -------------------------------------------------------------------------------- /force-app/main/default/lwc/validatePPAN/validatePPAN.js-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55.0 4 | true 5 | 6 | 7 | lightning__HomePage 8 | lightning__AppPage 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /force-app/main/default/messageChannels/Animal_Detail.messageChannel-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CountUpdated 4 | true 5 | Message Channel to pass Count updates 6 | 7 | 8 | operator 9 | This is the operator type of the manipulation 10 | 11 | 12 | 13 | constant 14 | This is the number for the manipulation 15 | 16 | 17 | 18 | bidrdata 19 | This main 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /force-app/main/default/messageChannels/Filter_Detail.messageChannel-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CountUpdated 4 | true 5 | Message Channel to pass Count updates 6 | 7 | 8 | operator 9 | This is the operator type of the manipulation 10 | 11 | 12 | 13 | constant 14 | This is the number for the manipulation 15 | 16 | 17 | 18 | filterdata 19 | This main 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /force-app/main/default/messageChannels/Selected_Filter_Detail.messageChannel-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CountUpdated 4 | true 5 | Message Channel to pass Count updates 6 | 7 | 8 | operator 9 | This is the operator type of the manipulation 10 | 11 | 12 | 13 | constant 14 | This is the number for the manipulation 15 | 16 | 17 | 18 | filterdata 19 | This main 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /force-app/main/default/pages/datadisp.page: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /force-app/main/default/pages/datadisp.page-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | 5 | -------------------------------------------------------------------------------- /force-app/main/default/triggers/AccountTriggerClass.trigger: -------------------------------------------------------------------------------- 1 | trigger AccountTriggerClass on Account (before insert,after insert) { 2 | 3 | if(Trigger.isBefore && Trigger.isInsert ){ 4 | ApexTriggerHandler.handleBeforeInsert(Trigger.new); 5 | } 6 | 7 | if(Trigger.isafter && Trigger.isInsert){ 8 | // ApexTriggerHandler.handleAfterInsert(Trigger.new); 9 | ApexTriggerHandler.sendEmailAfterAccountInsert(Trigger.new); 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /force-app/main/default/triggers/AccountTriggerClass.trigger-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | -------------------------------------------------------------------------------- /force-app/main/default/triggers/ContactTrigger.trigger: -------------------------------------------------------------------------------- 1 | trigger ContactTrigger on Contact (after insert) { 2 | 3 | List contactIds = new List(); 4 | 5 | if(Trigger.isAfter && Trigger.isInsert) 6 | { 7 | 8 | Contact[] cons = [SELECT Id,Name FROM Contact WHERE Id IN :Trigger.new]; 9 | 10 | for(Contact contact : cons){ 11 | contactIds.add(contact.ID); 12 | } 13 | 14 | WhatsAppApiController.sendMessageWAFuture(contactIds); 15 | 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /force-app/main/default/triggers/OppourtunityTrigger.trigger: -------------------------------------------------------------------------------- 1 | trigger OppourtunityTrigger on Opportunity (after insert) { 2 | 3 | } -------------------------------------------------------------------------------- /force-app/main/default/triggers/OppourtunityTrigger.trigger-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54.0 4 | Active 5 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | const { jestConfig } = require('@salesforce/sfdx-lwc-jest/config'); 2 | 3 | module.exports = { 4 | ...jestConfig, 5 | modulePathIgnorePatterns: ['/.localdevserver'] 6 | }; 7 | -------------------------------------------------------------------------------- /manifest/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | * 5 | ApexClass 6 | 7 | 8 | * 9 | ApexComponent 10 | 11 | 12 | * 13 | ApexPage 14 | 15 | 16 | * 17 | ApexTestSuite 18 | 19 | 20 | * 21 | ApexTrigger 22 | 23 | 24 | * 25 | AuraDefinitionBundle 26 | 27 | 28 | * 29 | LightningComponentBundle 30 | 31 | 32 | * 33 | StaticResource 34 | 35 | 52.0 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "salesforce-app", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "Salesforce App", 6 | "scripts": { 7 | "lint": "eslint **/{aura,lwc}/**", 8 | "test": "npm run test:unit", 9 | "test:unit": "sfdx-lwc-jest", 10 | "test:unit:watch": "sfdx-lwc-jest --watch", 11 | "test:unit:debug": "sfdx-lwc-jest --debug", 12 | "test:unit:coverage": "sfdx-lwc-jest --coverage", 13 | "prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", 14 | "prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", 15 | "postinstall": "husky install", 16 | "precommit": "lint-staged" 17 | }, 18 | "devDependencies": { 19 | "@lwc/eslint-plugin-lwc": "^1.0.1", 20 | "@prettier/plugin-xml": "^0.13.1", 21 | "@salesforce/eslint-config-lwc": "^2.0.0", 22 | "@salesforce/eslint-plugin-aura": "^2.0.0", 23 | "@salesforce/eslint-plugin-lightning": "^0.1.1", 24 | "@salesforce/sfdx-lwc-jest": "^0.13.0", 25 | "eslint": "^7.29.0", 26 | "eslint-plugin-import": "^2.23.4", 27 | "eslint-plugin-jest": "^24.3.6", 28 | "husky": "^7.0.0", 29 | "lint-staged": "^11.0.0", 30 | "prettier": "^2.3.2", 31 | "prettier-plugin-apex": "^1.10.1" 32 | }, 33 | "lint-staged": { 34 | "**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [ 35 | "prettier --write" 36 | ], 37 | "**/{aura,lwc}/**": [ 38 | "eslint" 39 | ] 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /scripts/apex/hello.apex: -------------------------------------------------------------------------------- 1 | // Use .apex files to store anonymous Apex. 2 | // You can execute anonymous Apex in VS Code by selecting the 3 | // apex text and running the command: 4 | // SFDX: Execute Anonymous Apex with Currently Selected Text 5 | // You can also execute the entire file by running the command: 6 | // SFDX: Execute Anonymous Apex with Editor Contents 7 | 8 | // string tempvar = 'Enter_your_name_here'; 9 | // System.debug('Hello World!'); 10 | // System.debug('My name is ' + tempvar); 11 | 12 | 13 | // for ( Schema.SObjectType o : Schema.getGlobalDescribe().values() ) 14 | // { 15 | // Schema.DescribeSObjectResult objResult = o.getDescribe(); 16 | // system.debug( 'Sobject: ' + objResult ); 17 | // system.debug( 'Sobject API Name: ' + objResult.getName() ); 18 | // system.debug( 'Sobject Label Name: ' + objResult.getLabel() ); 19 | 20 | // } 21 | 22 | // Database.executeBatch(new BatchApexExample()); 23 | 24 | ExchangeController.checkPANStatus(); -------------------------------------------------------------------------------- /scripts/soql/account.soql: -------------------------------------------------------------------------------- 1 | // Use .soql files to store SOQL queries. 2 | // You can execute queries in VS Code by selecting the 3 | // query text and running the command: 4 | // SFDX: Execute SOQL Query with Currently Selected Text 5 | 6 | SELECT Id, Name FROM Account 7 | -------------------------------------------------------------------------------- /sfdx-project.json: -------------------------------------------------------------------------------- 1 | { 2 | "packageDirectories": [ 3 | { 4 | "path": "force-app", 5 | "default": true 6 | } 7 | ], 8 | "name": "lwsComm", 9 | "namespace": "", 10 | "sfdcLoginUrl": "https://login.salesforce.com", 11 | "sourceApiVersion": "52.0" 12 | } 13 | --------------------------------------------------------------------------------