0

I'm facing a problem when I try to grab the Extended Amount Attribute inside the Opportunity Product Line Entity. As follows my requirements are that upon creation of a an Opportunity Product Line I have a post-create plugin on it which applies a discount onto the extended amount and creates another line, with the new discounted extended amount. When I try to output the value on another field just to check what it gets, I keep getting 0 strangley. My code is as follows:

// 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);

Is it even possible to grab the amount? Would really much appreciate if someone could help me out here. Thanks in advanace.

4

1 回答 1

2

创建后,您要添加一个帖子图像。然后引用帖子图像而不是目标。

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");
}
于 2012-06-22T17:48:29.907 回答