Wednesday, 24 June 2009
Saturday, 20 June 2009
Friday, 19 June 2009
Javascript: Calculate Week no
function:
Date.prototype.getWeek = function()
{
var onejan = new Date(this.getFullYear(),0,1);
return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
}
call:
var today = new Date();
var weekno = today.getWeek();
Thursday, 18 June 2009
Basics: Partylist
var vTo = crmForm.all.to[0];
var lookupItem = new Array;
lookupItem = null;
lookupItem = crmForm.all.to.DataValue;
// The text value of the lookup.
alert(lookupItem[0].name);
// The GUID of the lookup.
alert(lookupItem[0].id);
// The entity type name.
alert(lookupItem[0].typename);
Set Partylist value (to regarding value - only when regarding != null and regarding contact)
if (crmForm.all.regardingobjectid.DataValue !=null)
{
var lookupItem = new Array;
lookupItem = null;
lookupItem = crmForm.all.regardingobjectid.DataValue;
if (lookupItem[0].type == 2) // contact
{
to_lookupItem = crmForm.all.regardingobjectid.DataValue;
var lookupData = new Array();
var lookupItem= new Object();
//Set the id, typename, and name properties to the object.
lookupItem.id = to_lookupItem[0].id;
lookupItem.typename = to_lookupItem[0].typename;
lookupItem.name = to_lookupItem[0].name;
lookupItem.type = to_lookupItem[0].type;
// Add the object to the array.
lookupData[0] = lookupItem;
crmForm.all.to.DataValue = lookupData;
}
}
Basics: Testing Lookup for null value
{
alert("Not Null");
}
else
{
alert("NULL!");
}
Wednesday, 17 June 2009
Friday, 12 June 2009
SDK: isDirty
var oField = crmForm.all.SOME_FIELD_ID;
if (oField.IsDirty)
{
alert("The field's value has changed.");
}
else
{
alert("The field's value has not changed.");
}
SDK: Required Level
var CRM_REQUIRED_LEVEL_NORMAL = 0;
var CRM_REQUIRED_LEVEL_RECOMMENDED = 1;
var CRM_REQUIRED_LEVEL_REQUIRED = 2;
var oField = crmForm.all.SOME_FIELD_ID;
switch (oField.RequiredLevel)
{
case CRM_REQUIRED_LEVEL_NORMAL:
alert("This field is not required or recommended");
break;
case CRM_REQUIRED_LEVEL_RECOMMENDED:
alert("This field is business recommended");
break;
case CRM_REQUIRED_LEVEL_REQUIRED:
alert("This field is required");
break;
}
SDK: Set focus
// Set focus to the field
crmForm.all.SOME_FIELD_ID.SetFocus();
SDK: Duration
var iMinutes = 60;
crmForm.all.SOME_DURATION_FIELD_ID.DataValue = iMinutes;
SDK: Date Time
var oField = crmForm.all.SOME_DATETIME_FIELD_ID;
if (oField.TimeVisible)
{
alert("The time is visible.");
}
else
{
alert("Only the date is visible... the time is hidden.");
}
SDK: Customer Regarding
var lookupItem = new Array;
lookupItem = null;
// This will get the lookup for the attribute regardingobjectid on the Task form.
lookupItem = crmForm.all.regardingobjectid.DataValue;
// If there is data in the field, show it in a series of alerts.
if (lookupItem[0] != null)
{
// The text value of the lookup.
alert(lookupItem[0].name);
// The GUID of the lookup.
alert(lookupItem[0].id);
// The entity type name.
alert(lookupItem[0].typename);
// The entity type code of the lookup: 1=account, 2= contact.
// This attribute is deprecated. Use typename instead.
alert(lookupItem[0].type);
}
SDK: Set Lookup Value
// Create a lookupItem to store the values that you want to set to a target lookup control.
var lookupItem = new Array();
// Specify the values on the signature of LookupControlItem. These values are the GUID of pricelevel, the type code of pricelevel, and the name of the lookup value.
lookupItem[0] = new LookupControlItem ("{F31BB38A-0EC0-403F-99A6-3AF469D7D76E"}, 1022, "Retail");
// Set the form control value to the lookupItem that you just created.
crmForm.all.pricelevelid.DataValue = lookupItem ;
SDK: Read Lookup Value
var lookupItem = new Array;
// Get the lookup for the primarycontactid attribute on the account form.
lookupItem = crmForm.all.primarycontactid.DataValue;
// If there is data in the field, show it in a series of alerts.
if (lookupItem[0] != null)
{
// Display the text value of the lookup.
alert(lookupItem[0].name);
// Display the entity type name.
alert(lookupItem[0].typename);
// Display the GUID of the lookup.
alert(lookupItem[0].id);
// Display the entity type code of the lookup. A value of 1 equals account, and a value of 2 equals contact.
alert(lookupItem[0].type);
}
Shortcut to Add notes and attachments
from here: https://community.dynamics.com/blogs/crminogic/archive/2009/03/06/shortcut-to-add-notes-and-attachments.aspx
You need to navigate to the Notes tab each time you need to add a note. Also the shortcut to add a quick note in CRM does not show up the note form that allows to fill in all details including subject and attachment in one go. If you want to add all information to the note it would involve atleast a couple or more of clicks to get all done.
You can add convenient shortcuts to add notes without having to navigate to the Notes tab and save a few clicks.
*
add a note : locAddObjTo(5); This will open up the new note form
*
attach a file : locAddFileTo(5); This will bring up the attach file form.
Thursday, 11 June 2009
Sunday, 7 June 2009
Organizational intelligence
Organizational intelligence (OI) is the capability of an organization to comprehend and conclude knowledge relevant to its business purpose.
OI can be seen as the business oriented extension to knowledge management (KM), as it is the application of KM concepts to a business environment, additionally including learning mechanisms, comprehension models and business value network models, such as the balanced scorecard concept.
OI's focus includes the creation, fostering and management of organizational competencies (OCs).
Balanced scorecards
The Balanced Scorecard (BSC) is a performance management tool for measuring whether the smaller-scale operational activities of a company are aligned with its larger-scale objectives in terms of vision and strategy.
By focusing not only on financial outcomes but also on the operational, marketing and developmental inputs to these, the Balanced Scorecard helps provide a more comprehensive view of a business, which in turn helps organizations act in their best long-term interests. This tool is also being used to address business response to climate change and greenhouse gas emissions.
Organizations were encouraged to measure, in addition to financial outputs, those factors which influenced the financial outputs. For example, process performance, market share / penetration, long term learning and skills development, and so on.
The underlying rationale is that organizations cannot directly influence financial outcomes, as these are "lag" measures, and that the use of financial measures alone to inform the strategic control of the firm is unwise. Organizations should instead also measure those areas where direct management intervention is possible. In so doing, the early versions of the Balanced Scorecard helped organizations achieve a degree of "balance" in selection of performance measures. In practice, early Scorecards achieved this balance by encouraging managers to select measures from three additional categories or perspectives: "Customer," "Internal Business Processes" and "Learning and Growth."
Competitor analysis
Competitive intelligence
Friday, 5 June 2009
Wednesday, 3 June 2009
Business Dashboard definition
Dashboards (management information systems)
http://en.wikipedia.org/wiki/Executive_dashboard
Monday, 1 June 2009
Javascript: special characters
- \t – tab
- \b – backspace/delete
- \r – carriage return
- \n – newline
- \f – form feed
Javascript: more string stuff
- concat() - Combines the text of two or more strings and returns a new string.
- indexOf() – Returns the starting index of a substring within another string. A –1 is returned if no match is found.
- charAt() – Returns the character at the specified location.
- lastIndexOf() - Returns the index within the string of the last occurrence of the specified value, or -1 if not found.
- match() - Used to match a regular expression against a string.
- substring() – A portion of a string is returned. A starting and ending location are passed to this function.
- replace() – Used to find a match between a regular expression and a string, and to replace the matched substring with a new substring.
- search() - Executes the search for a match of a regular expression. If successful, search returns the index of the match inside the string. Otherwise, it returns -1.
- slice() - Extracts a section of a string and returns a new string.
- split() - Splits a string into an array of strings by separating the string into substrings.
- length() – The length of the string is returned as the count of the number of characters it contains.
- toLowerCase() – Converts the entire string to lower case.
- toUpperCase() – Converts the entire string to upper case.






