crm操作销售订单实体

using System;

using Microsoft.Xrm.Sdk;

using Microsoft.Xrm.Sdk.Query;

using Microsoft.Crm.Sdk.Messages;

/// <summary>

/// 销售订单

/// </summary>

public class SoleOrderHelper

{

public static readonly string entityName = "salesorder";

public Guid soleorderId = Guid.Empty;

public IOrganizationService service;

/// <summary>

/// 创建销售订单

/// </summary>

public void Create(Guid accountId)

{

Entity en = new Entity() { LogicalName = entityName,Id = accountId };

en["name"] = "销售订单测试";

en["accountid"] = new EntityReference() { LogicalName = "account" ,Id = accountId };

soleorderId = service.Create(en);

}

/// <summary>

/// 将销售订单分派给其他用户或团队

/// </summary>

/// <param name="assignee">用户或团队引用</param>

public void Assign(EntityReference assignee)

{

AssignRequest request = new AssignRequest();

request.Target = new EntityReference() { LogicalName = entityName,Id = soleorderId };

request.Assignee = assignee;

AssignResponse response = (AssignResponse)service.Execute(request);

}

/// <summary>

/// 取消销售订单

/// </summary>

/// <param name="status">取消的状态</param>

public void CancelSalesOrder(int status)

{

CancelSalesOrderRequest request = new CancelSalesOrderRequest();

request.OrderClose = new Entity() { LogicalName = entityName,Id = soleorderId };

request.Status = new OptionSetValue(status);

CancelSalesOrderResponse response = (CancelSalesOrderResponse)service.Execute(request);

}

/// <summary>

/// 将销售订单转换为发票

/// </summary>

public void ConvertSalesOrderToInvoice()

{

ConvertSalesOrderToInvoiceRequest request = new ConvertSalesOrderToInvoiceRequest();

request.SalesOrderId = soleorderId;

request.ColumnSet = new ColumnSet("name","accountid");

ConvertSalesOrderToInvoiceResponse response = (ConvertSalesOrderToInvoiceResponse)service.Execute(request);

Entity invoiceEn = response.Entity;

}

/// <summary>

/// 完成销售订单

/// </summary>

/// <param name="status">完成的状态</param>

public void FulfillSalesOrder(int status)

{

FulfillSalesOrderRequest request = new FulfillSalesOrderRequest();

request.OrderClose = new Entity() { LogicalName = entityName,Id = soleorderId };

request.Status = new OptionSetValue(status);

FulfillSalesOrderResponse response = (FulfillSalesOrderResponse)service.Execute(request);

}

/// <summary>

/// 从指定商机中检索销售订单的产品组

/// </summary>

/// <param name="opportunityId">商机id</param>

public void GetSalesOrderProductsFromOpportunity(Guid opportunityId)

{

GetSalesOrderProductsFromOpportunityRequest request = new GetSalesOrderProductsFromOpportunityRequest();

request.OpportunityId = opportunityId;

request.SalesOrderId = soleorderId;

GetSalesOrderProductsFromOpportunityResponse response =

(GetSalesOrderProductsFromOpportunityResponse)service.Execute(request);

}

/// <summary>

/// 锁定销售订单定价

/// </summary>

public void LockSalesOrderPricing()

{

LockSalesOrderPricingRequest request = new LockSalesOrderPricingRequest();

request.SalesOrderId = soleorderId;

LockSalesOrderPricingResponse response = (LockSalesOrderPricingResponse)service.Execute(request);

}

/// <summary>

/// 解锁指定的销售订单(订单)中产品的单价

/// </summary>

public void UnlockSalesOrderPricing()

{

UnlockSalesOrderPricingRequest request = new UnlockSalesOrderPricingRequest();

request.SalesOrderId = soleorderId;

UnlockSalesOrderPricingResponse response = (UnlockSalesOrderPricingResponse)service.Execute(request);

}

/// <summary>

/// 取消指定安全主体(用户或团队)对销售订单的所有访问权限

/// </summary>

/// <param name="revokee">用户或团队引用</param>

public void RevokeAccess(EntityReference revokee)

{

RevokeAccessRequest request = new RevokeAccessRequest();

request.Target = new EntityReference() { LogicalName = entityName,Id = soleorderId };

request.Revokee = revokee;

RevokeAccessResponse response = (RevokeAccessResponse)service.Execute(request);

}

/// <summary>

/// 删除销售订单

/// </summary>

public void Delete()

{

service.Delete(entityName, soleorderId);

}

}

时间: 2024-10-10 05:35:59

crm操作销售订单实体的相关文章

crm操作知识库文章实体

using System; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk.Query; /// <summary> /// 知识库文章 /// </summary> public class KbArticleHelper { public static readonly string entityName = "kbarticle"; pub

crm操作报价单实体

using System; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk.Query; /// <summary> /// 报价单 /// </summary> public class QuoteHelper { public static readonly string entityName = "quote"; public Guid q

crm操作商机实体

using System; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; public class OpportunityHelper { public static readonly string entityName = "opportunity"; public Guid opportunityId = Guid.Empty; /// <summary> /// 创建商机 /// </sum

微软Dynamics CRM 一般销售流程之 订单 简单介绍

菜单----销售---- 订单 进入主页面,可以新建,删除,运行报表,其它分配功能. 默认订单 新建一个订单 如果订单完成了,可以把订单的状态改成完成,转财务流程,完成收款. 也可以点 取消订单,删除订单,如果想自定义订单的样式,字段的话,就点最右边三个点,进入系统视图中更改吧,最强大的功能全在这里面,大家可以进去改改,因为这功能我在报价单介绍中已经写过了,在这里就不详细截图了. 下一篇介绍把订单如何创建发票.

订单捕获-销售订单自定义

订单捕获-销售订单自定义 你可以自定义销售订单窗口外观来满足需求.所有订单和行块(包含查找窗口)都是作为文件夹块来设计的.你可以隐藏.显示和更改你文件夹的外观. 允许的自定义 您可以从这些可能的自定义选择. 隐藏一个项目(文本项目,复选框,弹出列表,选项组) 注意:如果你想要在销售订单头区域窗口(单个行文件夹块)显示一个当前隐藏的字段,你应该先隐藏一个当前显示的字段.在单个行文件夹块中,显示字段操作在当前光标所在的字段下放置一个新字段. 注意:在多个行文件夹块中,显示字段操作在当前光标所在的字段

OEOIMP-创建销售订单(R12.2.3)

 创建销售订单(R12.2.3) --US Program:Order Import Short Name:OEOIMP Application:Order Management Executable:Order Import --ZHS 程序:订单导入 简称:OEOIMP 应用产品:订单管理 可执行名称:Order Import PLSQL调用 l_request_id := fnd_request.submit_request( 'ONT', 'OEOIMP', 'Order Impor

EBS OM销售订单接口相关

OM接口相关表: 1. OE_HEADERS_IFACE_ALL 此表为多组织表,用于将销售订单头插入开放接口.    该表存储来自于其他子系统需要导入OM模块的订单头信息,    该表导入时必须输入的字段/条件:    ORDER_SOURCE_ID : Order source id 可选    ORIG_SYS_DOCUMENT_REF: Original system document reference 必须    ORDER_SOURCE : Order source 可选    O

AR_销售订单收款基本操作(流程)

2014-06-04 BaoXinjian 一.步骤 1. 输入销售订单,输入(Enter)-->预定(Book)-->计划(Schedule)-->保留(Reserve) 2. 进行挑库操作, 挑库(Pick Release)-->挑库确认(Pick Confirm) 3. 制作发运单,制作发运单(Create Delivery)-->发运确认(Ship Confirm) 4. 程式停靠接口(Interface Trip Stop) 5. 关闭订单, 启动workflow处

Oracle EBS发放销售订单

 模拟发放销售订单界面进行发放操作 PROCEDURE insert_row(x_batch_id OUT NUMBER) IS l_autopack_flag VARCHAR2(1 ); l_autopack_level NUMBER; l_release_method VARCHAR2(1 ); l_release_online VARCHAR2(240 ) := fnd_profile.value('SHP_PICK_RELEASE_ONLINE' ); --bugfix 118302