epicor自定义函数中调用API接口


无参调用

C# 全选
var paramJson = System.Text.Json.JsonSerializer.Serialize(paramData);
var urlPath = $"/api/{this.callContextClient.CurrentCompany}/Warehouse/List";
var result = this.EfxLib.ZAPIServer.PostEx(urlPath, "");
this.success = result.success;
this.message = result.message;
if(!result.success) 
{
    throw new Ice.Common.BusinessObjectException(new Ice.Common.BusinessObjectMessage(this.message){
            Type=Ice.Common.BusinessObjectMessageType.Error
        });
}

带参数调用

C# 全选
var paramData = this.keys.Split(',').Select(s=>new {
  warehouseCode= s
}).ToList();
var paramJson = System.Text.Json.JsonSerializer.Serialize(paramData);
var urlPath = $"/api/{this.callContextClient.CurrentCompany}/PushDataToTengYi/WarehseSaveOrUpdate";
var result = this.EfxLib.ZAPIServer.PostEx(urlPath, paramJson);
this.success = result.success;
this.message = result.message;
if(!result.success) 
{
  throw new Ice.Common.BusinessObjectException(new Ice.Common.BusinessObjectMessage(this.message){
            Type=Ice.Common.BusinessObjectMessageType.Error
        });
}

获取返回值

C# 全选
var urlPath = $"/api/{this.callContextClient.CurrentCompany}/qibaoxian/RevList";
var result = this.EfxLib.ZAPIServer.PostEx(urlPath, "");
this.success = result.success;
this.message = result.message;
if(!result.success) 
{
    throw new Ice.Common.BusinessObjectException(new Ice.Common.BusinessObjectMessage(this.message){
        Type=Ice.Common.BusinessObjectMessageType.Error
    });
}

this.ds = this.EfxLib.ZAPIServer.ToolsJson2DataSet(result.dataJson);

 

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
张国生
上一篇:Epicor保存前增加校验
下一篇:Epicor Row-Update 给空值
评论列表

发表评论

评论内容
昵称:
关联文章

Epicor在BPM调用定义函数
epicor定义函数调用API接口
Epicor BPM定义代码弹出错误提醒
Epicor Function保存表数据
.NET Core 定义中间件 Middleware
API接口安全设计方案
IIS定义跨域响应头 Access-Control-Expose-Headers
AS.NET Core定义全局访问HttpContext
窗体GridView布局定义
C# 配置文件增加定义节点
TinyMCE定义字体大小列表
网站迁移纪实:从Web Form 到 Asp.Net Core (Abp vNext 定义开发)
东方财富网站接口调用时间戳计算规则
Vue.js如何限制Props只接受特定数组值:定义验证方法解析
基础字典管理功能开发-API接口设计
vue定义组件props设置object属性的默认值:
.NET大型项目开发必备(9)--http请求调用(Post与Get)
C# Winform 定义异常处理方法
Excel定义格式千分符
GZUpdate自动升级之定义更新补丁程序

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码