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)

Unable to find SMCustomerMasterType Class

(0) ShareShare
ReportReport
Posted on by

Hi guys,

I'm trying to create Customer  by using Microsoft Message Queue Incoming services and i'm using econnect 12.0

and my code is like below.

eConnectType eConnect = new eConnectType();
SMCustomerMasterType CustomerType = new SMCustomerMasterType();

taUpdateCreateCustomerRcd MyCustomer = new taUpdateCreateCustomerRcd();
//Serialization objects
XmlSerializer serializer = new XmlSerializer(typeof(eConnectType));
MemoryStream MemStream = new MemoryStream();
string sCustomerXmlDoc = null;
//Populate the MyCustomer object with data.
var _with1 = MyCustomer;
_with1.CUSTNMBR = "JOEH0001";
_with1.CUSTNAME = "Joe Healy";
_with1.ADRSCODE = "PRIMARY";
_with1.ADDRESS1 = "789 First Ave N";
_with1.CITY = "Rollag";
_with1.STATE = "MN";
_with1.ZIPCODE = "23589";
//Build the XML document
CustomerType.taUpdateCreateCustomerRcd = MyCustomer;
// ERROR: Not supported in C#: ReDimStatement

eConnect.SMCustomerMasterType(0) = CustomerType;
//eConnect.RMCustomerMasterType(0) = customertype;
//Serialize the XML document
serializer.Serialize(MemStream, eConnect);
MemStream.Position = 0;
//Use the Memory Stream to create an xml string
XmlTextReader xmlreader = new XmlTextReader(MemStream);
while (xmlreader.Read)
{
customerxml = customerxml + xmlreader.ReadOuterXml + Constants.vbCr;
}
//Create the MSMQ queue and message objects
MessageQueue MyQueue = new MessageQueue(".\\private$\\econnect_incoming");
Message MyMessage = new Message();
MessageQueueTransaction MyQueTrans = new MessageQueueTransaction();
ActiveXMessageFormatter MyFormatter = new ActiveXMessageFormatter();
//Build the MSMQ message and send it to the queue
MyMessage.Label = "eConnect Test with ActiveXMessageFormatter";
MyMessage.Body = sCustomerXmlDoc;
MyMessage.Formatter = MyFormatter;
MyFormatter.Write(MyMessage, customerxml);
MyQueTrans.Begin();
MyQueue.Send(MyMessage, MyQueTrans);
MyQueTrans.Commit();
MyQueue.Close();

im getting error at SMCustomerMasterType as shown in Red mark in the code.my question is how can i use the SMCustomerMasterType  class in my code.I gave the reference econnect classes and systm.messageing even though im geting the error.please give me any ideas ?.

Thanks and Regards,

Pavan G.

*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