AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 12.05.2010, 01:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
emeadaxsupport: MS Project Integration resources with comma fail to export
Источник: http://blogs.msdn.com/emeadaxsupport...to-export.aspx
==============

During my investigation of Dynamics Ax Project Integration functionality I run into following problem. When a resource (in my case Employee) has a ‘,’ (comma) in its name (field DirPartyTable,Name and this resource get synchronize with Ms Project Server the export will fail with error:

An error occurred while creating the Employee compound entity of EntityId:e6365f25-7485-46d5-8e4c-65cb480fac34, Name:"Name, Surname" in project server.
Error: System.Web.Services.Protocols.SoapException: ProjectServerError(s) LastError=ResourceNameInvalid Instructions:
Pass this into PSClientError constructor to access all error information at Microsoft.Office.Project.Server.WebService.Resource.CreateResources(ResourceDataSet rds, Boolean validateOnly, Boolean autoCheckIn) PSCLientError Output: ResourceNameInvalid

When we looked further it happens that MS Project Server does not allowed resources with comma sign in name (http://technet.microsoft.com/en-us/l.../cc197599.aspx). So either we should rename resource or does not allowed such a resource to be integrated. Below you can find the code sample which gived user the error message that resource with sign ',' cannot be synchronize with Project Server. The message will be shown when user selects checbox "Integrate to Project Server" is selected. You need to change: AOT\ Data Dictionary \ Tables\SyncEmplTable in method validateProjServerProperties

from :

private boolean validateProjServerProperties()
{
SyncEmplTable syncEmplTable;
SyncApp syncApp;
EmplTable emplTable, emplTableSameName;
DirPartyTable dirPartyTable, dirPartyTableSameName;
;
syncApp = SyncApp::find(this.AppId);
emplTable = EmplTable::find(this.EmplId);
dirPartyTable = DirPartyTable::find(emplTable.PartyId);
if(syncApp && syncApp.AppType == SyncAppType::ProjectServer)
{ // Check that an integrated employee with the same name as this integrated employee being updated does not exist
select emplTableSameName where emplTableSameName.EmplId != emplTable.EmplId join syncEmplTable
where syncEmplTable.EmplId == emplTableSameName.EmplId
join dirPartyTableSameName
where dirPartyTableSameName.PartyId == emplTableSameName.PartyId &&
dirPartyTableSameName.Name == dirPartyTable.Name
join syncApp
where syncApp.AppId == syncEmplTable.AppId && syncApp.AppType == SyncAppType::ProjectServer;
if(emplTableSameName)
{ // Employee %1 cannot be integrated to project server. An employee with the same name has already been integrated to project server. // Project server does not allow more than one employee with the same name.
checkFailed(strfmt("@SYS113508", this.EmplId));
return false;
}
}
return true;
}


to

private boolean validateProjServerProperties()
{
SyncEmplTable syncEmplTable;
SyncApp syncApp;
EmplTable emplTable, emplTableSameName;
DirPartyTable dirPartyTable, dirPartyTableSameName;
;
syncApp = SyncApp::find(this.AppId);
emplTable = EmplTable::find(this.EmplId);
dirPartyTable = DirPartyTable::find(emplTable.PartyId);
if(syncApp && syncApp.AppType == SyncAppType::ProjectServer)
{ // Check that an integrated employee with the same name as this integrated employee being updated does not exist
select emplTableSameName where emplTableSameName.EmplId != emplTable.EmplId join syncEmplTable
where syncEmplTable.EmplId == emplTableSameName.EmplId
join dirPartyTableSameName
where dirPartyTableSameName.PartyId == emplTableSameName.PartyId &&
dirPartyTableSameName.Name == dirPartyTable.Name
join syncApp
where syncApp.AppId == syncEmplTable.AppId && syncApp.AppType == SyncAppType::ProjectServer;
if(emplTableSameName)
{ // Employee %1 cannot be integrated to project server. An employee with the same name has already been integrated to project server. // Project server does not allow more than one employee with the same name.
checkFailed(strfmt("@SYS113508", this.EmplId));
return false;
}
//code added
if (strFind(emplTable.name(), ',',1,strLen(emplTable.name())))
{
checkFailed(strfmt("Project serever does not allow , sign", emplTable.name())); //you may change first string with created label
return false;
}
//end of code added
}
return true;
}




Источник: http://blogs.msdn.com/emeadaxsupport...to-export.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: Project module Excel pivot table fails with error 0x80070057 E_INVALIDARG Blog bot DAX Blogs 0 10.05.2010 21:05
emeadaxsupport: Export to Excel can fail on a Windows Terminal Server Blog bot DAX Blogs 0 27.01.2010 13:05
emeadaxsupport: How does the Export to Excel feature work under the hood? Blog bot DAX Blogs 0 07.09.2009 19:05
MS CRM 4.0 и MS Project Dekan Dynamics CRM: Функционал 6 13.05.2009 09:39
Требуется специалист по продуктам MS (Sharepoint и Project Server) mgotal Рынок труда Microsoft Dynamics 0 05.04.2006 14:06

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 15:04.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.