Tips Posts

post

Introduction











Persuasion is a method of communication aimed at influencing the attitudes, beliefs, or behaviors of others. In terms of sales, understanding usually occurs when a sales representative tries to convince a prospect that their product or service is the best solution to their problem.
Let's review the persuasion strategy you can implement today to close your next deal.

1. Personalize your message













If you want to explain the possibility of considering your product, resist the request to follow the general sales script. When you make excessive rehearsal noise or don’t share messages or information that seems to suit your prospect, your efforts go to one ear and go to the other.
This doesn't mean you need to fully wing your sales calls, it does mean you need to be prepared to adjust your message based on what interests you in the potential.

2. Focus on problem-solving













Instead of telling the prospect all the reasons why they should buy your product (which may feel pressure and emotion), focus on sharing all the reasons why your product can help them solve their problem. By focusing on their concerns and locating your offer fur as a solution, you are showing the value of your product without excessive pressure.

3. Give social proof













Letting your past customers sell to you - knowing when to take advantage of social proof can be a powerful persuasive trick.
While buyers may take your point as a sales representative with a grain of salt because they know you want to sell, they are more likely to trust a testimonial or story from a previous customer who was looking for a similar solution.

4. Assume goals













Picture: You feel ready to call your sales call. You think you have a solid understanding of who the prospects are and what they are looking for. Your notes have been typed and you are ready to close the deal.
Then during a call, potentially throws out several turns, asking you questions and mentioning objections that you weren’t prepared to account for - the dream of every sales rip. But don't go too far. This is a valuable learning experience.

5. Empower empowerment decision making













After all, you want your customers to buy from you because they really want to, not because they feel pressured. And let’s be realistic - including your prospects, don’t like to tell anyone what to do, so you’ll avoid being too directive in your approach. As a sales representative, it is your job to provide the context and information that makes your product a thought-provoking product.

6. Make personal connections



It's a basic rule of human interaction - we're all ready to trust and engage with people we really love on a deeper level. While buyers can choose your product or brand as a sales representative, you are the main source of human engagement representing your company.

7. Don’t rush into the process













Last but not least, don't rush your prospect through the sales process. We get it - you have goals on a regular basis. However, effective persuasion should seem natural to the prospect. They do not feel pressured or rushed to sign the dotted line. This doesn’t mean you can’t implement a sense of urgency or be on time - in fact making a little sense of urgency (such as paying a special price for a limited time) can be an effective trick.
October 16, 20203 minutesauthorAnkit Kalathiya
post
In the previous article, we learned 6 areas or tips on How to increase profits in our business - part 1.

In this article, we will learn more about how to increase profit in our business. Maximizing Profit depends on the strategies that business owners take. There are only two ways to do this:
1. Increase Prices
2. Reduce Cost.

You simply cannot say that you are going to increase the profit of your business without a specific strategy. All you can do to increase profit is to improve the variables that ultimately determine your Profitability. Let's see 7 more points to increase profit.

7. Know your sales Channel




To stimulate your sales channel, you need to generate excitement and a reason to buy. This can be done by introducing vibrant, brightly colored sales that include all your products and services and by expressing a sense of urgency, encouraging sales partners, and adding subscription sales.

8. Find a new Customer




Follow up after meetings. Contact the people you meet to see if they are likely. If they say they no longer need your services, ask them when it's a good time to call, or if they have business associates who can use what you sell now.

9. Remove unprofitable service and product




If you have more than one product or service, any analysis will determine if one is more profitable than the other. If you have a lot of products in your offering, you can trust that some of them will not make money. The trick is to find out what they are and then put in motion plans to eliminate them. The basic tool for doing this is an orderly list that ranks all your products and services showing total revenue and all direct costs and total profits.

10. Reduce labor costs with part-time workers




Employment is lower than full-time workers than part-time workers. Take advantage of this luxury by hiring multiple part-time workers. Warn that if these people are presented to your company with a full-time opportunity they will leave them first.

11. Develop a CEO monthly letter to employees to create teamwork and communication




You'll want to have monthly conversations with your team, letting them know about any updates, highlighting individual performances, and reminding them of goals for the quarter and year. This will help build team morale and focus on expectations.

12. Invest in your people




Your team will only be able to make exceptional work progress and be competent when you invest in their improvement. Invest in their continuing education and also provide the best resources to do their job effectively.

13. Send personal notes of congratulations or thank employees at their home




When you send complimentary notes to employees ’homes, it shows that you think of them as a person rather than just a worker. This helps increase employee loyalty to your company.

That's it. If you want to run a profitable business, take these tips and apply them to your business. It will help your business perform better, keep growing, and increase profits.
October 09, 20202 minutesauthorAnkit Kalathiya
post
What is a recycler view?

  • RecyclerView is used to show the data in the form of a scrollable list. It is a ViewGroup to display a large set of data. For each item in a large dataset, it displays a View. So RecyclerView is very useful no use the scrollable list.

Why use RecyclerView in Android?

  • One reason is so we can create a List through the LinearLayout and the orientation can be vertical. For example, in the Facebook application, all parameters will be the same as share, comment, like, etc. Now if we will take LinearLayout, all the views will create separate views in the memory.
Add dependencies :



dependencies {  

    implementation "androidx.recyclerview:recyclerview:1.1.0"
} 

Notes:

  • Androidx in recycler view dependencies:  implementation "androidx.recyclerview:recyclerview:1.1.0"
  • Your android studio, not androidx:  implementation 'com.android.support:recyclerview-v7:28.0.0'

Now we will add the RecyclerView layout in our activity_main.xml file

<?xml version="1.0" encoding="utf-8"?>  
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
xmlns:app="http://schemas.android.com/apk/res-auto"  
xmlns:tools="http://schemas.android.com/tools"  
android:layout_width="match_parent"  
android:layout_height="match_parent"  
tools:context=".MainActivity">  
  
<androidx.recyclerview.widget.RecyclerView  
    android:id="@+id/recyclerView"  
    android:layout_width="match_parent"  
    android:layout_height="match_parent" />  
  
</RelativeLayout>

We create a layout file named row_layout.xml.

<?xml version="1.0" encoding="utf-8"?>  
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
xmlns:app="http://schemas.android.com/apk/res-auto"  
xmlns:tools="http://schemas.android.com/tools"  
android:layout_width="match_parent"  
android:layout_height="match_parent"  
tools:context=".MainActivity">  
  
<androidx.recyclerview.widget.RecyclerView  
    android:id="@+id/recyclerView"  
    android:layout_width="match_parent"  
    android:layout_height="match_parent" />  
  
</RelativeLayout>

We create a layout file named row_layout.xml

<?xml version="1.0" encoding="utf-8"?>  
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
    android:layout_width="match_parent"  
    android:layout_height="match_parent"  
    android:orientation="horizontal">  
  
    <ImageView  
        android:id="@+id/image"  
        android:layout_width="300px"  
        android:layout_height="300px"  
        android:layout_marginLeft="10dp"  
        android:layout_marginTop="10dp"  
        android:src="@color/colorPrimaryDark" />  
  
    <TextView  
        android:id="@+id/description"  
        android:layout_width="250dp"  
        android:layout_height="55dp"  
        android:layout_toRightOf="@id/image"  
        android:layout_marginLeft="15dp"  
        android:layout_marginTop="35dp"  
        android:text="abcd"  
        android:textColor="#000"  
        android:textSize="30sp" />  
  
</RelativeLayout>

Create a Model Class :

public class Data {  
  
    public String name;  
  
    public String getName() {  
        return name;  
    }  
  
    public void setName(String name) {  
        this.name = name;  
    }  
  
    public int getImageId() {  
        return imageId;  
    }  
  
    public void setImageId(int imageId) {  
        this.imageId = imageId;  
    }  
  
    public int imageId;  
  
    Data(String name, int imageId) {  
        this.name = name;  
        this.imageId = imageId;  
    }  
} 

Create RecyclerVIew_Adapter.java

public class RecyclerView_Adapter extends RecyclerView.Adapter<View_Holder> {  
  
    List<Data> list = Collections.emptyList();  
    Context context;  
  
    public RecyclerView_Adapter(List<Data> data, Application application) {  
        this.list = data;  
        this.context = application;  
    }  
  
    @NonNull  
    @Override  
    public View_Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {  
        //Inflate the layout, initialize the View Holder  
        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_layout, parent, false);  
        View_Holder holder = new View_Holder(v);  
        return holder;  
    }  
  
    @Override  
    public void onBindViewHolder(@NonNull View_Holder holder, int position) {  
  
        //Use the provided View Holder on the onCreateViewHolder method to populate the current row on the RecyclerView  
        holder.name.setText(list.get(position).name);  
        holder.imageView.setImageResource(list.get(position).imageId);  
  
    }  
  
    @Override  
    public int getItemCount() {  
        return list.size();  
    }  
} 

  • onCreateViewHolder()- It inflates the row layout and initializes the view holder. It handles findViewById) (methods, find views once, and recycle them so that repetitive calls are avoided.
  • onBindViewHolder()- It uses the onCreateViewHolder() View Holder to fill in the current RecyclerView row with data.
  • getItemCount()- This method returns the collection size which contains the items that we wish to show.
The code file of the ViewHolder Java class is listed below.

import android.view.View;  
import android.widget.ImageView;  
import android.widget.TextView;  
import androidx.recyclerview.widget.RecyclerView;  
  
public class View_Holder extends RecyclerView.ViewHolder {  
  
    TextView name;  
    ImageView imageView;  
  
    View_Holder(View itemView) {  
        super(itemView);  
        name = (TextView) itemView.findViewById(R.id.name);  
        imageView = (ImageView) itemView.findViewById(R.id.image);  
    }  
} 

MainActivity.java class file:

 public class MainActivity extends AppCompatActivity {  
  
    @Override  
    protected void onCreate(Bundle savedInstanceState) {  
        super.onCreate(savedInstanceState);  
        setContentView(R.layout.activity_main);  
  
        List<Data> data = fill_with_data();  
  
        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);  
        RecyclerView_Adapter adapter = new RecyclerView_Adapter(data, getApplication());  
        recyclerView.setAdapter(adapter);  
        recyclerView.setLayoutManager(new LinearLayoutManager(this));  
  
    }  
  
    public List<Data> fill_with_data() {  
  
        List<Data> data = new ArrayList<>();  
        data.add(new Data("Android", R.drawable.c));  
        data.add(new Data("Kotlin", R.drawable.cc));  
		data.add(new Data("Kotlin", R.drawable.ccc));  
        return data; 
    }  
} 


September 22, 20203 minutesauthorPankaj Valani
post

Recently in one of our client's project, we want to load the count of relation in laravel. But we do not want to retrieve original records.

For example,

We have the following Models,

  1. Category
  2. Products
  3. Orders

For that, we have categories, products, orders, order_items table. Where in the order_items table, we got the following fields

  • order_id
  • product_id
  • quantity

So the requirement was, In the Products table, we want to display the total number of orders placed with that item regardless of the quantity in each order. All we need is a number of orders where the product is purchased.

1st way: Query via Relationship

$products = Product::all();
$productsArr = $products->map(function (Product $product) {
    $productObj = $product->toArray();
    $productObj['orders_count'] = $product->orders()->count();
    return $productObj;
});

But the problem with this approach was, we are firing queries to the database for every single product. so if I'm retrieving 100 Products from the database then it will fire 100 additional queries to the database. Imagine if we have thousands of products.

2nd way: Eager Load Relationship and Calculate Count

$products = Product::with('orders')->get();
$productsArr = $products->map(function (Product $product) {
    $productObj = $product->toArray();
    $productObj['orders_count'] = $product->orders->count();
    return $productObj;
});

so this way, we are only firing two queries to the database. But the problem here is, we are loading all the Orders of each product which we don't need at all. so it will consume lots of memory since we are loading lots of orders. so imaging if we retrieve 100 products, and each product has 10 orders, then we are loading 1000 Orders into memory without any need.

3rd way: Use withCount function

The third powerful approach of using withCount function in Laravel. so we refactored our code like,

$products = Product::withCount('orders')->get();
$productsArr = $products->map(function (Product $product) {
    $productObj = $product->toArray();
    $productObj['orders_count'] = $product->getAttribute('orders_count');
    return $productObj;
});

In this approach, we are firing two queries but no Order models are loaded into memory.

4th Bonus: Using in a nested relationship while multiple eager loading

You can even use it with nested relationships. Imagine a case, where you want to retrieve categories along with its products with orders count.

$categories = Category::with([
    'products' => function ($query) {
        $query->withCount('orders');
    },
    'someOtherEagerLoading1',
    'someOtherEagerLoading2'
])->get();
$categoriesArr = $categories->map(function (Category $category) {
    $categoryObj = $category->toArray();
    $categoryObj['products'] = $category->products->map(function (Product $product) {
        $productObj = $product->toArray();
        $productObj['orders_count'] = $product->getAttribute('orders_count');
        return $productObj;
    });
    return $categoryObj;
});

Hope this will help you to retrieve the count of relationship data without retrieving actual relation data.

September 18, 20202 minutesauthorMitul Golakiya
post
Here is part one of How To Grow Your Business - 1

Introduction
You can only develop products and services that are very effective if you pay attention to the needs of your customers and prospects. One way to understand exactly what your customers want is through research and surveys.

8. Create a sales funnel
The first way to grow your business faster is by creating a sales funnel. If you do not have a sales funnel, you are making a big mistake. Sales funnels can help automate your business.
It helps you grow and grow quickly and easily. Sure, there are some front-end functions involved. Is natural. But, once those processes are suspended, it will travel easily from there.

9. Use a customer management system
Manually tracking transactions is difficult. No one wants to do that. It becomes a burden as the business grows. If you want to scale quickly, use a customer management system.

10. Competition research
When going to the market, and you are really looking to get your offer out to the public, you need to research the competition. Frasier says he uses two platforms to do his own research. The first is the same web.

11. Create a customer loyalty program
Loyalty programs are the best way to increase sales. It costs three times more to acquire new customers than to sell something to an existing customer.
Other resources pin this number anywhere from four to 10 times more. However, whichever way you cut it, getting new customers is expensive.

12. Identify new opportunities
Analyze new opportunities in your business by better understanding your demographics. Understand everything from distribution channels to your direct competitors, and also analyze overseas markets and other potential industries.
With the right amount of potential analysis, you are likely to immediately pursue dozens of new opportunities.

13. Create an email list
One of the best and most effective ways to grow a business quickly is to create an email list. Clearly, that means you need to have a lead magnet.

14. Think of the franchise model.
If you have a successful business, and you are trying to grow really fast, consider franchising it. Although franchise costs are high and moving towards a franchise model is complex and it takes a lot in marketing, how can it all make a difference if you are looking for really fast growth.
September 15, 20202 minutesauthorAnkit Kalathiya
post

Recently, we were working in a laravel app where we have a status column in multiple models. We have multiple processes going on for which we have different jobs.

Initially job status will be "Pending", then each job will take one record, change the status to "Running" and process that record, and update the status to either "Completed" or "Failed".

We have constants for each status. Something like below,

static $STATUS_PENDING = 0;
static $STATUS_RUNNING = 1;
static $STATUS_COMPLETED = 2;
static $STATUS_FAILED = 3;

And the problem is, we need to go and define the status in every model that we have (around 10+ models).

Then we have functions to update status and check the status in each model like,

public function markRunning($saveRecord = true)
{
    $this->status = static::$STATUS_RUNNING;

    if ($saveRecord) {
        $this->save();
    }
}

public function isRunning()
{
    return $this->status === static::$STATUS_RUNNING;
}

And above functions existed for each 4 status. so what we did is, we created a common StatusTrait which can be used across multiple models.

Here is the code of StatusTrait that you can find for that.

Then in each model, we use this trait. For e.g.,

class SavePdf extends Model
{
    use StatusTrait;

    .....
}

And then can use any method of trait in all the models,

...
$savePdf = new SavePdf();
$savePdf->markRunning();
...

Or we can check if the status of the model is running or not. For e.g.,

...
if ($savePdf->isRunning()) {
    // logic here
}
...

This is how we have saved tons of writing code and optimized the code. Another advantage is, we can just update the value of any status from one single place.

You can also check this kind of pattern and do something like this.

August 26, 20201 minuteauthorMitul Golakiya
post

Laravel Debugbar is a great package to debug laravel applications while development. But it's not just limited to debugging. You can use it to optimize the performance of your app a lot as well. Like,

  • number of models loaded in a memory
  • number of queries fired with timing
  • memory used and more.

In short, we can have a complete view of what's going on in each request.

But the less known and use feature it gives is the Timeline tab. Where you can see how much time is taken for each request. And more than that, how much time Laravel took to boot up and how much time our other code has taken. Check the below screenshot.

Timeline

Recently we came to the case, where one of our consultation clients' CRM application was taking too much time on the first load. Their developers were not able to spot a problem. They checked queries and other stuff which looked completely good. so we were not sure where the time has been spent by the application.

That's were debugbar came to rescue us. We used its measure function facility by which we can measure the time spent in each of the function wherever we want to use. It gives simply two functions startMeasure and stopMeasure to measure the time spent between these two statements.

so we can put startMeasure in the staring of function and put stopMeasure at the end of the function which will render something like this in the timeline tab.

public function searchClients($department)
{
    \Debugbar::startMeasure("searchClients");

    // logic here

    \Debugbar::stopMeasure("searchClients");

    return $result;
}

Once we put this, we get a time that searchClients is taking. Check the screenshot below,

Timeline

Hope this can help you to figure out what piece of code is taking the time and you can optimize it.

Happy Optimizing :)

August 22, 20201 minuteauthorMitul Golakiya
post

Recently, we have started working on one CRM System for client, where we offer a user to create an account and then can upload his excel file of Contracts and we will create contracts in the database, and then these contracts will be emailed to both the parties of the contract.

For this, the functionality we want is, we do not let users wait to do these all things, because this process may take longer based on the number of records the user has. Also, this process contains lots of computation like,

  1. Upload an Excel file
  2. Do field mappings
  3. Validate the record of contract
  4. Create a contract in the database along with all other information
  5. Create a PDF of contract (which take significant time)
  6. Email that PDF to both the parties.

Just imagine, if the user has uploaded a file with 10K records in a file it will take an hour to do this in a single process.

Here is where we used the Laravel Jobs & Queues where we can let use relax and we do our processing in backend with multiple Jobs running at the same time.

So we came up with architecture with Several Jobs in place with the following things in mind.

  1. We will have multiple Jobs to perform multiple things to have SRP (Single Responsibility Principle)
  2. When the one Job completes its duty, it will dispatch the next Job with the data that next job needs.
  3. The next job will do that same till the process ends

Another advantage we got here is, we can execute different jobs on different machines/servers based on the resources required. For e.g. We run a Job of Creating PDF on a powerful machine then sending an email.

Also, we can set different priorities for different Job Listeners. For e.g. Sending an Email Job will have a lower priority than others.

So here is the architecture that we came up with and used. I tried to architect the Jobs structure only and haven't mentioned small details of updating and creating records.

Implementing Efficient and Fast Data Import with Laravel Jobs & Queues

Hope it will help you to architect you a better Jobs and Queues architecture where you need to perform multiple things on the backend and do not let your users wait to finish those long-running processes.

Happy & Safe Queuing. :)

August 14, 20202 minutesauthorMitul Golakiya