1

I'm triying to get PriceLevelId value from a Product entity. I used a ColumSet to retrieve product value but PriceLevelId is stored in a related Entity and I'm not able to retrieve this ID value.

Can anyone some tip gimme me? (I'm a new developer in CRM area)

Thanks, Ben.

4

1 回答 1

1

您的问题还不够清楚,但是如果您想从插件中的 c# 代码中获取 priceLevel 实体,您可以像下面这样获得它:

// I am assuming you already have 'priceId' 
var price = (from p in _context<new_priceEntity>CreateQuery()
             where p.id = priceId
             select p).FirstOrDefault();

//Price level Id is:
var priceLevelId = price.new_priceLevelId.Id;

// get Price value
var priceLevel = (from p in _context<new_priceLevelEntity>CreateQuery()
                  where p.id = priceLevelId 
                  select p).FirstOrDefault();
于 2013-10-09T16:15:29.480 回答