Skip to Content

How can I get Sales Unit of Employee Responsible by Code ?

Hi expert ,

I am using Web-services to create SO.

<soapenv:Envelope xmlns:soapenv="" xmlns:glob="" xmlns:yaq="" xmlns:yhc="" xmlns:glob1="" xmlns:yks="" xmlns:y52="" xmlns:a2r="" xmlns:ykp="">
            <Item actionCode="01">
               <ItemScheduleLine actionCode="01">

But the Sales Unit is not correct, I need to get the sales Unit from Employee Responsible.

if (this.EmployeeResponsibleParty.IsSet())
	var em = this.EmployeeResponsibleParty.Party.Employee.EmployeeSalesResponsibility.GetFirst().SalesOrganisationID;
} // return null

How can I query the sales Unit of Employee Responsible ?



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jun 06, 2019 at 09:13 AM

    Hi Quyen,

    Please try this path to get correct sales unit. Then set to your sales unit in logic.

    if (this.EmployeeResponsibleParty.IsSet()) {
    	foreach(var emp in this.EmployeeResponsibleParty.Party.Employee.Position) {
    		if(emp.CurrentSuperordinateReportingLineUnit.IsSet()) {
    			var salesUnit = emp.CurrentSuperordinateReportingLineUnit.ID;
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.