How to Solve Now

Main menu

Skip to primary content Skip to secondary content
  • Home
  • PHP
  • Laravel
  • Javascript
  • Internet
    • Telephone
      • Android
    • Website Design
  • Computer
    • Installation
  • Contact Us

Home

How to Solve Now > Home

Cheat Sheets

Posted on March 23, 2018 by Janaki in Salesforce / 0 Comment(s)

Salesforce 1 Developer Cheatsheet Salesforce 1 Admin Cheatsheet App Logic: Process Automation Cheatsheet App Logic: Formulas Cheatsheet App Logic: Apex Code Cheatsheet UI: Lightning Components Cheatsheet UI: Visualforce Cheatsheet Custom […]

Create a map for duplicate contacts by phone or email id

Posted on March 22, 2018 by Janaki in Salesforce / 0 Comment(s)

Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Map<String,List<Contact>> phoneMap = new Map<String, List<Contact>>();
List<Contact> scope = [SELECT Id,Phone,Email,CreatedDate
                FROM Contact
                WHERE (Phone!='' OR  Email!='')
                order by createddate desc];
 
 
for(Contact ct:scope) {
            String phone = String.valueOf(ct.Phone);
            String email =  String.valueOf(ct.Email);
            if(String.isNotBlank(String.valueOf(ct.Phone)))
            {
                phone =  phone.replace('-', '').replace('(', '').replace(')', '').replace(' ', '').replace(',', '');
                if (phoneMap.containsKey(phone)) {
                    List<contact> c = phoneMap.get(phone);
                    c.add(ct);
                } else {
                    phoneMap.put(phone, new List<Contact>{
                            ct
                    });
                }
            }
            else{
                if (emailMap.containsKey(email)) {
                    List<contact> c = emailMap.get(email);
                    c.add(ct);
                } else {
                    emailMap.put(email, new List<Contact>{
                            ct
                    });
                }
            }
        }
 
 
        for(String key:phoneMap.keySet())
        {
            List<Contact> ct = phoneMap.get(key);
            if(ct.size()>1) {
                System.debug('phoneMap:  ' + key + ': ' + ct.size() + ': ' + phoneMap.get(key));
            }
 
        }
 
        for(String key:emailMap.keySet())
        {
            List<Contact> ct = emailMap.get(key);
            if(ct.size()>1) {
                System.debug('emailMap:  ' + key + ': ' + ct.size() + ': ' + emailMap.get(key));
            }
 
        }

Don’t just create the Model, implement Repository Pattern

Posted on March 16, 2018 by Janaki in Laravel, PHP / 0 Comment(s)

Think a scenario where your application uses MySQl database, and you need to switch to a different DB,that means are you going to rewrite your database logic again?. Thanks to […]

Generate dummy data in Laravel using Model Factory

Posted on March 16, 2018 by Janaki in Laravel / 0 Comment(s)

Here are the steps needed to create dummy data Lets create a model called Sample with migration file, using php artisan command

PHP
1
php artisan make:model Sample -m

Run the migration by

1
php artisan migrate

Generate a factory […]

  1. Pages:
  2. «
  3. 1
  4. 2
  5. 3
  6. 4
  7. 5
  8. 6
  9. 7
  10. ...
  11. 39
  12. »

Categories

  • Android (12)
  • API (2)
  • ASP.Net (2)
  • Blackberry (3)
  • C# (4)
  • Cassandra (1)
  • CCIR Service (1)
  • Computer (5)
  • Content Management (1)
  • DBMS (1)
  • E-Mail (4)
  • Excel (2)
  • Explorer (2)
  • Installation (17)
  • Internet (12)
  • iPhone (1)
  • JAVA (4)
  • Javascript (6)
  • JSP (1)
  • Language (2)
  • Laravel (17)
  • Linux (8)
  • More (13)
  • MySQL (5)
  • Oracle (1)
  • PHP (35)
  • Question Set (1)
  • Reference (4)
  • Salesforce (7)
  • Shoretel (1)
  • SQL (1)
  • Sugar (6)
  • Telephone (7)
  • Web Programming (1)
  • Web Service (3)
  • Website Design (6)
  • Website Hosting (2)
  • Zend (2)

Most recommended posts

  • DID you see wpupdatestream user in your wp_users table
  • Invalid icon file located in Application Folder of Setup Project
  • Install Php MyCrypt on centOS

Popular

Install MySQL as window service0 comment(s)
Getting weeks between two dates in MySql0 comment(s)
Back Up MySQL Databases From The Command Line0 comment(s)

want to twitt

  • Connectivity Issues with .IN Registry • Namecheap Status https://t.co/F0b2vWwTL7 via @Namecheap 04:03:49 AM March 27, 2017 from Twitter Web Client ReplyRetweetFavorite
  • CentOs Vagrant Configuration file https://t.co/Ay8ZGxexTU 06:13:44 PM December 27, 2016 from Twitter Web Client ReplyRetweetFavorite
  • Laravel Artisan commands are added to website. check now https://t.co/jOO35sbnwv 12:09:03 AM February 26, 2016 from Twitter Web Client ReplyRetweetFavorite
  • Just setting up my Twitter. #myfirstTweet 12:07:12 AM February 26, 2016 from Twitter Web Client ReplyRetweetFavorite
@xenatasolutions

  • Home
  • PHP
  • Laravel
  • Javascript
  • Internet
  • Contact Us
© 2015 How to solve now, powered by Xenata Solutions