1
- 가능합니까?
- MS Dynamics 4.0은 웹 서비스 API를 제공합니까? 은 요청되는 것을 잠재적으로 수행 할 수 있습니까?
- 테이블과 행을 문서를 내보낼 데이터가 포함되어 있고 관련 메타 데이터를 식별 할만큼 데이터베이스 스키마가 정확합니까?
- CRM의 "Annotation"엔티티에 첨부 파일이 으로 저장되어있는 것이 정확합니까?
Annotation
엔터티 documentbody
필드에 저장되며 데이터는 Base64 문자열로 인코딩됩니다.2011 버전으로 대부분 이전 버전과 호환되어야하며 주요 사항을 다룹니다.
http://woodsworkblog.wordpress.com/2012/07/28/exporting-annotation-note-attachment/
public void ExportDocuments(IOrganizationService service, String filePath)
{
String fetch = @"<fetch mapping='logical' count='100' version='1.0'>
<entity name='annotation'>
<attribute name='filename' />
<attribute name='documentbody' />
<attribute name='mimetype' />
</entity>
</fetch>";
foreach (Entity e in service.RetrieveMultiple(new FetchExpression(fetch)))
{
if (!String.IsNullOrWhiteSpace(e.Attributes["documentbody"].ToString()))
{
byte[] data = Convert.FromBase64String(e.Attributes["documentbody"].ToString());
File.WriteAllBytes(filePath + e.Attributes["filename"].ToString(), data);
}
}
}