Showing posts with label CRM Parameters. Show all posts
Showing posts with label CRM Parameters. Show all posts

Friday, August 7, 2009

Function to create CrmCustomer

public static Customer GetCrmCustomer(string entityTypeName, Guid value) {
Customer rslt = new Customer();
if (value == Guid.Empty)
rslt.IsNull = rslt.IsNullSpecified = true;
else {
rslt.type = entityTypeName;
rslt.Value = value;
}
return rslt;
}
Enjoy,
Rami Heleg

Function to create CrmPickList

public static Picklist GetCrmPicklist(int value) {
Picklist rslt = new Picklist();
if (value == 0)
rslt.IsNull = rslt.IsNullSpecified = true;
else
rslt.Value = value;
return rslt;
}
Enjoy,
Rami Heleg

Function to create CrmOwner

public static Owner GetCrmOwner(Guid ownerID) {
Owner rslt = new Owner();
if (ownerID == Guid.Empty)
rslt.IsNull = rslt.IsNullSpecified = true;
else {
rslt.Value = ownerID;
rslt.type = "systemuser";
}
return rslt;
}
Enjoy,
Rami Heleg

Function to create CrmStatus

public static Status GetCrmStatus(int value) {
Status rslt = new Status();
rslt.Value = value;
return rslt;
}

Enjoy,
Rami Heleg.

Function to create CrmDecimal

public static CrmDecimal GetCrmDecimal(decimal value, bool isNull) {
CrmDecimal rslt = new CrmDecimal();
if (isNull)
rslt.IsNull = rslt.IsNullSpecified = true;
else
rslt.Value = value;
return rslt;
}

Enjoy,
Rami Heleg

Function to create CrmFloat

public static CrmFloat GetCrmFloat(float value, bool isNull) {
CrmFloat rslt = new CrmFloat();
if (isNull)
rslt.IsNull = rslt.IsNullSpecified = true;
else
rslt.Value = value;
return rslt;
}

Enjoy,
Rami Heleg

Function to create CrmBoolean

public static CrmBoolean GetCrmBoolean(bool value) {
CrmBoolean rslt = new CrmBoolean();
rslt.Value = value;
return rslt;
}
Enjoy,
Rami Heleg

Function to create crmdatetime

public static CrmDateTime GetCrmDateTime(DateTime value) {
CrmDateTime rslt = new CrmDateTime();
rslt.Value = value.ToString("yyyy-MM-ddTHH:mm:ss");
return rslt;
}

Enjoy
Rami Heleg