2014-04-16 63 views

回答

1

也許這可能對你有幫助。

Guid entityid = Guid.Empty; 

if (context.MessageName == MessageName.Close) 

{ 

DynamicEntity entity = context.InputParameters[ParameterName.Target] as DynamicEntity; 

string keyfieldname = string.Format("{0}id", entity.Name); 

if (entity.Properties.Contains("activityid")) 

keyfieldname = "activityid"; 

entityid = ((Key)entity[keyfieldname]).Value; 

} 

參考:http://social.microsoft.com/Forums/en-US/c8776e1b-5b80-480d-8ce7-d4e61e3cc3bb/get-current-record-id-using-plugin?forum=crmdevelopment

相關問題