您可以为此使用CallContext.Properties。
在E10.0的CallContext.Properties是类型Epicor.Utilities.PropertyBag的,和项将被如下访问:现在
//Add
CallContext.Properties.Add("LineRef", LineRef);
// Get
var LineRef = (string)CallContext.Properties["LineRef"];
// Remove
CallContext.Properties.Remove("LineRef");
E10.1 CallContext.Properties是类型的System.Collections中。 Concurrent.ConcurentDictionary,它是一个内置的.NET类型,更好地记录。然而这些方法来添加和删除条目从它有变化如下:
//Add
bool added = CallContext.Properties.TryAdd("LineRef", LineRef);
// Get
var LineRef = (string)CallContext.Properties["LineRef"]; //Note: Do not use .ToString() this converts instead of unboxing.
// Remove
object dummy;
bool foundAndRemoved = CallContext.Properties.TryRemove("LineRef", out dummy);
要使用这个类需要从ContextBoundBase继承和实施的唯一上下文范围构造或者你会得到'Ice.ContextBoundBase<Erp.ErpContext>.ContextBoundBase()' is obsolete: 'Use the constructor that takes a data context'
public partial class MyInvokeExternalMethodThing : ContextBoundBase<ErpContext>
{
public MyInvokeExternalMethodThing(ErpContext ctx) : base(ctx)
{
}
在E10.1中,你可以放入任何类型的对象,所以如果你有一个字符串数组,你不需要使用tilde〜separated〜值的旧技巧。
你知道如何使用CurrentCallContext.CurrentUser吗?我有一个预处理BPM,用于存储更新用户的更新方法。目前,它没有,我不知道为什么,它只是不插入数据。我查看了Epicor文档,但没有运气。我正在使用E10 –
您需要将此作为一个单独的问题来询问,而不是将其添加为对此答案的评论。只要记住用[epicorerp]标记它,并提及您在问题中使用的Epicor ERP版本。 –