Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When I create a fax,return error:"Server was unable to process request

Status
Not open for further replies.

micccn

Programmer
Nov 26, 2007
2
0
0
CN
This is my code:

service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Get the current user.
WhoAmIRequest userRequest = new WhoAmIRequest();
WhoAmIResponse user = (WhoAmIResponse)service.Execute(userRequest);

service.CallerIdValue = new CallerId();
service.CallerIdValue.CallerGuid = user.UserId;

fax1 = new fax();

// Set the properties of the fax1.
fax1.subject = "a";
fax1.description = "a";

// Create the party sending and receiving the fax1.
party = new activityparty();
// Set the properties of Activityparty.
party.partyid = new Lookup();
party.partyid.type = EntityName.systemuser.ToString();
party.partyid.Value = user.UserId;
// The party sends and receives the fax1.
fax1.from = new activityparty[] { party };
fax1.to = new activityparty[] { party };
Lookup1 = new Lookup();
Lookup1.Value = user.UserId;
Lookup1.type = EntityName.fax.ToString();
fax1.createdby = Lookup1;
fax1.createdon = new CrmDateTime();
fax1.createdon.Value = DateTime.Now.ToString();
fax1.modifiedby = Lookup1;
fax1.modifiedon = new CrmDateTime();
fax1.modifiedon.Value = DateTime.Now.ToString();
fax1.ownerid = new Owner();
fax1.ownerid.type = EntityName.fax.ToString();
fax1.ownerid.Value = user.UserId;
Lookup1 = new Lookup();
Lookup1.type = EntityName.fax.ToString();
Lookup1.Value = user.BusinessUnitId;
fax1.owningbusinessunit = Lookup1;
fax1.statecode = new FaxStateInfo();
fax1.statecode.Value = FaxState.Open;
fax1.statuscode = new Status();
fax1.statuscode.name = "a";
fax1.statuscode.Value = 1;
fax1.faxnumber = "2124435";
fax1.isworkflowcreated = new CrmBoolean();
fax1.isworkflowcreated.Value = false;
fax1.scheduleddurationminutes = new CrmNumber();
fax1.scheduleddurationminutes.Value = 1;
fax1.actualdurationminutes = new CrmNumber();
fax1.actualdurationminutes.Value = 1;
fax1.actualend = new CrmDateTime();
fax1.actualend.Value = DateTime.Now.Date.ToString();
fax1.actualstart = new CrmDateTime();
fax1.actualstart.Value = DateTime.Now.Date.ToString();
fax1.billingcode = "0";
fax1.category = "";
fax1.coverpagename = "";
fax1.directioncode = new CrmBoolean();
fax1.directioncode.Value = false;
fax1.isbilled = new CrmBoolean();
fax1.isbilled.Value = true;
fax1.numberofpages = new CrmNumber();
fax1.numberofpages.Value = 1;
fax1.prioritycode = new Picklist();
fax1.prioritycode.name = "a";
fax1.prioritycode.Value = 1;
fax1.scheduledend = new CrmDateTime();
fax1.scheduledend.Value = DateTime.Now.Date.ToString();
fax1.scheduledstart = new CrmDateTime();
fax1.scheduledstart.Value = DateTime.Now.Date.ToString();
fax1.subcategory = "";
fax1.tsid = "";
fax1.serviceid = new Lookup();
fax1.serviceid.type = EntityName.fax.ToString();
fax1.serviceid.Value = user.UserId;
fax1.regardingobjectid = new Lookup();
fax1.regardingobjectid.Value = new Guid("56f3f959-4a9e-dc11-97c7-000000000010");
fax1.regardingobjectid.type = EntityName.opportunity.ToString();
// Create the fax1.
Guid Fax1Id = service.Create(fax1);

Anyone help me?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top