Data types in Apex

Apex supports the following data types.

  • A primitive, such as an Integer, Double, Long, Date, Datetime, String, ID, Boolean, among others.
  • An sObject, either as a generic sObject or as a specific sObject, such as an Account, Contact.
  • A collection, including:
    • A list
    • A set of primitives
    • A map
  • A typed list of values, also known as an enum
  • User-defined Apex classes
  • System-supplied Apex classes

Collection:

List:-Lists in Apex give ordered collection of objects.Its like array who give the ordered collection.List can contain duplicate.

Syntax for creating a list:-

List<Datatype> list_name =new List<datatype>();

Set:- Its stores the Set of Integer Values. unordered and no Duplicates are allowed.

Syntax for creating a list:-

Set<Datatype> set_name = new set<datatype>();

Map:- It is a collection of key and value pairs.where as key is primitive datatype and value can include primitives,sObjects,Apex object.you can use Map when you want to quicly find value by using key.

Syntax of creating a list:-

Map<key_Datatype,value_Datatype> map_name = new map< key_Datatype,value_Datatype>();

sObject:-

In salesforce Apex is integrated with database.An sObject is any object that can be stored in the force.com database. Each Salesforce record is represented as an sObject before it is inserted into Salesforce.

If you have create custom object in salesforce, then use API name of that custom object in Apex.

Creating sObject variables:-

Account a = new Account(Name=’Bank’);

You can add other fields for Account and can add records in it.

Account a = new Account(Name=’Bank’, Phone='(435)000-1212′, NumberOfEmployees=100);

Apex in Salesforce

Apex is a programming language in Salesforce.com which is similar to Java programming with object oriented concepts.Apex enables developer to add business logic to system events like visualforce pages,button clicks and update of records.

Apex supports:-

  • Triggers which are similar to database system triggers.
  • Database statements that provide query language in salesforce like SOQL and SOSL.
  • Rollbacks and transactions.
  • give Global access modifier.
  • versioning of custom code.

We can write apex code directly in Salesforce user interface.Open the Developer Console under Your Name or the quick access menu You can also write Apex code on client by using  Force.com IDE plugin for Eclipse.

Apex Classes

Steps for creating Apex class:-

  • Open Developer console Under your name or Quick access menu.
  • In the Developer console click File>New>Apex class and enter class name myfirstclass then click ok
  • Enter this code
  • Click Ctrl+S to save your class

Now we use anonymous Apex execution for invoke Apex.Its allows you to run lines of  code for test out functionality.

  1. In the Developer Console, click Debug >Open Execute Anonymous Window.
  2. In that window enter following code.

3. Now click on Execute.

this method has executed now you get total number of i and j.

Trigger in Salesforce

What is Trigger?

Trigger is a piece of code which executed when before and after event occur.Triggers can be Defined for Standard object(Account,Contact) ,Custom object and some Standard child object .

Apex Trigger is the Apex code which is executed when before or after this Operations performed:

  • insert
  • update
  • merge
  • upsert
  • undelete
  • delete

 

 

Trigger Syntax:

Trigger syntax starts with trigger keyword. After that you use trigger name on object(object name which you want) and conditions under which is fired .Trigger syntax-

 

Trigger Context Variable

All triggers define implicit variables that allow developers to access runtime context.These variables are contained in the System.

isExecuting:

Returns true if current context is Trigger,not a Web service,Visualforce page.

isInsert:

Returns true if Trigger was fired due to insert operations from the Salesforce interface user,Apex or API.

isUpdate:

Returns true if Trigger was fired due to Update operation from the Salesforce Interface User,Apex,API.

isDelete:

Returns true if trigger was fired due to Delete Operation from the Salesforce User Interface,Apex,API.

isAfter:

Returns true if trigger was fired before any records saved.

isbefore:

Returns true if trigger was fired after all records were saved.

isUndelete:

Returns true if trigger was fired after a record is recovered from the Recycle bin.

new:

Its return the list of recently added records in Trigger.

old:

Its return the list of old versions of records in Trigger.

10 best SEO practices, which increase your website traffic 2019

What is SEO and how it’s works:

SEO is stands for search engine optimization, it’s a rule that needs to follow. It’s helps us to bring traffic on our website. There is no shortcut, to rank on top on Google, but these strategies can help you to improve site performance. Initially I made this checklist for our clients, but I am very happy to share this to everyone.

In this article, I am sharing top 20 checklist, that needs to follow for every website. So, let’s get started.

Content matter’s, write high quality content:

Google is a search engine, where people ask questions and search for something. The content you are writing it’s submitted to the google as an answer, which google share to the users. As much content is informative and use full, google worth sharing it. This information tells people how to do something, where to find anything. These information people circulate in their cycle and sharing to others. That’s why google always looking for high quality content.

In SEO terms of view content is king, content should be unique and written in high quality. There should not be Plagiarism or duplicate content. Content should be SEO friendly, like proper use of keyword’s in each paragraph.

To write the high-quality content, find the uniqueness in your writing, try to differentiate yourself and provide value to the users. The first step to analyse the custom requirement and provide the value to them. You have to know the interest of your customer, what they are looking for. Your main focus should be answering the readers question on such a way so that they can find it useful and more informative.

Proper use of title tag:

The first step of SEO best practices is keyword research. One you finalize your topic you need to do keyword research; I am using keyword everywhere addons on chrome, it’s free and given good results. You can use other’s as well. Once keyword research done, place your title tag, syntax will be Primary keyword | Secondary keyword | Brand name. Try to Keep title 55 in length or less than that. It’s tells the Google what is the article about, what kind of information it will provide.

The use of meta description:

The meta description tells website visitors about the content, before they click on it. Its a summarize the website content, which display on search result page. It should be up to 155 character long and its containing the focus keyword. Meta description will be same for all the pages, there should not be a duplicate content. If you have lots of pages and don’t have time to place meta description for all the pages, try to put on popular pages like home page, product page, rest you can leave it blank. Google will fetch the meta description from search query.

Now question is that, how to put meta description on website. If you are using WordPress, you can use All in one SEO plugin or yoast SEO, its a bit easy, you can get option in your website dashboard.

The use of site map :

Sitemap on website plays a important role. It helps Google to index your website pages, Google crawler search for specific pages and index them. If you are using CMS like WordPress there are few good plugins available like XML sitemap & Google News Feed or Google XML Sitemaps. Once your sitemap has been generated, you have to login to Google webmaster tools and there is option to Crawl-Sitemaps, here you can submit your sitemap to Google.

Remove 404 errors from website :

Having 404 errors will give big impact on your website, make sure you don’t have 404 errors in website. It will give less user experience and also effect on your website ranking. There are few good plugins in WordPress which will automatically detect 404 error pages and fix them. I am using broken link checker, it will monitor website links in your posts, pages as well as comments. It will detect links that don’t work, images which are missing and redirect them. It will send you notification or you can get information on dashboard. Links can be directly from plugin page, instead of update manually each page and its highly customizable.

10 Habits of successful people, you should know in 2019

Want to become successful in life ! must read it

Peoples are wondering how most of the people become successful in their life, even they are from same field or same career track.

Image by Gerd Altmann from Pixabay

Very few time stamp they got popularity and become financial strong. They never realized since how long they hold the desire to become successful, their habits and their discipline.

Whatever you achieved today, where you are today, it’s determined by the habits and discipline you followed since long time. To accomplice any goal you have to keep strong desire and needs to follow the principal which keep pushing you towards your goal.

If you follow the certain principal and habits in your life, you too will be able to gain success and popularity very soon. Today my article about 6 habits of successful people in 2019 is about the same.

You are struggling lot in your life and doing very hard work, but just because of lack of principle and planing, you are facing challenges in your life to achieve your goals and keep blaming on luck, I am going to describe the six major habits of all the successful people, who achieve their goal in their life and become successful.

Surrounded by positive people :

One of the major things you can see, people are surrounded by positive and energetic people, they don’t have room for negativity and obstacles in their life. They achieve each milestone very confidently with their positive approach.

They have a deep understanding of success and failure is the part of the life, but they keep trying, if you heard about alibaba.com founder Jack Ma, who founded e-commerce giant Alibaba Group and helped launch China’s online retailing boom, if you read about his history of success, he applied for 30 times in a job and got failed, applied 10 times in Howard but not succeeded. Still, he tried with his positive approaches, today venture is used by millions of users. This is called the power of positivity.

They are goal oriented :

One of the best things I noticed that people who are successful in their life, they are goal oriented, they believe in achieve small milestone or goal with meaningful result. We need to always make a goal and try to accomplish large goal by dividing in small piece of task, which we can achieve easily, each small achievement gives motivation and energy to fight for next goal, this is the way we can achieve any thing in your life.

For example, you want to become a good programmer. First you need to set up little milestone like writing 2 or 3 programs every day.  

Once you complete you task, you should congratulate yourself.

In a long run, you found yourself at a decent stage, where you can write large program effectively. This is an example; it could be anything. But first of all, you have to become a goal oriented.

Keep you organized :

Either you have to go for education or you have to go for office, try to keep organized your self, utilize your free time to plan your next day. Make your to do list to all of the task needs to complete today, try to put time line and track each task by the end of the day. Keep your self clean, make work station clean, some times its improve your mood. If you are going to attend any meeting with client, try to prepare with meeting agenda, take a notebook and note down, each major points, that you can implement later.

Successful people always organized by their dressing sense, at home or at office. They keep track of each and every small peaces of work on organized manner, which improve their productivity.

Work life balance is essential :

Work life balance is essential for everyone, specially for those who put extra time to complete their job, work smarter instead of work harder, never bring office things at personal life, commit for healthy work life balance in your life, which helps make you success in long term goal.

First understand what matters to you, every one having different priorities, once you find your priorities, its easier to maintain your work life balance. Feel free in your life, give some time to nature, go for outing on weekends, enjoy with family and kids, its all matter in long term. Successful people always maintain their work life balance, they give time to health like they do meditation or other health activities daily, they give time to family like outing with family or movies and they give time to their office as well. Some habits we have to maintain like wake-up early, going to bed early, sleeping at least 8 hours, meditation etc. If your really want to successful in your life first you have to maintain work life balance in your life, it will help you to give success in long term as well.

Be grateful what you have today :

Being gratefulness is unique habit, which have to follow each day and every moment of life. Be grateful to what you have today, whenever you wake-up try to note down 5 things in your life, for that you have grateful. Do it daily basis, some times its helps to realize your value. I saw in people they bring them self down just because of daily obstacles or challenges, they easily adopt negative thoughts and not feeling blissful. Every body has blissful in this world, everybody having problems in this world, and every problem has solution. So we had deep understanding there is no problem in the world, which not having solution.

Do meditation everyday without fail :

Meditation will calm yourself and improve your mood. It will remove all the negative things and obstacles from your mind and gives you positive attitude towards, the life, I written separate article on Meditation techniques for beginners, make sure you read it.

Successful people’s are very conscious about body and mind, they do yoga or meditation on regular basis. I would like to advise you if you are feeling with negativeness in your life or facing any kind of challenges, definitely you should start meditation, it will give you lots of amazing befits, which I can’t cover in one chapter. Lots of famous actors or actress, famous people start their day with yoga and meditation. Because they are very much aware of its benefits.

Be a action oriented :

Procrastination is one of the major problem in people, they knows the priority work and tasks needs to complete, but they are delaying it, because they feel lazy. To remove procrastination we have to become action oriented, as I mentioned earlier, start with small peace of work instead of taking complete task, try to finish within time frame, then move to the next task. Every things needs to start, you have to just start first, its never late to start anything, instead of averting to next day or later.

Self discipline required :

Everything start from within, we have to keep things prioritized and follow the discipline. All the successful people in the world they maintain self discipline.

Its an important habit, everyone should know, its gives you amazing benefit every area or your life. Its mean you make restriction, its mean control yourself, improve your inner strength, your reaction for some thing.

Self discipline gives you the power to stick to your decisions and follow them through, without changing your mind, and is therefore, one of the important requirements for achieving goals.

The possession of this skill enables you to persevere with your decisions and plans until you accomplish them. It also manifests as inner strength, helping you to overcome addictions, procrastination and laziness, and to follow through with whatever you do.

Keep moving forward and learn from mistakes :

One of best thing’s you could notice in the successful peoples is forgiveness, They never stuck with mistakes, they learn the lessons and move forward, remember whenever you feel that, you did any mistake, just try to learn from it and forgive your self and move forward. Every body doing mistakes in life, some are small or some or big, this universe is big, don’t limit your self in the room or city or country, think at universe level. You are not alone who did some thing wrong. Never put your self down. Be always motivated, read motivation books and watch motivation videos.

Seek inspiration and be motivated :

Most of the people face obstacles in daily life and stated suffering with mental roadblock, not able to deal the situation positively, this time to get inspiration from the successful people life. You can get lots of material and free video in you tube, which help you to know how things should be handle and how to be motivated. Remember success will not like you get in one night, you need to constant focus on your goal, do hard work constantly, without any hesitation or fear.

Conclusion : People who become successful they are also human, they didn’t came from other world, they also faced lots of challenges in there life, however, they faced it and moved ahead. If they can do, so why not you, Here I am going to summarize my article, to know most necessary habits needs to implement today to achieve our goals.

  1. Wake up early : Try to wake up early, ideal time is 6 am or 5:30.
  2. Do mindfulness : Go for walk for few mints and do yoga or meditation, start with 15 mints per day, but be regular.
  3. Have healthy breakfast : Try to had healthy breakfast, which include, fruits, egg, dry foods.
  4. Prioritized today work : Make a to do list to prioritized your work and follow with time line, try be productive all the day and learn some thing new.
  5. Read and be inspired : Try to read inspiration or watch motivation videos.
  6. Give importance of time : Never waste your time, always try to do something, learn something.
  7. Take a break : Take a small break and do some breathing activities like take a deep breath, hold for second and exhale slowly. At least do it 3-4 four times a day.
  8. Give time to yourself : Give time to yourself, your family, play with kids.
  9. Involve in social activities : Try to involve in social activities, surrounds yourself with positive people.
  10. 8 hours of sleep : try to go to bed early and learn some mindful activities, which help you deep, relaxed sleep.

If you are really thinks its help full, put your experience and thoughts below in comment box, I really glad to hear from you.

Meditation techniques for beginners

We all heard about meditation, some people always doing, who’re aware of amazing benefits of it and some are thinking to start soon. But one things I saw in people, they never start until unless they do not face do or die situations.

Image by 4144132 from Pixabay

What does meditation do : Here I am gonna tell you my story. I was suffering from 2010 with lot of stress and depression. After passing my post graduate, I was started my career in startup, where lots of pressure, lack of motivation and getting peanuts name of salary. Then marriage and kid. That was also not going well. Till 2014 I was struggling, then I heard about one small organization doing some kind of mindfulness activities, I met with them with the reference of my real state broker, I joined and very first day I realized why I should not start it earlier or few years back.

What I realized from very first day after completed my 20 mints of meditation, it’s improve my mind and thought process, feeling mentally relaxed and calm. Now think about people who are doing from years and years. How they are feeling, how they are dealing daily life obstacles and problems. Few benefits I can say from meditation which I realized:

meditation benefits :

  1. Improve focus
  2. Give relaxation and calmness
  3. Improve health
  4. Improve relationship
  5. Became more productive
  6. Positive thoughts
  7. Present awareness and much more

Meditation techniques for beginners: Sit in a comfortable position, make your spin straight, close your eyes. Take a deep breath full your lungs with fresh air, count one to five and exhale slowly. Imagine your taking positivity during inhale and removing all your negativity and stress during exhale.

Again take the deep breath full your lungs with fresh air and count one to five then exhale slowly. Repeat this step 10 times. Then slowly concentrate on breath, slowly breath in and breath out. You can use some relaxation music which you can easily on you tube or internet, some mobile apps also available. Try to relax as much as you can, some times thoughts will come, simply observe it, don’t attach with it, don’t respond it, it will disappear automatically. You have only concentrate on your breath, don’t think any thing, lets thoughts come and let it go.

Initially you can do for 10 mints, later you can increase as per your convenient, but one thing you have to commit with yourself, you have to do it regularly. The best time of mediation is morning and night before going to bed. Some people doing twice a day, its not mandatory, but you can do for better results.

Once you done for initial 10 mints, simply open your eyes, see how you are feeling now.

I am doing meditation for 3 years per day 40 mints, I am feeling all its amazing benefits, mediation is for every one, for kids, for younger or old person.

You’ll never feel stress after reading this article

Dealing with stress! racing thoughts, having low mood.

Next 15 mints will definitely change your current experience. Five years back I was also on the same track, dealing with low mood and restlessness, not having quality in life.

I gone through lots of articles, tried lots of techniques and finally improved my self. Its not a one night achievement, but definitely you will feel better from first day.

lets see causes of stress

  1. Loss of job
  2. Financial issues
  3. Divorce
  4. Loss of some one
  5. Emotional problem ( anxiety, depression, anger, guilt, low mood)

These are few, might be other’s also, all the situations changing out through process. If we see some one else are suffering with same, we can advice him or her better, but when comes to self its difficult to recover.

“More smiling, less worrying. More compassion, less judgment. More blessed, less stressed. More love, less hate.”
― Roy T. Bennett, The Light in the Heart

Here I am going to teach you few practical techniques which I was implemented and it was working. So lets begin with few

Change your habit and routine :

The first step is change your habit and routine. When I was in college , I use to sleep late and wake up early, these routine was also continue after education, when I was in full time 9 hours of office routine. Some time I have to stay at late time in office or needs to finish office work at home, lack of sleeping, skipping breakfast, I used to frequently smoke but after some time its become habits. These are the some bad routine which loosing my energy level. I would to tell you some good habits that will definitely recover your mood.

  1. Go for walk : Set alarm, get up from bed early, try to push your self and go for walk. The morning air will refresh your mood and feel good. Try to make this habit on daily basis, definitely it will help.
  2. Exercise regular : Exercise will boost your energy and reduce cholesterol from the body. Start with just 15 mints per day, after few days you will see the improvement.
  3. Do mindfulness : Whenever you feel stress take a deep breath hold it for few seconds and count 1 to 5, then exhale slowly. Do this activity for 5 times and thrice a day. Try to learn meditation techniques, I have written separate article how to meditate for beginners.
  4. Take a 8 hours of sleep : Some time lack sleeping will also cause of irritation, anger and headache. We need to take at least 8 hours of sleep per day. Make a time table for your each day routine go to bed by 10:30 and try to wake up at 6:30.
  5. Skip Alcohol and smoke : Try to skip alcohol or smoke, if not able to quite immediately try to reduce the quantity slowly slowly, later you can skip it permanently.

Be grateful what you have :

Everyone have grateful of some thing in life, but due to stress and anxiety, only negative things he can see, some thing called internal chatter, due low quality life, its always give negative thoughts, we need to change it to positively.

Take a pen and paper, write down 5 good things in life, for that you are grateful. Try to write daily, you will feel good and it will improve your life quality.

Try to surrounds your self with positive people : Negative people will always demotivate you, try to surround yourself with positive and energetic people. Read success stories, watch motivation video, frequently meet with some one who gives you smile on your face.

Achieve small milestone : Big task some time cause you stressed, if you stuck lot of times, make a to do list of your daily tasks, divide in smaller parts. Once you achieve it, congratulate your self. slowly slowly try achieve your goals. These techniques used by lot of successful people and they are able to crack big worrier.

Put your thoughts on paper : Try to start writing, take note book and pen, try to write down your thoughts in paper, whatever you feel, whatever is going in your mind, try to write. Use this on daily basis, at least 15 mints per day. Your internal chatter will reduce, you will feel positively.

Conclusion : Stress is every where, every one having a stress, some time its gives work pressure, and give good productivity. We have to learn how to manage the stress or deal with stress. Whenever you feel stress try to take it positively, instead of putting yourself down. Follow all the practical tips given above in this article, definitely you will improve your self. Write down your suggestions and experiences below in comment box, glad to hear from you.

How to export data in salesforce for backup purpose

Salesforce provide data export feature to obtain a copy of all your salesforce data .You can generate backup files for manually or automatically. You can set backup files automatically in 7 days or 29 days(weekly or monthly intervals) or also set it manually on weekly or monthly basis.Backup files provide . zip file that contain all yor organization data in .csv format.

Step by step instruction:

  1. Go to Setup> Data Management> Data Export> Schedule Export.
  2. Select Export files encoding .If not any then leave it Default.
  3. Click on the checkbox if you want to attach any images,documents and attachments.
  4. Leave the default Replace carriage returns with spaces if you want your export files to have spaces instead of carriage returns.
  5. Select frequency weekly for the export.
  6. Select start and end date.
  7. Set the time of day for your schedule Report.
  8. You can select type of data in you export.It is best to include all your data in your export file.
  9. Click save.

Important things-

  • Formula and roll-up summary field are never included in export.
  • When an export is ready for download you will receive an email containing a link that allows you to download the file.
  • Scheduled backup exports of your data is limited to weekly exports.
  • The export files are also available on this page for 48 hours, after which time they are deleted. 

Report and Dashboard in salesforce

Report and dashboard

Salesforce offers a powerful package of reporting tool. We use report and dashboard to convert business desires into visualize type .Using this tool we will grow our business.

What is report?

Report is a group of records it is used to display records in terms of row and column like excel and can be filtered,grouped and displayed in visualize type.When you create report in salesforce you fill some criteria then you get criteria based mostly answer.

Types of report

Salesforce offers different types of reports in order that we will build our report .there are four types of report which provide additional flexibility to our records and showing different type of data, depending on what you wish out of a report.

  1. Tabular Report-

Tabular reports are the simplest and fastest form of showing reports it is by default and show the record like spreadsheet and consist set of field as column and records as row. Tabular report provide us a list of record with single grand total.

  • Summary Report-

Summary report is similar to tabular report but it’s also offer to users to view subtotals, create chart and group the data base on row.

  • Matrix Report-

Matrix report are similar to summary report but it’s also offer users to group and summarize of records by  both row and column to see different total.

  • Joined Report-

Joined report  give us five report blocks for create multiple view of your records.we can add multiple report type in joined report.

How to create Report in Salesforce

Salesforce provide Report Builder for creating report which is drag and drop type. Using report builder we can easily create report by clicking fileds,filters ,range etc.

First thing you have to make sure that  enabled the report builder if it is not enabled then go to enable this for all users .

Go to setup and write in Quick find box Report and Dashboard setting then select Report and Dashboard setting ,review the report builder upgrade section page and enabled it.If you don’t see this button its mean Report Builder is enabled for your organization

Steps for creating Report

  1. Go to Report tab and click on New Report.
  2. Select report type Accounts and then click create.
  3. Click  Add on filters and choose field on drop down list.
  4. Set the filter operator equals.
  5. Set the Range All Time select created date.
  6.  Click on Run the report.

how to install Data Loader

Before installing data loader you have got  to examine that all your system requirements fulfill.

Requirements for windows

We need this things before installing Data Loader in Windows:

  • 64 bit Microsoft ,Windows 7,Windows 8,Windows 10
  • 256 MB Memory
  • 120 MB free disk space
  • Zulu OpenJDK version 11

Zulu OpenJDK  it’s a Java Development Kit (JDK) that is deployed on lots of platform.

Requirements for  macOS

  • 64 bit macOS EI Captain
  • 256 MB Memory
  • 120 MB free disc space
  • Zulu OpenJDK version 11

Install Data Loader for Windows

  1. Install Zulu OpenJDK version 11 using .MSI File
  2. Download Data Loader installation file from setup.
  3. Right click on .Zip file and Extract all.
  4. In Data Loader open install.bat file if any error generates you can ignore it and Run the file.
  5. Ensure where to want to install Data Loader or overwrite the existing installing data loader
  6. Check whether your Data Loader install on your desktop

Install Data Loader on macOS

  1. Install  Zulu OpenJDK version 11 using .DMG File.
  2. Download Data Loader installation file from setup
  3. Open .Zip File and Extract all.
  4. In Data Loader open install. Command file. If you get any error message than press Control Key while clicking install. Command line and select open from the menu.
  5. Ensure where to want to install Data Loader.
  6. Check whether your Data Loader icon install on your desktop.
Design a site like this with WordPress.com
Get started