Hi find out this nice post about LookUp by JimWang.
http://jianwang.blogspot.com/2008/05/mysterious-crm-lookup-i.html
Do Check it ..
Bye..
Hi find out this nice post about LookUp by JimWang.
http://jianwang.blogspot.com/2008/05/mysterious-crm-lookup-i.html
Do Check it ..
Bye..
This error occurs when using the QueryByAttribute class we are not setting the Attributes and Values Property.
Just like the below code
Say we want to have the names of all the accounts,
ColumnSet myCols=new ColumnSet();
myCols.Attributes=new string[] {“name”};
QueryByAttribute myQA = new QueryByAttribute();
myQA.EntityName = EntityName.account.ToString();
myQA.ColumnSet = myCols ;
BusinessEntityCollection myBCColl2= myService.RetrieveMultiple(myQA);
However we will get error in this case because we haven’t specified Attributes and Values property. So we need to specify those properties.
myQA.Attributes = new String[] { “statuscode” };
myQA.Values=new object[] {“1”};
Otherwise we could use QueryByExpression class for that
ColumnSet myCols=new ColumnSet();
myCols.Attributes=new string[] {“name”};
QueryExpression myQE = new QueryExpression();
myQE.EntityName = EntityName.account.ToString();
myQE.ColumnSet = myCols;
BusinessEntityCollection myBCColl1 = myService.RetrieveMultiple(myQE);
Bye ..
To access the mobile view of our SharePoint sites, we just need to do the following,
just append to the url _layouts/mobile
from
to
http://servername:port/_layouts/mobile
That’s it..
To user hyperlink in WPF application we could do something like this
<TextBlock>
<Hyperlink NavigateUri=”http://www.google.co.in”>
Click here
</Hyperlink>
</TextBlock>
However the NavigateUri works only if we are placing the hyperlink within a page. To use it within a windows-based application we need to hanlde the RequestNavigate event and write the code ourselves.
Something like this
<TextBlock>
<Hyperlink NavigateUri=”http://www.google.co.in” RequestNavigate=”Hyperlink_RequestNavigate”>
Click here
</Hyperlink>
</TextBlock>
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
While using hyperlink we could also provide handler for Application.NavigationFailed event in case if navigation fails.
That’s it ….
Suppose we want to create a custom config section in this following manner
<queryTypes>
<queryType name=“qt1“ value=“qt1 value“></queryType>
<queryType name=“qt2“ value=“qt2 value“></queryType>
</queryTypes>
For implementing the above custom section we need to first define a class inheriting from ConfigurationSection class
Add reference to System.Configuration dll.
Create a new config section class in the following manner
// implement ConfiguraionSection class
class QueryTypesSection : ConfigurationSection
{
public QueryTypesSection()
{
}
[ConfigurationProperty(“”, IsDefaultCollection = true)]
public QueryTypesCollection QueryTypes
{
get
{
return (QueryTypesCollection)base[“”];
}
}
}
// Represents a configuration element containing a collection of child elements
public sealed class QueryTypesCollection : ConfigurationElementCollection
{
protected override ConfigurationElement CreateNewElement()
{
return new QueryTypeElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((QueryTypeElement)element).Name;
}
public override ConfigurationElementCollectionType CollectionType
{
get
{
return ConfigurationElementCollectionType.BasicMap;
}
}
protected override string ElementName
{
get
{
return “queryType”;
}
}
}
// Defining QueryTypeElement with name and value attribute
public sealed class QueryTypeElement : ConfigurationElement
{
// defining name attribute
[ConfigurationProperty(“name”, IsRequired = true)]
public string Name
{
get
{
return (string)this [“name”];
}
set
{
this[“name”] = value;
}
}
// defining value attribute
[ConfigurationProperty(“value”, IsRequired = true)]
public string Value
{
get
{
return (string)this[“value”];
}
set
{
this[“value”] = value;
}
}
}
Now to register your custom section do the following
<configSections>
<section name=“queryTypes“ type=“namespace.QueryTypesSection, namespace “ />
</configSections>
And to use it within the application
QueryTypesSection queryTypeSection = (QueryTypesSection)ConfigurationManager.GetSection(“queryTypes”);
QueryTypesCollection queryTypeCollection = queryTypeSection.QueryTypes;
foreach (QueryTypeElement se in queryTypeCollection)
{
string name=se.Name;
string value = se.Value;
}
That’s it…
At times instead of using appSettings section we would like to define our own custom section within configuration file.
Suppose we want to create a custom config section in this following manner
<SimplConfigSection id=“myID“ name=“myName“ />
For implementing the above custom section we need to first define a class inheriting from ConfigurationSection class
Add reference to System.Configuration dll.
Create a new config section class in the following manner
// inherit the class ConfigurationSection
class SimpleConfigSection : ConfigurationSection
{
public SimpleConfigSection()
{
}
// using ConfigurationProperty attribute to define the attribute
[ConfigurationProperty(“id”,IsRequired = true)]
public String ID
{
get
{ return (String)this[“id”]; }
set
{ this[“id”] = value; }
}
// using ConfigurationProperty attribute to define the attribute
[ConfigurationProperty(“name”, IsRequired = true)]
public String Name
{
get
{ return (String)this[“name”]; }
set
{ this[“name”] = value; }
}
}
Now to register your custom section do the following
<configSections>
<section name=“SimplConfigSection“ type=“Namespace.SimpleConfigSection, Namespace“ />
</configSections>
And to use it within the application
SimpleConfigSection simpleConfig = (SimpleConfigSection)ConfigurationManager.GetSection(“SimplConfigSection”);
string id = simpleConfig.ID;
string name = simpleConfig.Name;
That’s it …