Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

how to get attechment from custTable in WCF Service

$
0
0

i want to get all customer detail and attachment from all customer through create getdetail aif service how i get into visual studio. my code of service class of visual studio is below.

public ResponseCustomer getCustomerDetails(RequestCustomer reqCust)

        {

 

            List<Customer> customerResponseList = null;

            List<resAttachment> resAttachmentList = null;

 

            try

            {

 

                CallContext callContextC = new CallContext();

                callContextC.Company = reqCust.CompanyId;

 

 

                Np_CustomerRequest npCustReq = new Np_CustomerRequest();

                npCustReq.AccountNo = reqCust.AccountNum;

 

                Np_CustAttachment custAttachment = new Np_CustAttachment();

 

                Np_ContactServiceClient clientC = new Np_ContactServiceClient();

                var Arr = clientC.getCustomerDetails(callContextC,npCustReq);

 

                customerResponseList = Arr.Select(customer => new Customer()

                {

                  

                   AccountNum = customer.AccountNum,

                   Email = customer.EMail,

                   Name  = customer.Name,

                   CustGroup = customer.CustGroup,

                   City   = customer.City,

                   District = customer.DistrictName,

                   State = customer.State,

                   Country = customer.County,

                   Phone = customer.Phone,

                   Fax = customer.Fax,

                  

                   Attachment = customer.CustAttachment.Select(attach => new resAttachment()

                   {

                       TypeId = attach.TypeId,

                       DocName = attach.Name,

                       DocNotes = attach.Notes,

                   })

                  

                  

                }).ToList();

 

 

            }

 

 

            catch (Exception e)

            {

                //throw System.Exception.Equals();

            }

 

            var responseC = new ResponseCustomer()

            {

                customerList = customerResponseList,

 

            };

 

 

 

            return responseC;

 

 

          

           

   

 

        }


Viewing all articles
Browse latest Browse all 72043


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>