|
![]() |
#1 |
Участник
|
У меня просто в тот момент под рукой кода не было, поэтому не опубликовал... Сейчас
X++: if (((DemandStatus == "1. Черновик") || ((DemandStatus == "3. Не согласованно") && (((Key)currLetter.Properties["ownerid"]).Value == ((Key)currLetter.Properties["new_person"]).Value))) && (SendState.Value == true)) { SecurityPrincipal assignee = new SecurityPrincipal(); assignee.Type = SecurityPrincipalType.User; // PrincipalId is some known Guid belonging to the user or team that will own this record. assignee.PrincipalId = new Guid("923D790F-512B-DE11-A2A2-000E0C4BF7BF"); TargetOwnedDynamic dyn = new TargetOwnedDynamic(); dyn.EntityName = "new_business_trip"; dyn.EntityId = ((Key)(entity.Properties["new_business_tripid"])).Value; // Create the request object. AssignRequest assign = new AssignRequest(); // Set the properties of the request object. assign.Assignee = assignee; assign.Target = dyn; // Execute the request. ICrmService KSservice = context.CreateCrmService(true); try { AssignResponse assignResponse = (AssignResponse)KSservice.Execute(assign); } catch (Exception ex) { //TODO: Exceptionhandling } entity = (DynamicEntity)context.InputParameters.Properties[ParameterName.Target]; CrmBoolean CrmTrue = new CrmBoolean(true); entity.Properties["new_send_state"] = CrmTrue; KSservice.Update(entity); } Без последних четырех строчек все выполняется нормально. |
|
![]() |
#2 |
Чайный пьяница
|
Измените
Код: try { AssignResponse assignResponse = (AssignResponse)KSservice.Execute(assign); } catch (Exception ex) { //TODO: Exceptionhandling } Код: try { AssignResponse assignResponse = (AssignResponse)KSservice.Execute(assign); } catch (SoapException ex) { throw new Exception(ex.Detail.InnerText); }
__________________
Эмо разработчик, сначала пишу код, потом плачу над его несовершенством. Подписывайтесь на мой блог, twitter и YouTube канал. Пользуйтесь моим Ultimate Workflow Toolkit |
|
|
За это сообщение автора поблагодарили: Skyway (1). |
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|