Wednesday, July 15, 2015

An Idea!

Consultancy
Presales
Sales 



#AW CRM Consultant Maison Consulting & Solutions

Monday, July 13, 2015

Implement Business Logic on Lead Disqualify

Whenever you disqualify the lead it save the Lead form, so you can have  JS registered on save event to check if user initiated action to disqualify lead
In this case you need to check for savemode() equal to 15 on save event of lead

In the save event you can use the execution context object getEventArgs method to retrieve an object that contains methods you can use to manage the save event.


execObj.getEventArgs().getSaveMode()

EntityEvent ModeValue
All
Save
1
All
Save and Close
2
All
Save and New
59
All
AutoSave
70
Activities
Save as Completed
58
All
Deactivate
5
All
Reactivate
6
User or Team owned entities
Assign
47
Email (E-mail)
Send
7
Lead
Qualify
16
Lead
Disqualify
15

Wednesday, July 8, 2015

Prevent Delete on Desired Condition - CRM 2013 Plugin


Scenario: XYZ Pvt Ltd, wants to implement business logic of Delete prevention if value of Is Delete Field is No on Opportunity Entity. CRM 2013 will prevent deltetion of record if value of Is Delete Field is set to No and vice versa. 


Work Around: We have added a custom field on Opportunity Entity with Display name 'Is Delete' & Schema Name 'IsDelete'.

Solution: Below is the CRM 2013  Prevent Delete Plugin code.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Crm.Sdk.Messages;


namespace PreventAccountDelete
{
    public class Class1:IPlugin
    {

Monday, July 6, 2015

XRM - Move to Next Stage in Business Process Flow

Here is the XRM code to move to next stage in Business Process Flow on desired condition. Add this code on ribbon button. If you want to add this code on Form save, then implement your logic of 'OnSave' accordingly.
Below code is using Opportunity entity. Other desired entities can be passed in successCallback function. 





function MoveNextStage(stageToMove) {

Thursday, July 2, 2015

Add Dynamic Ribbon Menu Buttons

1) Create Ribbon Menu Buttons using (Ribbon Workbench)

2) Add Enable Rules in Ribbon Workbench

  • For each Rule Add a Custom Rule and Select Custom Javascript Rule
  • Now mention your function name and web-resource.

3) Connect Rules with Commands
4) Add the functions in Web-Resource as mentioned in Specified Rules in Step 2.
5) For Enable Button Return True and to Disable the Button, Return False.














#AW Customization Consultant Maison Consulting & Solutions

Wednesday, July 1, 2015

Asp.Net MVC (5) - Exception Filter - HandleError

Applicable on Asp.Net MVC5 HandleError Filter This belongs to Exception Filters category (Authentication Filter, Authoriz...