How to Delete Shared CRM View from database

CRM View

Microsoft CRM is very dynamic platform, it is helping collaborate and interact with team members by using the system. one of the cool features on Microsoft CRM, you can built View and share it with other team members.. But what happen, if you don’t want to see this view anymore and you don’t have control to remove it!

Because of the nature MS CRM dynamicity, there will be a challenge to figure out and delete the sharing metadata.

The good side of this, all metadata is stored in the MS CRM database, thus you can manage that by updating database. I would like to highlight here, this is not recommended by Microsoft and you can do it in case you ran out of options but there is no guarantee from Microsoft this is will be working for you as well. I personally tried couple of times and worked fine with me.

I’m strongly recommend to take backup of your database before applying this change, so you have a backup point in case something went wrong.

DECLARE @userId UNIQUEIDENTIFIER = 'User ID whom have the view shared'

update PrincipalObjectAccess
set AccessRightsMask = 0  --Remove sharing
where PrincipalObjectAccessId in(

  select  poa.PrincipalObjectAccessId
  from PrincipalObjectAccess      poa
     inner join FilteredSystemUser u 
        on u.systemuserid = poa.PrincipalId
     inner join UserQuery uq 
        on uq.UserQueryId = poa.ObjectId
  where 
        poa.ObjectTypeCode = 4230
     and u.systemuserid = @userId
     and uq.Name in( 
        'Target View Name to remove it'
        )

 )

How to Send an Email in C# using gmail

Send an Email

It is becoming common these days to send an email from your application to specific list of users. Usually this is to notify users or administrators of certain action happened. As example of this, Notify administrator if an error happened in certain module, or notifying manager to approve/decline a request.

Thankfully, sending emails from .net applications (desktop or web) is becoming easy task to accomplish. Here is a sample code that utilizing gmail smtp to send an email. You can use the same steps to send email from outlook.com or office365.com, you will need to change the configurations in emailSettingInfo object

public void SendEmail()
{
    string sender, recipient, ccList, bccList, smtpSenderPassword;
    //Prepare SMTP Setting
    var emailSettingInfo = new
    {
        SmtpSenderEmail = "<<Sending Email Address Goes here>>",
        SmtpSenderPassword = "<<Sending Email Password Goes here>>",
        SmtpClientHost = "smtp.gmail.com",
        SmtpPortNumber = 587,
        SmtpEnableSsl = true
    };

    //Get the Email body ready
    var emailInfo  = new {
        ToEmailAddress = "<<Your email goes here>>",
        Subject = "Send Email from C# Code",
        Body = "Hi, this is a test email",
        CcEmailAddress = "<<CC List>>",
        BccEmailAddress = "<<Bcc List>>",
    };

    sender = emailSettingInfo.SmtpSenderEmail;
    recipient = emailInfo.ToEmailAddress;
    smtpSenderPassword = emailSettingInfo.SmtpSenderPassword;

    //Intialise Parameters  
    SmtpClient client = new SmtpClient(emailSettingInfo.SmtpClientHost);
    client.Port = emailSettingInfo.SmtpPortNumber;
    client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
    client.UseDefaultCredentials = false;
    System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(sender, smtpSenderPassword);
    client.EnableSsl = emailSettingInfo.SmtpEnableSsl;
    client.Credentials = credentials;
    try
    {
        var mail = new System.Net.Mail.MailMessage(sender.Trim(), recipient.Trim());

        mail.Subject = emailInfo.Subject;
        mail.Body = emailInfo.Body;
        mail.IsBodyHtml = true;
        if (!string.IsNullOrEmpty(emailInfo.CcEmailAddress ))
        {
            ccList = emailInfo.CcEmailAddress;
            foreach (var email in ccList.Split(";".ToArray()))
            {
                mail.CC.Add(new MailAddress(email));
            }
        }

        if (!string.IsNullOrEmpty(emailInfo.BccEmailAddress ))
        {
            bccList = emailInfo.BccEmailAddress;
            foreach (var email in bccList.Split(";".ToArray()))
            {
                mail.Bcc.Add(new MailAddress(email));
            }
        }

        client.SendCompleted += (s, e) => {
            client.Dispose();
            mail.Dispose();
        };

        client.Send(mail);//send the email
                
    }
    catch (Exception ex)
    {
        //Do Erorr Handling logic
    }
}

Angular PDF Viewer Component

You may come over a requirement to view PDF within your Angular 5+ application. Building that from scratch might be a time and effort consuming task. Thanks to ng2-pdf-viewr component, it is providing the developers with a ready made component that you can import into your Angular project and start using it in very easy way.

In my case scenario, The PDF Viewer latest version (7.0.1) didn’t work and it was giving me compilation issues whenever I’m try to compile my application. So I had to use an older version in my Angular project (I used version 6.4.1). By using the 6.4.1 version, I overcome the compilation issue.

I order to use the ng2-pdf-viewer, it is basically consist of few steps:

  • Install the component to be part of your project
npm i ng2-pdf-viewer@6.4.1  --save
  • Compile your application to make sure new component will be compiled successfully
  • Add PDF Viewer module to your module class
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';

import { PdfViewerModule } from 'ng2-pdf-viewer';

@NgModule({
  imports: [BrowserModule, PdfViewerModule],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})

class AppModule {}

platformBrowserDynamic().bootstrapModule(AppModule);
  • Add PDF Viewer html tag to your html page and make sure the pdf URL is pointing to a valid pdf file.
import { Component } from '@angular/core';

@Component({
  selector: 'my-poc-app',
  template: `
  <pdf-viewer [src]="pdfSrc"  style="display: block;" ></pdf-viewer>
  `
})
export class MyPOCComponent {
  pdfSrc = "https://blog.smartdigitizers.com/wp-content/uploads/TestPDFFile.pdf";
}

References:

https://www.npmjs.com/package/ng2-pdf-viewer/v/6.4.1
https://www.npmjs.com/package/ng2-pdf-viewer

Top 5 Reasons Why CRM is Important for Businesses

CRM Dashboard
Sample MySpace365 Dashboard

Customer Relationship Management (CRM) systems are becoming more important to overcome the operation issues and getting satisfied customers. I’m listing below the top 5 reasons why I believe you need to have CRM system in place.

  • Client Management
    CRM system helps you to get more visibility into your client base, ponder the tactics needed for long-term profitability, and formulate better plans that impede your staff to break new operational ground.
  • Profitability Tracking
    They no longer need to worry about tracking every cent of revenue and focusing on shipping costs, product discounts, and client returns. Revenue calculations will be a matter of reporting issue on the CRM. Also tracking your client invoices and payments will be within the CRM system. It will also be providing notification tool for you to make sure you are collecting payments in timely manner.
  • Regulatory Compliance
    This is a winning approach in the long term, especially when it helps you comply with your country rules and industry standards. You can instruct the CRM to flag a high-risk client or generate the relevant documentation based on the client’s risk score.
  • Sales Strategy
    As a business owner, the last thing you want is to lose income by targeting the wrong customer segment. Client administration programs can provide you valuable intelligence about long-term sales trends, helping you adjust the existing corporate sales strategy and results tactics, which is ultimately will turn into more revenue coming in the pipeline.
  • High Customer Satisfaction Rate
    CRM can improve a company’s customer service practices, helping employees respond to clients’ queries quickly and effectively. The CRM enables your company to understand what it takes to build an effective customer outreach policy and boost sales. Before selecting a customer tracking program, make sure it fits your company’s operating processes, industry, revenue cycle, and customer base.

While keep in mind the best CRM practices, Smart Digitizers is offering a cloud-based CRM System; MySpace365. I encourage you to read more about it and reach out to them to get better understanding of how this can fit into your needs.

flutter doctor –android-licenses gives a java error

After installing flutter on my development environment, I face flutter doctor android license issue while I was checking the installation with below command:

flutter doctor --android-licenses
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 5 more

That was not the expected result as I follow the installation instructions step by step documented on flutter official site.

I could successfully fix the issue by simply install install Android SDK command line tool from the Android SDK Manager, in order to do that, follow the below steps

  1. Start Android Studio
  2. Go to Tools > click on SDK Manager
  3. From the left-hand side choose, Appearance & Behavior then System Settings then Android SDK
  4. from the tabs, Select SDK Tools 
  5. Check Android SDK Command-line tools 
  6. click ‘apply’.

Below screenshot is showing the settings popup (I have dark theme on Android Studio)

Android Studio – Settings popup

If you are still facing issues after applying above steps, consider upgrading JDK to the latest. here is the Java official upgrading JDK 8 (latest at this moment)

Microsoft announced the born of new baby; the Windows 365 Cloud PC

Recently Microsoft announced the born of Windows 365 to be early August 2021; It is the Cloud PC version of Windows OS that is dominant over the years. I believe this is will change the whole game in the hybrid working environment

COVID-19 pandemic enforce business to start thinking of the remote working as the best option to overcome the health issues.. Organizations everywhere have transformed themselves through virtual processes and remote collaboration. The ability to work whenever, however, and wherever it’s needed has become the new normal. Everyone want to have working environment that has technologies that’s familiar, easy to use and easy to access. Hybrid working environment becoming the key to success. Microsoft announcing Windows 365; the Cloud Windows version with almost the same experience as Windows 10 or Windows 11. This will be great empowering tool for businesses to move on the Hybrid working model.

Full Windows experience in all devices.. just like what we used to have.

With this great hybrid work paradox, leaving organizations around the world with multiple options to decide how to get connected in a hybrid world and provide the employees with the needed access to organization’s resources from anywhere. All what they need is to have internet connection.

From my point of view; I can tell that the Cloud PC (Windows 365) is a great technology feature that will change the game. Having a secure full version of windows 10/11 experience will enhance and empower the workspace, regardless of the workforce location or devise.

One of the great features is that you can stream all of your personal apps, tools, data and settings from the cloud across virtually all devises including iPad, Mac and android devises.

Familiar tools

I always say, Simplicity is the key to success. Windows 365 have that in hart of the design principles. Microsoft promise us that we can apply the management and security policies to the Cloud PCs in easy way. Also you can monitor the Cloud PC performance and processing power, and easily find the Cloud PC that is not working with best performance needed.

Zero Trust Powering the Cloud security

Per Microsoft, The Cloud PC architecture has been built while keeping in mind the best security practice; Zero Trust architecture, Windows 365 also helps solve for today’s critical security challenges by design, storing and securing information in the cloud, not on the cloud device itself.

Microsoft built Cloud PC specific Security baseline for quick start, you can alter these security policies later on to fit you needs but we wouldn’t recommend doing that without a solid understanding of the side effect turning off these features. Windows Defender is a built-in software into the Windows 365.

The Security baseline provided by Microsoft It not only protects your Cloud PCs, but also gives you security recommendations to lower risks, and helps you quickly find out and troubleshoot any security incidents.

Learn more information about Windows 365

References:
1. https://www.microsoft.com/en-us/microsoft-365/blog/2021/07/14/introducing-a-new-era-of-hybrid-personal-computing-the-windows-365-cloud-pc/

How to Implement Keyboard Shortcuts for your Web Application

In order to increase the user productivity and efficiency while using your web application, you might ended up implementing some sort of keyboard shortcuts. This will enable the end user to use the keyboard to do some actions or to navigate to certain pages without the need to use the mouse.

Implementing keyboard shortcuts in Angular is pretty simple thing. Basically you will need to decorate your Angular event handler method with HostListener attribute.. yes, that’s it. Here is a code sample that will show how to let the user using F10 to save the record

import { Component, HostListener } from '@angular/core';
export class AppComponent {
constructor() {
}

@HostListener('window:keydown.f10', ['$event'])
showPinned(event: KeyboardEvent) {
   event.preventDefault();
   alert('F10 pressed');
   this.save();
}
@HostListener('window:keydown.control.p', ['$event'])
pinRecord(event: KeyboardEvent) {
   event.preventDefault();
   alert('Ctrl+P pressed');
   this.saveRecordIntoHistory();
}
save() {
   //Implement Saving Logic here.
}
saveRecordIntoHistory () {
   //Implement Saving Record into History Logic here.
}
}

References

I built this article based on below references

  1. https://angular.io/api/core/HostListener 
  2. https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault 

How To backup MySQL DB on Windows severs

Backing up database is essential to eliminate the risk of losing data whenever there is a hardware failure or software issues. In this post, I’ll be showing the possible ways to create backups for MySQL databases.

In fact, There are several ways to Backup MySQL databases, you need to evaluate each one and select the best fit into your needs. I’ll list the possible ways, but I’ll be focusing on the data dump approach.

Types of MySQL backups:

  1. Logical: By using MySqldump utility, you will be able to create a data dump of your database. The Expected output is a .sql file that has all insert statement needed to re-create the database again.
  2. Physical: by coping the actual database files into another location. – This approach usually is recommended for huge databases as it is faster to do the backup and faster to restore in case of any failure. The limitation of this approach, is restoring the database has to be on the similar hardware as the original one.
  3. Partial: Partial backup is meant to have a backup of single table. This is usually useful when you wat to do a bulk operation on that table and you want to create a restore point in case of any failure happened.

For the purpose of this article, I’ll be focusing on the first option; Logical Backup. It is the easiest way as well as it is using a built in tool called mysqldump. This utility tool is being shipped with MySQL engine, Thus it will be installed by default on your MySQL Server. – So no third party tool needed.

You can create a .bat file to do the backup and get benefits of the built-in Windows Task Scheduler to have the backup done on daily basis. Let’s dive into it.

  • Creating backups for all databases on my MySQL engine:
mysqldump --user=root --password=******* --result-file="C:\MySQLdump.sql"  --all-databases

On this command line, you are telling mysqldump utility to have a backup of all databases and store it on the C:\MySqlDump.sql file. If you open the result file in any texts editor, you will find a normal sql statements to insert the data.

  • Creating Backup for a single database:
mysqldump --user=root --password=******* --result-file="C:\MySQLdump.sql"  --[DbName]

it is the same command as all databases, but you need to replace the all-databases option with the name of the database that you are looking for backing it up.

Advantages of using data dump approach over other options:

  1. You are not limited to specific MySQL version. The output of this dump, is normal SQL CRUD operations which means all what you need to do is to connect to the new MySQL engine and execute the datadump file.
  2. You can edit the datadump file in case you are looking to do few tweaks before executing it again.
  3. No 3rd party tools are needed. The MysqlDump.exe tool is built in utility and will be installed within MySQL installation.

For more information about mysqldump, please see the MySQL related documentation here

JQuery/JavaScript: how to split string based on Caps letter

In certain cases, you might got a need to change a string content in order to display it in more human readable format. recently I faced a need where I need to tokenize a string based on caps letter and add spaces between words

Using the built-in RegEx feature on Javascript, you can split the string and tokenize it based on the capital letters on the string. For example if you would like to split the string “TestStringValue” to be “Test String Value” you can simply use the following syntax:

/*split string based on Cap letter, then joins the resulted array elements with space between each array entry*/
split(/(?=[A-Z])/).join(" ") 

to try it, use the following code:

alert(  window.prompt("Tokenize String: ", "TestStringValue").split(/(?=[A-Z])/).join(" ")  )

Why do I need CRM Software

CRM like never before

More businesses adopting the hybrid working style and mixing having employees on the office and working remotely. The nature of this model putting more pressure on management on how they will be managing businesses, team, customers and making sure they are doing really good job on that. Google, Microsoft and other giant software companies are moving into the hybrid model. But to be able to move to hybrid model or the remote-working model, you need to make sure that you have the right tools to empower employees and get the best out of them.

Being lucky and select the right CRM system (customer relationship management ) can empower your business like nothing else. Storing and managing customer and prospect information, will help your marketing team find new customers faster by boosting your lead generation speed. Ultimately, this will make you closing more deals and winning more customers. It will definitely make your customer happier and more satisfy with your service with integrating your help desk solution with CRM.

Being customer-oriented will be easier while having the right CRM solution and you will never lose the precious information. It will keep the whole team on the same page about the customer status and needs.

There are so many benefits of using CRM on your day to day business, with MS365 CRM, we built-it while keeping in mind the needs for you and your customers and we built it to be customer-oriented. Adopting MS365 CRM will help you:

  1. Being on top of your Massive lead generation and never miss any.
  2. Store and retrieve customer information like never before. You will not need anymore to depends on your memory or on your notebook to store customer information. It is all on the cloud.
  3. Managing teams remotely and easily
  4. Better customer service and better customer satisfaction.
  5. Build a long term customer relationship
  6. Generate reports that will help you making data analysis.
  7. Utilizing built-in dashboards that is helping you taking decisions based on data-points.

in order to get the most benefits of CRM, you need to have it customized and tailored to your internal process. There are general rules and processes that all businesses have in place but there will be some variance per each industry and business needs. It worth to mention that MS365 is a customizable CRM solution that our team can help you customizing it and making sure it is fitting into your business needs.

The main information about MS365 will be found on the this link http://crm.myspace365.com also you can send a contact us message and the CRM team will be contacting you within 1 business day.