当我试图获取Opportunity Product Line实体中的Extended Amount属性时,我遇到了一个问题。如下所示,我的要求是在创建商机产品线时,我在其上有一个创建后插件,该插件将折扣应用于扩展金额,并使用新的折扣扩展金额创建另一行。当我试图在另一个字段上输出值,只是为了检查它得到了什么,我总是得到0奇怪的结果。我的代码如下:
// Part where I grab the value
Entity entity = (Entity)context.InputParameters["Target"];
Money extenedAmount = (Money)entity["baseamount"];
//Create new line
Entity oppportunity_product = new Entity("opportunityproduct");
oppportunity_product["manualdiscountamount"] = extenedAmount;
service.Create(oppportunity_product);有没有可能拿到这笔钱?如果有人能帮我的话我会很感激的。提前谢谢你。
发布于 2012-06-23 01:48:30
创建完成后,您需要添加一个post镜像。然后引用post图像而不是目标。
if (context.PostEntityImages.Contains("PostImage") &&
context.PostEntityImages["PostImage"] is Entity)
{
postMessageImage = (Entity)context.PostEntityImages["PostImage"];
}
else
{
throw new Exception("No Post Image Entity in Plugin Context for Message");
}https://stackoverflow.com/questions/11160383
复制相似问题