Play any tones in you CPU speakers:!




#include
#include
#include

void main()
{
#define sn sound;
clrscr();
const DELAY=500;
int c=0,A;;
char az[60],her,v=14;
// /int c=5;
cout<<"\n\tINPUT CHARACTERS IN SEQUENCE\n===>";
cin>>az;
// az[c]=az;
//c=1;
one:
//az[5]=az[c];

switch(az[c])
{
case 'a':
//cout<<"\n\tchar is"<<'a';
sound(100);
delay(DELAY);
nosound();
break;
case 'b':
//cout<sound(200);
delay(DELAY);
nosound();
break;
case 'c':
sound(300);
delay(DELAY);
nosound();
break;
case 'd':
sound(400);
delay(DELAY);
nosound();
break;
case 'e':
sound(500);
delay(DELAY);
nosound();
break;

. . . . .
. . . . .
. . . .
. . . .

break;
case '9':
sound(14400);
delay(DELAY);
nosound();
break;
case '0':
sound(15400);
delay(DELAY);
nosound();
break;


default:
goto end;
sound(100);
delay(DELAY);
nosound();

// cout<<"\n\t unknown charector"<break;
}
//A=A+1;
cout<
c=c+1;

if ( c<=53 )
goto one;
//clrscr();


end:


}

Filtered Views for Microsoft Dynamics CRM 4.0

I rarely post about product updates on this blog, but this time I make an exception. The reason is that the new features in the Filtered Views are great and I want to share it with you.

So far the Filtered Views allowed creating dynamic views based on parameters being supplied at runtime. With "at runtime" I mean that you pass parameters in your CRM script code. That was good enough to view associated data going well beyond the capabilities of a standard CRM view. However, good is never good enough, so here's the list of enhancements in the new release:

  1. UI Filters to define custom search fields in filtered views
  2. Multi-Language support
  3. An entity context to activate field mappings when creating a new entity from a filtered view
  4. Script support to perform typical tasks like hiding toolbar buttons or colorizing views

Probably the best explanation of what you can do with these new features is the following screenshot: 

There are three UI Filters (search fields). The label of each UI Filter can use HTML to create special effects, like done for the "Payment Method" label. Dropdown controls can be used to display options from the CRM metadata. You can also use them to display a list of records, which are identified by a dynamic query that can be parameterized as well. Of course you also have text fields for simple text searches. Additional controls will be added, especially lookup and date controls seems making sense.

You also get a view OnLoad script. Dynamics CRM doesn't have a view event model and it's a highly requested feature for a long time. In the Filtered Views you can attach your own script to do view manipulations very easily. The above screenshot, for instance, uses the following OnLoad code:




var createNewRecordButtonId = "_MBopenObj" + etcViewItems;
var button = viewBody.document.getElementById(createNewRecordButtonId);

if (button != null) {
button.style.display = "none";
}

var dataTable = viewBody.document.all.gridBodyTable;

for (var i = 0; i < dataTable.rows.length; i++) {
var row = dataTable.rows[i];

if (row.cells.length > 5) {
var cell = row.cells[5];

if (cell.innerText == "") {
cell.style.backgroundColor = "#FF8080";
}
else {
cell.style.backgroundColor = "#80FF80";
}
}
}

It hides the "New" button and then loops through the data rows to display cells in a different color.

When clicking the "New" button (which is hidden in this example but usually available) you most probably want to associate it to an existing record. When displaying the Filtered View on a CRM form, this most likely is the hosting form itself, but it can also be a different record if that makes sense. Consider an account form where you use a Filtered View to display the contacts of the parent account. When clicking "New" it makes sense to associate the new contact with the parent account, rather than the account you are currently viewing.

And finally the Filtered Views now fully support multi-language, so that users always get the UI in the language they use in Dynamics CRM.

I know that you can do all of the above with SQL reports, so you don't have to email me that it can be done differently. When it comes to presenting data then everything can be done with SQL reports. But that also is true for other development areas. Almost everything is doable with the CRM Services, but not everyone likes it or is a .NET developer. And not everyone is comfortable with SQL reports, so it's always a good option to have alternatives.