Windows Online Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, 24 October 2007

Create CustomerOpportunityRole Record

Posted on 04:29 by Unknown
This is a very simple code, when you wants to create a CustomerOpportunityRole.


try
{

// Create the class
customeropportunityrole oppRole = new customeropportunityrole();

// Define the "Customer" to relate the Opportunity to. // This could be an Account or a Contact//
oppRole.customerid = new Customer();
oppRole.customerid.Value = new Guid("605291D0-C91E-DC11-944B-0003FF0E1518");
oppRole.customerid.type = EntityName.account.ToString();

// Define what Opportunity this relationship is for
oppRole.opportunityid = new Lookup();
oppRole.opportunityid.Value = new Guid("701C12F1-896A-DC11-961B-0003FF0E1518");
oppRole.opportunityid.type = EntityName.opportunity.ToString();

// Define what Relationship Role to use
oppRole.opportunityroleid = new Lookup
oppRole.opportunityroleid.Value = new Guid("D2A640E1-B81A-DC11-A7F0-000C29C33583");
oppRole.opportunityroleid.name="Referral";
oppRole.opportunityroleid.type = EntityName.relationshiprole.ToString();

// Assign StatusCode, StateCode
CrmNumber codeNumber = new CrmNumber();
codeNumber.Value= 1;
oppRole.opportunitystatuscode = codeNumber;

codeNumber.Value= 0;
oppRole.opportunitystatecode = codeNumber;

// Create the relationship
Guid id = service.Create(oppRole);
}
catch(System.Web.Services.Protocols.SoapException ex)
{
MessageBox.Show(ex.Detail.InnerText.ToString() + ex.Message.ToString());
}

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in MS CRM | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • "Titan" Microsoft CRM 4.0
    Currently the "Titan" Microsoft CRM 4.0 is in CTP. New version of Microsoft Dynamics CRM delivers the power of choice to customers...
  • Writing the Plug-in Constructor
    The Microsoft Dynamics CRM platform has special support for a plug-in constructor that accepts two string parameters. If you write a constru...
  • Declare Global Access Level functions in MS CRM Form.
    Global functions in MS CRM Form. The way CRM adds the javascript to the page, any function defined in the onload event will only have a loca...
  • Crystal Report 4.6 - Error 20540; Missing or out of date Export DLL
    I was happen to install Crystal Report 4.6. for one of my project. As soon as I call the Crystal Report via VB 6.0 Code, i got the below err...
  • Debugging a Plug-in
    The following steps describe how to debug a plug-in. 1. Deploy the plug-in assembly. Copy the assembly to the standard plug-in folder on the...
  • Microsoft Dynamics CRM SDK Version 4.0.9 Released
    Download this new version of the SDK or view it on MSDN . This release provides continuing support for the on-premise user and new informat...
  • Create CustomerOpportunityRole Record
    This is a very simple code, when you wants to create a CustomerOpportunityRole. try { // Create the class customeropportunityrole oppRole = ...
  • Passing / Sharing Data Between Plug-ins
    The message pipeline model provides for a PropertyBag of custom data values in the execution context that is passed through the pipeline and...
  • Callout vs. Workflow
    You might find yourself wondering when you should use a pre- or post-callout versus when you should use a workflow rule. As you would expect...
  • To download all mother board driver CD
    http://driverpool.blogspot.com

Categories

  • .NET
  • .NET String Methods
  • Adapters
  • Aggregate Functions
  • All Elements
  • Associated Records
  • Azure
  • BizTalk Adapter
  • Callouts
  • Child Pipeline
  • Crm 2011
  • Crm 2011 Beta
  • Crm 2011 Beta - Ribbons
  • Crm 2011 Beta Installation
  • CRM Online 2011
  • Customizations
  • Database
  • Debug
  • Deployment Service
  • Dynamic Entity
  • Email
  • FetchXml
  • FileSync
  • Form Assistant
  • Hide Button
  • IIS
  • Integration
  • Internet Connectivity
  • ISV
  • Java Script
  • Lead Capture
  • MS CRM
  • MS CRM 2011 RC
  • MS CRM 4 Roll Ups
  • MS CRM 5 Features
  • MS CRM Accelerators
  • MS CRM Entity Schema
  • MS CRM Global Variable and Functions
  • MS CRM Templates
  • Pivot Tables
  • Plugin Constructor
  • Plugins
  • Reports
  • s
  • Save Record
  • SDK
  • Sharepoint
  • Sharepoint 2010
  • Sharing Data Between Plug-ins
  • Social Networking
  • SSRS
  • Tabs
  • Tracing
  • Videos
  • Visual Studio 6
  • VPC
  • WampServer
  • Windows Service
  • Windows XP
  • Workflows
  • xRM

Blog Archive

  • ►  2013 (4)
    • ►  September (4)
  • ►  2012 (8)
    • ►  September (1)
    • ►  July (7)
  • ►  2011 (12)
    • ►  July (1)
    • ►  March (1)
    • ►  February (2)
    • ►  January (8)
  • ►  2010 (27)
    • ►  December (1)
    • ►  October (3)
    • ►  September (10)
    • ►  August (2)
    • ►  July (5)
    • ►  June (5)
    • ►  February (1)
  • ►  2009 (41)
    • ►  December (1)
    • ►  November (5)
    • ►  August (3)
    • ►  July (2)
    • ►  June (3)
    • ►  May (9)
    • ►  April (2)
    • ►  March (5)
    • ►  February (7)
    • ►  January (4)
  • ►  2008 (33)
    • ►  December (7)
    • ►  November (3)
    • ►  October (1)
    • ►  September (7)
    • ►  August (4)
    • ►  July (1)
    • ►  February (4)
    • ►  January (6)
  • ▼  2007 (11)
    • ▼  October (3)
      • Create CustomerOpportunityRole Record
      • Enable tracing in Microsoft Dynamics CRM 3.0
      • Remove / Detach Email from Queue
    • ►  September (1)
    • ►  August (3)
    • ►  July (4)
Powered by Blogger.

About Me

Unknown
View my complete profile