web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Message Queue In GP

(1) ShareShare
ReportReport
Posted on by

HI all,

I'm using Message Queue to send the data to GP.i'm getting XML data in Message Queue.but that customer data(when i try to insert the customer) is not syncing in GP.Please suggest me for this problem .

My code is below :

eConnectType eConnect = new eConnectType(); // Instantiate an eConnectType schema object
XmlSerializer serializer = new XmlSerializer(eConnect.GetType());// Create an XML serializer object
RMCustomerMasterType[] mySmCustomerMaster = { mySMCustomerMaster };
eConnect.RMCustomerMasterType = mySmCustomerMaster;// Populate the eConnectType object with the RMCustomerMasterType schema object
MemoryStream memoryStream = new MemoryStream();// Serialize the object to produce an XML document
serializer.Serialize(memoryStream, eConnect);
memoryStream.Position = 0;
XmlDocument createCustomerDocument = new XmlDocument();
createCustomerDocument.Load(memoryStream);

//Creating the customer entity
// customerResult = eConnectMethod.CreateEntity(sConnectionString, createCustomerDocument.OuterXml);

// HairDirect Customizations //

MessageQueue queue = new MessageQueue(@".\private$\econnect_incoming");
if (!MessageQueue.Exists(@".\private$\econnect_incoming"))
{
MessageQueue.Create(@".\private$\econnect_incoming");
}

Message message = new Message();
ActiveXMessageFormatter formatter = new ActiveXMessageFormatter();
MessageQueueTransaction transaction = new MessageQueueTransaction();
message.Label = "Customer Creation";
message.Body = createCustomerDocument.OuterXml;
message.Formatter = formatter;
queue.Send(message, "Customer XML Data", transaction);
formatter.Write(message, createCustomerDocument.OuterXml);
transaction.Begin();
transaction.Commit();
queue.Close();

 

Please tell me if i miss anything in this code.

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans