EmployeePayroll Details

4 REPLIES
Contributing Partner Buda56
7 Posts
Contributing Partner
Buda56
Contributing Partner

7Posts

0Kudos

2Solutions

Re: EmployeePayroll Details

Jack,

    Thanks for the reply, I have removed the Select param as suggested and also downloaded Postman to have a look at the API.

 

I have debugged on both the employees and emp objects, I was hoping it would be a bit like .Net where you could expand out child object to view them. Unfortunately it doesn't so as per my previous post I and getting a list of employees, looping through each employee in the list and calling a "get" to return the EmployeePayrollDetails information.

From this it will then update or insert data into an external repository from these objects for later use.

 

Regards

Peter

MYOB Staff Post DeveloperJack
90 Posts
MYOB Staff Post
Australia
DeveloperJack
MYOB Staff Post

90Posts

26Kudos

13Solutions

Re: EmployeePayroll Details

Hi there @Buda56,

 

We don't actively support/implement the $select param so that will be ignored. Given that you're not paginating you could also remove those params too.

 

As far as the EmployeePayrollDetailsService goes, on the surface, nothing jumps out as immediately incorrect.

 

I'd recommend attaching a debugger and double checking the exact value/object of both 'employees' and 'emp' as you step through the execution. I'm wondering if (for some reason) the API might be returning you an empty list of employees and therefore the loop doesn't execute?

 

The best way to debug this is to first double check that the API is returning the results you expect by using a tool like Postman etc. and then reproduce those calls via the SDK.

 

Lastly, since the EmployeePayrollDetailsService extends (eventually) the ReadableRangeService I believe you can also iterate directly through a .Get() of all the EmployeePayrollDetails resources without having to first retrieve the Employee resource.

 

If all else fails, best reach out to developers@myob.com with your debugging, any relevant screenshots ( so we can see the debugging) and the HTTP logs and we can take a closer look for you.

 

Cheers!

Jack

 

 

Jack Skinner
MYOBapi Evangelist

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/
Contributing Partner Buda56
7 Posts
Contributing Partner
Buda56
Contributing Partner

7Posts

0Kudos

2Solutions

Accepted Solution Solved Solution

Re: EmployeePayroll Details

Hi,

    From Australia and devloping against 2017.2 SE. I have managed to be able to return the Employee Payroll Details information, not sure it is the correct eway but it works (see code below). If there is a better way then please advise.

 

                DboUserDetail usr = new DboUserDetail();
                EmployeePayrollDetailsService prd = new EmployeePayrollDetailsService(config);
                companyFile = (CompanyFile)lueCompany.GetSelectedDataRow();
                var credentials = new CompanyFileCredentials("Administrator", "");
                var employeeService = new EmployeeService(config);
                var employees = employeeService.GetRange(companyFile, "$Top=0&$Skip=0&$Select=*", credentials);

 

                foreach (var emp in employees.Items)
                {
                    string state = string.Empty;

                    var payroll = prd.Get(companyFile, emp.EmployeePayrollDetails.UID, credentials);

                    if (emp.Addresses.Count() > 0)
                    {
                        var address = emp.Addresses.ElementAt(0);
                        state = address.State;
                    }
                }

 

Regards

Peter

Ultimate Partner ronatbas
4,184 Posts
Ultimate Partner
Australia
ronatbas
Ultimate Partner

4184Posts

2964Kudos

655Solutions

Re: EmployeePayroll Details

@Buda56

 

Which country are in and which MYOB are you using? Some of your comments don't ring any bells wtih Oz users so i am assuming NZ

Ron B
BAS Group
03 95588477

info@basgroup.com.au
Making MYOB work for you
Contributing Partner Buda56
7 Posts
Contributing Partner
Buda56
Contributing Partner

7Posts

0Kudos

2Solutions

Solved: Go to Solution

EmployeePayroll Details

Hi,

   Can someone please assist me in trying to return an employees payroll details, I have returned the applicable employee and can see the employeePayroleDetailsLink asa part of the employee details but need some assistance in return the details from the employeePayroleDetailsLink ?.

 

How do I call this link?

 

Regards.

Peter

Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post