Tuesday, June 26, 2018

How to solve contact can not remove from skype for business?

after some team mate or colleagues left the team, we might just keep their contacts in our skype contact list. eventually the contact will be displayed as unavailable, when we try to remove them from the list. we click on the confirmation button, but the contact never have been able to removed from list.

the quick solution is very easy and quick.

First  we need to completely exit from Skype applicatio.

Second  launch the outlook portal in light mode

https://outlook.office365.com/owa/?exsvurl=1&layout=light 

 Third click on the Contact Folder on the left navigation panel


Four. Type in contact name in the filter textbox, then select it and delete, then re-launch your Skype for business, we will see those contacts should be all gone.


Monday, March 5, 2018

how to dynamically add and remove the Canada Post autocomplete in Javascript?

it is quite easy to enable the canada post autocomplete, we just need to follow the sample from Canada post autocomplete.

here is the sample code to initialize the Canada post autocomplete to a textbox with id "street-address"

 enableCanadaPostAutoComplete = function () {
        var fields = [
            {
                element: "street-address", field: "Line1"
            },
            {
                element: "street-address2", field: "Line2",
            },
            {
                element: "city", field: "City", mode: pca.fieldMode.PRESERVE
            },
            {
                element: "province", field: "ProvinceCode", mode: pca.fieldMode.POPULATE
            },
            {
                element: "postal", field: "PostalCode", mode: pca.fieldMode.PRESERVE
            },
            { element: "country", field: "CountryIso3", mode: pca.fieldMode.COUNTRY }
        ],
            options = {
                key: sci.CanadaPostKey,
            };

        control= new pca.Address(fields, options);
    }

if you want to remove the Canada post autocomplete feature from the input textbox, then i will show how make it work around

var canadaPostAutoCompleteControl = canadaPostAutoCompleteControl || {};

enableCanadaPostAutoComplete = function () {
        var fields = [
            {
                element: "street-address", field: "Line1"
            },
            {
                element: "street-address2", field: "Line2",
            },
            {
                element: "city", field: "City", mode: pca.fieldMode.PRESERVE
            },
            {
                element: "province", field: "ProvinceCode", mode: pca.fieldMode.POPULATE
            },
            {
                element: "postal", field: "PostalCode", mode: pca.fieldMode.PRESERVE
            },
            { element: "country", field: "CountryIso3", mode: pca.fieldMode.COUNTRY }
        ],
            options = {
                key:  myCanadaPostKey,
            };

        canadaPostAutoCompleteControl = new pca.Address(fields, options);
    }


disableCanadaPostAutoComplete = function () {
        if (canadaPostAutoCompleteControl) {
            canadaPostAutoCompleteControl.destroy();
        }
    }

you can call disableCanadaPostAutoComplete in the click event.

Friday, March 2, 2018

How to fix "Could not load file or assembly or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" error in web publish deployment in Windows 8?

I had to make a deployment on the new branch which was branching from the original project. it is working fine that i published the web to the server in the original branch. However i encountered an error

"SGEN : error : Could not load file or assembly 'file:///C:\Users\ddeng\Documents\\bin\HiQPdf.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"



 When i check the folder, the HiQPdf.dll file did exist in the folder. the root cause of this error is that those third party DLL had been locked by Windows 8 due to security concern.

we have to unlock it to allow the publish action to move the dll to the destination folder.

please follow the steps to fix the issue.

1. right click to get properties 



2 in the properties there was a button UNBLOCK, click on the Unlock button and applied the change.




try to rebuild again. you will see your publish go through suceessfully.



Friday, February 23, 2018

How to fix New Promise not support in IE browser issue?

we can use New Promise function to write asyncronization call to improve the application performance.

here is sample call to use the New Promise feature from ES6/Javascript

loadLanguage: function () {
                   return new Promise(
                        function (resolve, reject) {
                            var PreferredLanguages = [{ Description: "English", Code: "en" },
                             { Description: "French", Code: "fr" }];
                            dataViewModel.preferredLanguages(PreferredLanguages);
                            if (PreferredLanguages) {
                               
                                resolve(PreferredLanguages);
                            }
                            else{
                                reject("no Language load");
                            }
                        }
                    );
            },


however this feature is currently not support by all browser which it does not work in IE11 and below.

fortunately we still can make it work around with $.Deferred from JQuery

the code below will demonstrate the same result as the previous code within  new Promise constructor.

 loadLanguage: function () {
                var deferred = $.Deferred();

                var PreferredLanguages = [{ Description: "English", Code: "en" },
                { Description: "French", Code: "fr" }];
                dataViewModel.preferredLanguages(PreferredLanguages);
                if (PreferredLanguages) {

                    deferred.resolve(PreferredLanguages);
                }
                else {
                    deferred.reject("no Language load");
                }
                return deferred.promise();
            },