Monday 21 September 2015

Default Status And Status Reason Values



Status reason transitions are an optional additional level of filtering to define what the status reason value can be changed to for each status reason.
Entities that can have different status values have two fields that capture this data:
Display Name Description
Status Represents the state of the record. Typically Active or Inactive. You cannot add new status options.
Status Reason Represents a reason that is linked to a specific status. Each status must have at least one possible status reason. You can add additional status reason options.
Activity entity
State Status Reason
0 : Open 1 : Open
1 : Completed 2 : Completed
2 : Canceled 3 : Canceled
3 : Scheduled 4 : Scheduled
Appointment entity
State Status Reason
0 : Open 1 : Free
2 : Tentative
1 : Completed 3 : Completed
2 : Canceled 4 : Canceled
3 : Scheduled 5 : Busy
6 : Out of Office
Article entity
State Status Reason
1 : Draft 1 : Draft
2 : Unapproved 2 : Unapproved
3 : Published 3 : Published
Authorization Server entity
State Status Reason
0 : Active 1 : Enabled
1 : Inactive 2 : Disabled
Bulk Delete Operation entity
State Status Reason
0 : Ready 0 : Waiting For Resources
1 : Suspended 10 : Waiting
11 : Retrying
12 : Paused
2 : Locked 20 : In Progress
21 : Pausing
22 : Canceling
3 : Completed 30 : Succeeded
31 : Failed
32 : Canceled
Campaign entity
State Status Reason
0 : Active 0 : Proposed
1 : Ready To Launch
2 : Launched
3 : Completed
4 : Canceled
5 : Suspended
1 : Inactive 6 : Inactive
Campaign Activity entity
State Status Reason
0 : Open 1 : Proposed
0 : In Progress
4 : Pending
5 : System Aborted
6 : Completed
1 : Closed 2 : Closed
2 : Canceled 3 : Canceled
Campaign Response entity
State Status Reason
0 : Open 1 : Open
1 : Closed 2 : Closed
2 : Canceled 3 : Canceled
Case entity
State Status Reason
0 : Active 1 : In Progress
2 : On Hold
3 : Waiting for Details
4 : Researching
1 : Resolved 5 : Problem Solved
1000 : Information Provided
2 : Canceled 6 : Canceled
2000 : Merged
Case Resolution entity
State Status Reason
0 : Open 1 : Open
1 : Completed 2 : Closed
2 : Canceled 3 : Canceled
Column Mapping entity
State Status Reason
0 : Active 1 : Active
Contract entity
State Status Reason
0 : Draft 1 : Draft
1 : Invoiced 2 : Invoiced
2 : Active 3 : Active
3 : On Hold 4 : On Hold
4 : Canceled 5 : Canceled
5 : Expired 6 : Expired
Contract Line entity
State Status Reason
0 : Existing 1 : New
1 : Renewed 2 : Renewed
2 : Canceled 3 : Canceled
3 : Expired 4 : Expired
Data Import entity
State Status Reason
0 : Active 0 : Submitted
1 : Parsing
2 : Transforming
3 : Importing
4 : Completed
5 : Failed
Discount List entity
State Status Reason
0 : Active 100001 : Active
1 : Inactive 100002 : Inactive
Duplicate Detection Rule entity
State Status Reason
0 : Inactive 0 : Unpublished
1 : Publishing
1 : Active 2 : Published
Email entity
State Status Reason
0 : Open 1 : Draft
8 : Failed
1 : Completed 2 : Completed
3 : Sent
4 : Received
6 : Pending Send
7 : Sending
2 : Canceled 5 : Canceled
Fax entity
State Status Reason
0 : Open 1 : Open
1 : Completed 2 : Completed
3 : Sent
4 : Received
2 : Canceled 5 : Canceled
Goal entity
State Status Reason
0 : Active 0 : Open
1 : Inactive 1 : Closed
2 : Discarded
Goal Metric entity
State Status Reason
0 : Active 0 : Open
1 : Inactive 1 : Closed
Import Data entity
State Status Reason
0 : Active 0 : Active
Import Entity Mapping entity
State Status Reason
0 : Active 1 : Active
Import Log entity
State Status Reason
0 : Active 0 : Active
Import Source File entity
State Status Reason
0 : Active 0 : Submitted
1 : Parsing
2 : Transforming
3 : Importing
4 : Completed
5 : Failed
Invoice entity
State Status Reason
0 : Active 1 : New
2 : Partially Shipped
4 : Billed
5 : Booked (applies to services)
6 : Installed (applies to services)
1 : Closed (deprecated) 3 : Canceled (deprecated)
7 : Paid in Full (deprecated)
2 : Paid 100001 : Complete
100002 : Partial
3 : Canceled 100003 : Canceled
Lead entity
State Status Reason
0 : Open 1 : New
2 : Contacted
1 : Qualified 3 : Qualified
2 : Disqualified 4 : Lost
5 : Cannot Contact
6 : No Longer Interested
7 : Canceled
Letter entity
State Status Reason
0 : Open 1 : Open
2 : Draft
1 : Completed 3 : Received
4 : Sent
2 : Canceled 5 : Canceled
List Value Mapping entity
State Status Reason
0 : Active 0 : Active
Lookup Mapping entity
State Status Reason
0 : Active 0 : Active
Marketing List entity
State Status Reason
0 : Active 0 : Active
1 : Inactive 1 : Inactive
Opportunity entity
State Status Reason
0 : Open 1 : In Progress
2 : On Hold
1 : Won 3 : Won
2 : Lost 4 : Canceled
5 : Out-Sold
Opportunity Close entity
State Status Reason
0 : Open 1 : Open
1 : Completed 2 : Completed
2 : Canceled 3 : Canceled
Order entity
State Status Reason
0 : Active 1 : New
2 : Pending
1 : Submitted 3 : In Progress
2 : Canceled 4 : No Money
3 : Fulfilled 100001 : Complete
100002 : Partial
4 : Invoiced 100003 : Invoiced
Order Close entity
State Status Reason
0 : Open 1 : Open
1 : Completed 2 : Completed
2 : Canceled 3 : Canceled
Owner Mapping entity
State Status Reason
0 : Active 0 : Active
Partner Application entity
State Status Reason
0 : Active 1 : Enabled
1 : Inactive 2 : Disabled
Phone Call entity
State Status Reason
0 : Open 1 : Open
1 : Completed 2 : Made
4 : Received
2 : Canceled 3 : Canceled
Price List entity
State Status Reason
0 : Active 100001 : Active
1 : Inactive 100002 : Inactive
Process entity
State Status Reason
0 : Draft 1 : Draft
1 : Activated 2 : Activated
Process Session entity
State Status Reason
0 : Incomplete 1 : Not Started
2 : In Progress
3 : Paused
1 : Complete 4 : Completed
5 : Canceled
6 : Failed
Queue entity
State Status Reason
0 : Active 1 : Active
1 : Inactive 2 : Inactive
Queue Item entity
State Status Reason
0 : Active 1 : Active
1 : Inactive 2 : Inactive
Quick Campaign entity
State Status Reason
0 : Open 1 : Pending
2 : In Progress
1 : Closed 3 : Aborted
4 : Completed
2 : Canceled 5 : Canceled
Quote entity
State Status Reason
0 : Draft 1 : In Progress
1 : Active 2 : In Progress
3 : Open
2 : Won 4 : Won
3 : Closed 5 : Lost
6 : Canceled
7 : Revised
Quote Close entity
State Status Reason
0 : Open 1 : Open
1 : Completed 2 : Completed
2 : Canceled 3 : Canceled
Recurring Appointment entity
State Status Reason
0 : Open 1 : Free
2 : Tentative
1 : Completed 3 : Completed
2 : Canceled 4 : Canceled
3 : Scheduled 5 : Busy
6 : Out of Office
Rollup Query entity
State Status Reason
0 : Active 0 : Open
1 : Inactive 1 : Closed
Saved View entity
State Status Reason
0 : Active 1 : Active
3 : All
1 : Inactive 2 : Inactive
Sdk Message Processing Step entity
State Status Reason
0 : Enabled 1 : Enabled
1 : Disabled 2 : Disabled
Service Activity entity
State Status Reason
0 : Open 1 : Requested
2 : Tentative
1 : Closed 8 : Completed
2 : Canceled 9 : Canceled
10 : No Show
3 : Scheduled 3 : Pending
4 : Reserved
6 : In Progress
7 : Arrived
System Job entity
State Status Reason
0 : Ready 0 : Waiting For Resources
1 : Suspended 10 : Waiting
2 : Locked 20 : In Progress
21 : Pausing
22 : Canceling
3 : Completed 30 : Succeeded
31 : Failed
32 : Canceled
Task entity
State Status Reason
0 : Open 2 : Not Started
3 : In Progress
4 : Waiting on someone else
7 : Deferred
1 : Completed 5 : Completed
2 : Canceled 6 : Canceled
Transformation Mapping entity
State Status Reason
0 : Active 0 : Active

Tuesday 1 September 2015

CRM 2013 Adding an On Change Event to a Grid View

 
How to add an on change event to a grid view, similar to an on load or save event, which will allow a developer to add some code to the page??

Capture

Take the contact associated view shown on the account (in the image above), imagine we wish to add JavaScript so that whenever the user clicks an option we get a chance to run some code. We don’t want to make the user click a button, we just need to chance to run some logic and show a message. If this was a form we could add an on change event, however this is a view and MSCRM doesn’t provide that kind of hook.
So we need to get a little more creative:
  1. Add a new ribbon button to the sub grid with a command (in CRM 2013 buttons without commands are hidden).
  2. Add an enable rule so the button is always disabled (in CRM 2013 disabled buttons are automatically hidden).
  3. Add a JavaScript library to that enable rule – this is where we can place our custom code.
  4. When the user makes a selection in the view, MSCRM automatically refreshes the ribbon (command bar), and re-evaluates the enable rules – effectively we have an on change event.
My ribbon editor of choice is Ribbon Workbench from Scott Durrow.
Building the Solution
Create a new solution (or reuse an old one, it doesn’t matter), include in that solution the entity which is shown in the associated view. In my case that is the contact. Into that solution also add a JavaScript library (new_select in my case).CaptureAdd the JavaScript
Into your JavaScript library add the following code, this will print the IDs of the records that are selected in associated view and will serve as the base for your developments.
1
2
3
4
5
6
7
8
function OnClick(input) {
//This is where you can put your custom code
//For the purposes of demonstration I'm just going to print the selected IDs
alert(input);
//Return false so the button is always disabled and in CRM 2013 automatically hidden.
return false;
}
Adding the Button
Time to fire up Ribbon Workbench and add the button.
  1. Add a new button within the SUB GRID section (also the associated view section).
  2. Add a new command, set the command to be the command for the new button.
  3. Add a URL action to the command which navigates to your favorite website – the user will never be able to click this button and open the link, but we need to add an action to the button otherwise CRM wont display it.
  4. Add a new enable rule to the command:
  • Default: False – this will mean the button is always disabled and in CRM 2013 this means it is always hidden. This will be used if you didn’t provide a return value in your script.
  • Function Name: OnClick – this should match whatever you have defined in your JavaScript.
  • Library: $webresource:new_Select – this should match your library name, if you use the lookup control in Ribbon Workbench its fairly easy to select the correct file.
  • Parameters: SelectedControlSelectedItemIds – this will mean CRM will pass the function the ID of every selected ribbon in the grid view.
Capture
Capture
Test
Publish your changes and return to your parent entity (account in my case) and then start clicking grid records, and you should get something similar to the following.
Capture
Note for CRM 2011: I believe the steps described above will still work, but you will end up with a disabled button sat on the ribbon. You could try adding a visibility rule to hide the button, but I don’t think CRM bothers to evaluate the enable rules of a hidden button so your custom code wont be called. So you could try piggy backing the enable rule on another existing button, but the rule should always returns true so the button is always visible.
Note for CRM 2013 & sub grids on the form: Sub grids embedded on the form in CRM 2013 don’t get the ribbon (command) bar, so these steps wont work there. I suggest removing any sub grids and just using the associated views if you really need this type of behavior.