Closed Email Activity in Microsoft CRM Customization- Software > 대전 Q&A

본문 바로가기
사이트 내 전체검색


회원로그인

대전 Q&A

상담완료 | Phillip님의 문의

페이지 정보

작성자 Phillip 작성일24-07-31 07:22 조회18회 댓글0건

본문

이름 : Phillip
이메일 : phillipsessums@yahoo.com
연락처 :
예식일 : Closed Email Activity in Microsoft CRM Customization- Software
문의내용:

Microsoft's CRM is a Salesforce replacement and an attempt to capture market share from Siebel, Oracle, and other standard Client Relationship Management System vendors. Microsoft CRM uses all the range of Microsoft new solutions:. Online, MS Exchange, MS Outlook, MS SQL Server, Replication, Indexing, Active Directory, Windows 2000/2003 safety design, C#, VB. Online, HTML, XML Web Service, XLTP, Browser to name a few.

Action of email type programming is the topic of yesterday's discussion; you typically deal with these customizations when Microsoft Exchange CRM connection is improved. This is the primary conversation topic, and how do you create closed activities? We'll apply C#. Online scripting

One of our Exchange Event Handler/Sink's jobs involves creating MS CRM Closed Activity, which handles bothincoming and cheerful email communications. Using the MS CRM SDK to handle inbound and outbound XML information and allowing immediate access to the Microsoft CRM databases, Microsoft CRM interacts with both. This first look at the Finished Action design engine:

1. First we need to know the entity we need to create activity for: Account, Lead or Contact. The choice may use a particular set of criteria, such as email address, in our situation:

if ( ( crmAccount = crmConnector. GetAccount( mailbox From ) )! = null )

}

else if ( ( crmContact = crmConnector. GetContact( mailbox From ) )! = null )

}

else if ( ( crmLead = crmConnector. GetLead( mailbox From ) )! = null )

}

2. Then we have to find GUID of MS CRM users, who owns this object, C# script like this:

crmUser = crmConnector. GetUser( crmAccount. GetOwnerId( ) );

3. Next stage is closed Exercise development:

emailId = crmConnector. CreateEmailActivity (

crmUser.GetId(),

Microsoft. Crm. Program. Forms. ObjectType. otAccount, crmAccount. GetId( ),

Microsoft. Crm. Program. Forms. ObjectType. otSystemUser, crmUser. GetId( ),

crmAccount. GetEmailAddress( ), crmUser. GetEmailAddress( ), sSubject, sBody );

4. The process to create closed action:

public Guid CreateEmailActivity( Guid userId, int fromObjectType, Guid fromObjectId, int toObjectType, Guid toObjectId, string mail From, string mailTo, string subject, string body )

try

register. Debug(" Prepare for Mail Activity Creating" );

// BizUser proxy thing

Microsoft. Crm. Software. Vpn. BizUser bizUser = fresh Microsoft. Crm. Program. Vpn. BizUser( );

ICredentials credentials = new NetworkCredential(sysUserId, sysPassword, sysDomain );

bizUser. Url = crmDir+" BizUser. fs";

bizUser. Qualifications = certificates;

Microsoft. Crm. System. Surrogate. CUserAuth userAuth = bizUser. WhoAmI( );

// CRMEmail proxy thing

Microsoft. Crm. Program. Vpn. CRMEmail internet = fresh Microsoft. Crm. Software. Surrogate. CRMEmail( );

message. Certificates = qualifications;

contact. Url = crmDir + "CRMEmail. converter";

// Laid up the XML series for the task

strActivityXml ="" in wire;

strActivityXml + ="";

strActivityXml + ="" )+" ] ] >";

strActivityXml + ="";

strActivityXml + = userId. ToString (" B" ) +"";

strActivityXml + ="";

// Laid up the XML series for the task parties

strPartiesXml ="";

strPartiesXml + ="";

strPartiesXml + ="" + mailTo +"";

if ( toObjectType = = Microsoft. Crm. Software. Forms. ObjectType. otSystemUser )

strPartiesXml + ="" + Microsoft. Crm. System. Forms. ObjectType. otSystemUser. ToString( ) +"";

}

else if ( toObjectType = = Microsoft. Crm. Program. Forms. ObjectType. otAccount )

strPartiesXml + ="" + Microsoft. Crm. System. Forms. ObjectType. otAccount. ToString( ) +"";

}

else if ( toObjectType = = Microsoft. Crm. Software. Forms. ObjectType. otContact )

strPartiesXml + ="" + Microsoft. Crm. Program. Forms. ObjectType. otContact. ToString( ) +"";

}

else if ( toObjectType = = Microsoft. Crm. Software. Forms. ObjectType. otLead )

strPartiesXml + ="" + Microsoft. Crm. System. Forms. ObjectType. otLead. ToString( ) +"";

}

strPartiesXml + ="" + toObjectId. ToString (" B" ) +"";

strPartiesXml + ="";

strPartiesXml + = Microsoft. Crm. System. Forms. ACTIVITY_PARTY_TYPE. ACTIVITY_PARTY_TO_RECIPIENT. ToString( );

strPartiesXml + ="";

strPartiesXml + ="";

strPartiesXml + ="";

strPartiesXml + ="" + mailFrom +"";

if ( fromObjectType = = Microsoft. Crm. Program. Forms. ObjectType. otSystemUser )

strPartiesXml + ="" + Microsoft. Crm. System. Forms. ObjectType. otSystemUser. ToString( ) +"";

}

else if ( fromObjectType = = Microsoft. Crm. System. Forms. ObjectType. otAccount )

strPartiesXml + ="" + Microsoft. Crm. System. Forms. ObjectType. otAccount. ToString( ) +"";

}

else if ( fromObjectType = = Microsoft. Crm. Program. Forms. ObjectType. otContact )

strPartiesXml + ="" + Microsoft. Crm. Program. Forms. ObjectType. otContact. ToString( ) +"";

}

else if ( fromObjectType = = Microsoft. Crm. Software. Forms. ObjectType. otLead )

strPartiesXml + ="" + Microsoft. Crm. System. Forms. ObjectType. otLead. ToString( ) +"";

}

strPartiesXml + ="" + fromObjectId. ToString (" B" ) +"";

strPartiesXml + ="";

strPartiesXml + = Microsoft. Crm. System. Forms. ACTIVITY_PARTY_TYPE. ACTIVITY_PARTY_SENDER. ToString( );

strPartiesXml + ="";

strPartiesXml + ="";

strPartiesXml + ="";

log.Debug(strPartiesXml);

// Create the e-mail image

Guid emailId = fresh Guid(email. Create(userAuth, strActivityXml, strPartiesXml ) );

gain emailId;

}

get ( System. Web. Services. Techniques. Exception electronic )

logs. Debug( "ErrorMessage:" + electronic. Communication +"" + e. Detail. OuterXml+" Supply:" + e. Cause );

}

catch ( Exception e )

logs. Debug(e. Information+" \r

" + electronic. StackTrace );

}

return new Guid( );

}

5. You must set up the activity's flags in accordance with MS CRM standards in order to make the newly created exercise display properly:

public void UpdateActivityCodes( Guid emailId )

try

OleDbCommand order = con. CreateCommand( );

demand. CommandText = "UPDATE ActivityBase SET DirectionCode = ( )" ), StateCode = (? ), PriorityCode = (? ) WHERE ActivityId = (? )";

command.Prepare();

control. Guidelines. Add( new OleDbParameter (" DirectionCode", Microsoft. Crm. Program. Forms. EVENT_DIRECTION. ED_INCOMING) );

control. Criteria. Add( new OleDbParameter (" StateCode", Microsoft. Crm. System. Forms. ACTIVITY_STATE. ACTS_CLOSED) );

control. Criteria. Add( new OleDbParameter (" PriorityCode", Microsoft. Crm. Program. Forms. PRIORITY_CODE. PC_MEDIUM) );

control. Guidelines. Add( new OleDbParameter ("ActivityId", emailId ) );

register. Debug(" Prepare to update exercise code" + emailId. ToString (" B" )+" in ActivityBase" );

command.ExecuteNonQuery();

}

catch( Exception e )

logs. Debug(e. Information+" \r

" + electronic. StackTrace );

}

}

public void UpdateActivity QueueCodes( Guid emailId, Guid queueId )

try

OleDbCommand order = con. CreateCommand( );

control. SET Priority = ( )" SET CommandText = "UPDATE QueueItemBase SET Priority = ( )" ), State = (? ), QueueId = (? ) WHERE ObjectId = (? )";

command.Prepare();

control. Criteria. Add( new OleDbParameter (" Priority", Microsoft. Crm. Software. Forms. PRIORITY_CODE. PC_MEDIUM) );

order. Criteria. Add( new OleDbParameter (" State", Microsoft. Crm. Program. Forms. ACTIVITY_STATE. ACTS_CLOSED) );

control. Criteria. Add( new OleDbParameter (" QueueId", queueId ) );

order. Guidelines. Add( new OleDbParameter ( "ObjectId", emailId ) );

logs. Debug(" Prepare to update task queue password" + emailId. ToString (" B" )+" in QueueItemBase" );

command.ExecuteNonQuery();

}

catch( Exception e )

logs. Debug(e. Information+" \r

" + electronic. StackTrace );

}

}

Happy customizing, implementing and customization modifying! If you want us to do the task- give us a call 1-866-528-0577! support @albaspectrum. web

  • 페이스북으로 보내기
  • 트위터로 보내기
  • 구글플러스로 보내기

댓글목록

등록된 댓글이 없습니다.


접속자집계

오늘
2,831
어제
2,901
최대
6,537
전체
464,708
그누보드5
회사소개 개인정보취급방침 서비스이용약관 Copyright © 소유하신 도메인. All rights reserved.
상단으로