What is IoC?
The literal meaning of IoC is "Inversion of Control". You can get an idea from this is that in general IoC is related to invert the controls or responsibilities.
Technically IoC means that the main class does not depends upon the concrete implementation of other class instead of this it should depend upon the abstraction of that class. IoC invert the control/responsibility to other entity.
Lets explain this with an example. Lets suppose we have an Entertainment Management Committee (EMC) in an organization. EMC is responsible to arrange different types of events in that organization.
Tech Talks
Thursday, February 22, 2018
Friday, August 7, 2015
Get Power Shell ISE ready to run scripts
Step 1: Installing Latest Version (3.0) of Power Shell ISE
Go to Microsoft Download Center "http://www.microsoft.com/en-us/download/details.aspx?id=34595" and download Power Shell ISE 3.0 for windows 7. It is shipped with Windows 8 and Windows Server 2012 by default.
Step 2: Set Execution Policy
Then, you have to set execution policy to "Unrestricted" to run any script and to get intellisense during command writing in power shell.
Command: "Set-ExecutionPolicy -ExecutionPolicy Unrestricted"
Go to: https://technet.microsoft.com/en-us/library/hh847748.aspx for detailed explanation.
Conclusion
Now after performing above mentioned steps, you are ready to execute any power shell command using power shell ISE.
Tuesday, May 5, 2015
Media Library Browser Thumbnail Issue in Sitecore 7.2
Hi,
In my previous blog post Time Format Issue in Sitecore 7.2 rev. 140526 (Lucene Index Search), I have given solution to fix date time format bug in sitecore 7.2. But when ever sitecore speak api will parse date time string it will give error because we have changed date time format to (yyyyMMddHHmmss).
The problem statement is We have to change speak api parsing format from default "yyyyMMdd" to "yyyyMMddHHmmss"
To resolve the Media Library Browse button issue please follow these steps:
In my previous blog post Time Format Issue in Sitecore 7.2 rev. 140526 (Lucene Index Search), I have given solution to fix date time format bug in sitecore 7.2. But when ever sitecore speak api will parse date time string it will give error because we have changed date time format to (yyyyMMddHHmmss).
The problem statement is We have to change speak api parsing format from default "yyyyMMdd" to "yyyyMMddHHmmss"
To resolve the Media Library Browse button issue please follow these steps:
- Place the attached UpdatedFacetProvider.dll file into the /bin/ folder of your CMS.
- Open the your CMS sitecore in web browser. Login using admin credentials in desktop mode and change data base to Core.
- Open Content Editor and go to item path /sitecore/client/Applications/Dialogs/SelectMediaDialog/PageSettings/Facets/Uploaded
- Replace the value of "FacetProviderType": Sitecore.ItemWebApi.Facets.UpdatedFacetProvider,Sitecore.Speak.ItemWebApi with this one: UpdatedFacetProvider.UpdatedFacetProvider,UpdatedFacetProvider
- Rebuid the indexes and try to reproduce the issue
After following the steps above, the Media Library search browser should display the media items and the Web API errors should go away as well.
Happy programming and let me know if you face any problems or bug in this fix.
Please remember this fix must be applied after solving date time format bug mentioned in my previous Post
Monday, May 4, 2015
Time Format Issue in Sitecore 7.2 rev. 140526 (Lucene Index Search)
Hi,
Sitecore 7.0 - 7.5 have a bug in it regarding DateTime. It will not store or retrieve time part from date. The following solution will target this DateTime Format bug in Sitecore version 7.2 until Sitecore will ship fix.
The problem statement is "Currently Sitecore does not provide Time Stamp in DateTime Fields".
In my case: I am trying to get latest items from sitecore using lucene index search.The default date format is "yyyyMMdd" but my requirement is "yyyyMMddHHmmss"
Please follow the steps below to solve this issue.
Step 1:
Make a web config file in my case DateTimeFormat.config. Copy paste following code in it
Make a folder "DateTimeFormat" in website App.Config/Include and copy this file in the newly created folder.
Step 2:
In Visual Studio make a new project "CustomDateTimeFormat" of type class library. Create a class "DateTimeFieldReader" inherit it from "FieldReader". Copy paste follwoing code
This class will be called when ever user will publish sitecore items or rebuild index in sitecore. This class format the datetime fields according to the IndexDateFormat provided in web.config file above.
Step 3:
Create another class with the name "DateTimeConverter" inherit it from "System.ComponentModel.DateTimeConverter". Copy paste following code
This class will convert the date time in the format provided in web.config file when ever an item will be accessed.
Conclusion:
This will fix the date time format issue in search index of sitecore 7.2 but will produce another bug in Sitecore.
Sitecore has introduced speak api in 7.0 and above. This will get some items from search index in sitecore like when ever you open an media library by clicking "Browse" link on any Image Field. It will fetch images thumbnails from search index. So, we have changed date format and we have to tell sitecore speak api to parse date format according to our new format "yyyyMMddHHmmss" because its default format is "yyyyMMdd". Other wise it will give date time parse error like "String was not recognized as a valid DateTime"
For solution click on Media Library Browser Thumbnail Issue in Sitecore 7.2
Sitecore 7.0 - 7.5 have a bug in it regarding DateTime. It will not store or retrieve time part from date. The following solution will target this DateTime Format bug in Sitecore version 7.2 until Sitecore will ship fix.
The problem statement is "Currently Sitecore does not provide Time Stamp in DateTime Fields".
In my case: I am trying to get latest items from sitecore using lucene index search.The default date format is "yyyyMMdd" but my requirement is "yyyyMMddHHmmss"
Please follow the steps below to solve this issue.
Step 1:
Make a web config file in my case DateTimeFormat.config. Copy paste following code in it
Make a folder "DateTimeFormat" in website App.Config/Include and copy this file in the newly created folder.
Step 2:
In Visual Studio make a new project "CustomDateTimeFormat" of type class library. Create a class "DateTimeFieldReader" inherit it from "FieldReader". Copy paste follwoing code
This class will be called when ever user will publish sitecore items or rebuild index in sitecore. This class format the datetime fields according to the IndexDateFormat provided in web.config file above.
Step 3:
Create another class with the name "DateTimeConverter" inherit it from "System.ComponentModel.DateTimeConverter". Copy paste following code
This class will convert the date time in the format provided in web.config file when ever an item will be accessed.
Conclusion:
This will fix the date time format issue in search index of sitecore 7.2 but will produce another bug in Sitecore.
Sitecore has introduced speak api in 7.0 and above. This will get some items from search index in sitecore like when ever you open an media library by clicking "Browse" link on any Image Field. It will fetch images thumbnails from search index. So, we have changed date format and we have to tell sitecore speak api to parse date format according to our new format "yyyyMMddHHmmss" because its default format is "yyyyMMdd". Other wise it will give date time parse error like "String was not recognized as a valid DateTime"
For solution click on Media Library Browser Thumbnail Issue in Sitecore 7.2
Monday, June 4, 2012
Debit vs Credit
Debit is the left side of accounting statement and Credit is the right side of accounting statement.
By debit we mean something comes inside the organization and by credit we mean, something goes outside the organization. That means debit means inflow and credit means outflow.
For Example, we write Accounts Recieveable at, cash in hand, cash at bank, and assets at the left side of accounting statement as debit and write Accounts Payable, Bonds Payable, Bills Payable and other liabilities at the right side of accounting statement as credit.
Debit and credit are the two aspects of every financial transaction. Their use and implication is the fundamental concept in the double-entry bookkeeping system, in which every debit transaction must have a corresponding credit transaction(s) and vice versa.
Wednesday, March 3, 2010
How to Get Parent Window in Jquery
Consider the following script:
$("#btn").click(function(){
window.opener.$("#chk_accept-terms").attr("checked","checked");
window.close();
});
The above code first check the check box present on parent window ( window that open the popup or child window) and then close the child window.
How to perform some functionality on form OnLoad event
When creating new task we want to perform following two activities.
- Change the default duration from 30 minutes to blank.
- Auto-populate today’s date into the Due Date field.
These two changes might seem simple at first, but digging deeper into the details of these two fields reveals some obstacles to make these changes. Because the Duration field looks like a picklist field, you would expect to be able to just change the default value by editing the Duration attribute of the Task entity. However, even though the Duration field appears to be a picklist, it is actually a special field used on various activities in Microsoft CRM. For these special fields, you can not set a default value (or add picklist values) like you can for normal picklist fields.
In addition to the Duration field nuance, DateTime attribute data types do not have a default value. Since the Due Date field uses the DateTime data type, we can’t use the attribute editor to specify today’s date as the default value in the Due Date field.
Despite the two problems we just outlined, we can easily meet the customer’s request to change the default task form by leveraging the form OnLoad event of the task entity’s form.
To accomplish this we will add a simple script to the form OnLoad event and Microsoft CRM will run our script everytime a user opens the task form. When it runs, our script will programmatically change the value of the Duration and Due Date fields to the values we specify
Procedure: Using the Form OnLoad Event to Default Task Duration and Due Date
1. Navigate to Settings -> Customization -> Customize Entities. Double click the Task entity. The
entity editor will appear.
entity editor will appear.
2. Click Forms and Views. Double click Form. The form editor for the task entity will appear.
3. Click Form Properties and the editor window will appear. From here, you see that you can choose to add a script to the form OnLoad or OnSave event.
| 4. | Select OnLoad and click Edit. The Event Detail Properties window will appear. In this window, enter the following code:var CRM_FORM_TYPE_CREATE = 1;
var CRM_FORM_TYPE_UPDATE = 2;
switch (crmForm.FormType)
{
case CRM_FORM_TYPE_CREATE:
crmForm.all.actualdurationminutes.DataValue = null;
crmForm.all.scheduledend.DataValue = new Date();
break;
case CRM_FORM_TYPE_UPDATE:
// do nothing
break;
}
A quick review of this code shows that Microsoft CRM allows us to programmatically set the values on the form using javascript. This code sets the actualdurationminutes field (the schema name for Duration) to NULL, which means the same as blank. It also sets the scheduledend field (the schema name for Due Date) to today’s date using the javascript Date( ) function. The OnLoad event will run this script everytime a user opens a form, but remember we only want to set the default values when users create a new task. Therefore, we added the cases so that our script only runs for the form type of 1. Microsoft CRM assigns a form type value to each form (1-Create, 2-Update, 3-Read Only, etc.) so that you can tie this information into your scripts just like we needed in this example. In this script, if the form type is 2 that indicates it is an update form so we don’t alter the Due Date and Duration field values. 5. After you enter the code, click the Event is enabled checkbox. This box indicates whether or not Microsoft CRM should run your script when it fires the OnLoad event. The screen should look like this: |
| 6. Next we’ll setup the Dependencies related to our code to make sure that no one accidentally removes the Duration or Due Date field from the task form (because our script would generate an error if those fields were missing). Click the Dependencies tab. 7. You’ll see two columns: Available Fields and Dependent Fields. The Available Fields column lists all of the fields that appear on the task form. To make Due Date and Duration Dependent Fields, select those values in the left column and then click the ">>" button. Microsoft CRM will move those fields into the Dependent Fields column. |
| . | |||
| 8. Click Ok. You should be back on the task form editor now. | |||
| 9. Next we want to use the form preview feature to test the code we just added. Before you try preview, make sure you save the changes you made by clicking the Save button.
| |||
XRM
XRM is the official positioning of the platform components underlying Microsoft Dynamics CRM. While the "C" is equal to customer in CRM, "X" is equal to ANY relationship that needs to be managed, such as vendors, employees, prospects, dealers, as well as other types of business relationships including properties, assets, projects, grants, legislation, etc. The flexibility of the XRM platform components enables it to be leveraged in a wide variety of ways by many different organizations.
Why XRM?
Most organizations meet their business process automation needs through the development of custom applications or the acquisition of packaged applications. Often times these solutions do not fulfill every business requirement. Custom applications can be extremely expensive to develop and maintain. Research has identified that it will cost a company from seven to ten times more to develop a particular functionality than to purchase comparable functionality. The costs and risks associated with developing highly specialized line-of-business are truly prohibitive. Packaged applications, while easy to deploy, do not fit the business and can be very difficult to change once they are deployed. XRM offers an alternative and the best of both worlds; it accelerates the creation of LOB applications, and it makes it easy to modify existing applications in response to ever-changing business needs.
XRM can help enterprise organizations bridge the gap between packaged and custom applications. Short and long term benefits make XRM a feasible strategic alternative. With XRM the IT Department delivers speed, business fit and business agility. In the short term the IT Department can rapidly respond to a request for an application, on-time and on-budget.
And over time, the IT Department can deliver multiple business applications, all built on a common platform, helping them meet diverse and ever changing business needs across the organization while minimizing the time and costs associated with infrastructure, maintenance, support, integration, modifications and customizations.
Benefits of XRM
XRM is a business application platform layer that sits on top of – and leverages the power of – the Microsoft Application Platform technology building blocks (Windows, SQL Server, .NET, and Office) and is designed to significantly accelerate the creation of enterprise-class relational business applications by providing IT professionals with reusable ‘application services’ that can be rapidly adapted to fit the unique needs of users and businesses through point & click. Key value areas include:
- Familiar Microsoft technologies give end-users a consistent experience across all applications (Office/Outlook) and provide IT professionals with technology they know (SQL Server, Windows, .NET).
- Power of choice ensures organizations get and use XRM the way they need it. Whether it be on-premise or on-demand, subscription or license, Outlook or web, the power of choice ensures it fits customers environment and budget.
- Enterprise-class capabilities through highly scalable multi-tenancy for efficient management of multiple large-scale applications in a single environment
- Point & click customization allows each application to be completely built (relational data model, process automation, user experience…) and maintained through a point & click interface.
Tuesday, March 2, 2010
How to change new_ prefix to your OWN
Navigate to Settings -> Administration -> System Settings and you'll get this dialog:
In this dialog you can see the Prefix text box. Enter your own prefix to replace the default "new" prefix.
In this dialog you can see the Prefix text box. Enter your own prefix to replace the default "new" prefix.
Subscribe to:
Posts (Atom)