Posts

Showing posts from June, 2015

Access the fields on Quick View Form – Dynamics CRM 2015

Image
Quick view forms in Dynamics CRM 2013 allow you to display all the related entity information. Is there a way to retrieve the field value on Quick View Form using JavaScript without additional OData call to the associated entity? The answer is Yes and here is the sample of the form and JavaScript:   Here is the Following steps to get the value from the QuickView form     Sample Quick Form     Eg: We need to get the attribute value called AccountNumber from QuickForm Step 1: Open the Customization->Entity->Form     Step 2:  Double click the customer pane window to see the properties and note the quickformname,and related entity name.Click Edit.       Step 3:   Our goal is to get the attribute name of AccountNumber.   After Click Edit the following dialog box with Field Properties and note down the attribute name Code: below is the format //QuickFormname_QuickFormname_EntityName_AttributeName if(Xrm.Page.getControl('customerpane_q

Auto Mapper in MVC

Image
Auto Mapper in MVC: When we code for a realistic actual environment, we encounter many challenges to refractor our code for a better understanding and to easily identify the bugs. We mainly focus on re usability and try to move as much code as possible to a common method so that development time and maintenance costs are reduced.          In this article, I will try to cover a new concept in MVC:  AutoMapper is used to reduce the complexity we find when binding the model and communicating with entities. The Real Problem:  We often interact with our database entities and bind our models with it. What we end up with is somewhat like this: // Return UserDTO Class public UserDto GetUserById(string id) { / /Create new Object for DTO class var userDto = new UserDto(); / /Create New Object For Entity(DB class) using(var context = new EntityDBContext()) { // Get the single row from DB using LINQ query

Parse JSON file and insert data into SQL server

Parse JSON file and insert data into SQL server When there any requirement, insert json data into sql server  the following blog will explain step by step to insert the data using sql server Sample JSON :      First I'd restructure the JSON so it made more sense. You said a "person" can have multiple "people", so structure it that way. A "person" has three attributes (i.e. i_date, i_location, and i_summary) and a collection of people. { "person":{     "i_date":"2014-03-20",     "i_location":"test",     "i_summary":"test test",     "people":[       {         "first_name":"first name test1",         "last_name":"last name test1"       },       {         "first_name":"first name test2",         "last_name":"last name test2"       },       {         "first_name": &

Reusable web Part in Sharepoint 2013 using Visual studio

Image
Creation of Webparts and Resuse the User control in Sharepoint 2013    There is small difference in Visual WebPart Sharepoint 2013 and Sharepoint 2010   Overview: SharePoint 2010, there would be a WebPart class and a UserControl Class in a Visual WebPart. The associated UserControl (.ascx) file will be loaded during execution in WebPart class through CreateChildControl Method. Since two different classes are involved, the properties created in WebPart class has to be passed to UserControl Class to make use of those values during execution. But in SharePoint 2013 Visual WebPart, no separate UserControl class is created for the .ascx file and only WebPart class is available. The controls that are placed in ascx file are automatically converted in to c# code and placed in a file with a name [Name of Web Part].ascx.g.cs . This is a partial class of the original WebPart class that is inherited from “ System.Web.UI.WebControls.WebParts.WebPart” class and created in the name of Vi

SharePoint Event Receiver Before Properties,After Properties

Image
Before Properties,After Properties and ListItem in Sharepoint 2010 Event Recievers      Event recievers are common in Sharepoint development so its better to understand the data available in each events. Sometimes as a developer we jump into coding before thinking about contextual data availability.One more imprtant thing to notice list event reciever  and document libraray event reciever are different interms of contextual data avaialability.Following Table will give you a clear picture about the contextual data in each events.