AIF Operation -- Delete()
来源:互联网 发布:单片机c语言数据类型 编辑:程序博客网 时间:2024/06/07 04:19
AIF 中的服务一般会提供八种操作, 分别为create,delete,find,findKeys,getKeys,read,update, getChangeKey
我们今天来讨论如何使用AIF Service 中的delete方法去删除Dynamics AX中的数据
- 注册 SalesSalesOrderService 服务
- 创建一个NetTcp类型的端口,命名为TestAIFOperation,添加SalesSalesOrderService 服务的delete方法
- 在VS2010种创建一个console类型的项目
- 取得端口中的服务地址(WSDL URI): http://RD7145D0511:8101/DynamicsAx/Services/TestAIFOperation
- 添加引用,右击Reference/Add Service Reference,将WSDL URI复制进去,点击Go按钮,再点击确定
- 执行一下代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestAIFDeleteMethod.ServiceReference1;
namespace TestAIFDeleteMethod
{
class Program
{
static void Main(string[] args)
{
SalesOrderServiceClient client = new SalesOrderServiceClient();
CallContext context = new CallContext();
context.Company = "CEU";
EntityKey[] readRespKeys = new EntityKey[2];
readRespKeys[0] = new EntityKey();
readRespKeys[0].KeyData = new KeyField[1];
readRespKeys[0].KeyData[0] = new KeyField();
readRespKeys[0].KeyData[0].Field = "SalesId";
readRespKeys[0].KeyData[0].Value = "SO-101268";
readRespKeys[1] = new EntityKey();
readRespKeys[1].KeyData = new KeyField[1];
readRespKeys[1].KeyData[0] = new KeyField();
readRespKeys[1].KeyData[0].Field = "SalesId";
readRespKeys[1].KeyData[0].Value = "SO-101269";
try
{
client.delete(context, readRespKeys);
Console.WriteLine("successful delete record!");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
finally
{
client.Close();
}
Console.ReadKey();
}
}
}
- 运行,发现记录已经被删除
- AIF Operation -- Delete()
- AIF Operation -- Find()
- AIF Operation -- Read()
- AIF Operation -- Create()
- AIF Operation -- findKey()
- Delete Operation for Two Strings
- 583. Delete Operation for Two Strings Medium
- [LeetCode]583. Delete Operation for Two Strings
- 583. Delete Operation for Two Strings
- [leetcode 583] Delete Operation for Two Strings
- [leetcode] 583. Delete Operation for Two Strings
- leetcode583. Delete Operation for Two Strings
- 583. Delete Operation for Two Strings
- 583. Delete Operation for Two Strings
- [leetcode]583. Delete Operation for Two Strings
- leetcode 583. Delete Operation for Two Strings
- [LeetCode] 583. Delete Operation for Two Strings
- 583.Delete Operation for Two Strings
- AIF Operation -- findKey()
- ECLISPE的快捷键大全
- nova-compute的虚拟机创建调度策略
- linux下定时器的实现(select+线程)
- [面试] 在数组查找这样的数,它大于等于左侧所有数,小于等于右侧所有数
- AIF Operation -- Delete()
- 2013年2月7日 故障--都是数据库惹的祸
- 邻接矩阵与邻接表
- 2013互联网行业大会信息
- php 数组 添加元素、删除元素
- js中Number数字相乘后值不对
- php 操作数组 (合并,拆分,追加,查找,删除等)
- javax.script package
- fastboot