Jump to content

EmployeeQuery: How to get EmployeePayrollInfo?


This topic is 1349 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm working on pulling Employee information from Quickbooks into FileMaker.  I have most of the query working.  I'm trying to get the information for

PayrollItemWageRef::FullName and rate.  The image below shows the information from SDK.    What should the syntax be for PCQB_rsGetFirstFieldValue?

Assistance with this would be greatly appreciated.

Thanks

Bruce Herbach

image.thumb.png.e13e55f4598b09f15ecbef870c136f3c.png

 

Link to comment
Share on other sites

The Earnings node may repeat, so you'll need to use PCQB_RsOpenFirstRelatedRecord and PCQB_RsOpenNextRelatedRecord to walk through them and get the values you want from each iteration.

PCQB_rsGetFirstFieldValue ( PayrollItemWageRef::FullName ) and PCQB_rsGetFirstFieldValue ( Rate ) should get the values you need. (I say "should" because I'm not positive--I work with raw xml and XPath.)

Are you looking for values from all repetitions of Earnings, or just a particular one or two? If it's just one and you already know how to apply XPath filters, that's faster than looping through the iterations of Earnings you don't care about.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC 28105
704.814.6852

Link to comment
Share on other sites

Geoffrey,

I may be looking at the wrong field.  When I look at the Employee in QuickBooks,  I have a portal on the Payroll Info tab labled Earnings.  It has two columns,  Item Name and Hourly/Annual Rate.  These are the two fields I want.

When I tried this with PCQB_RsOpenFirstRelatedRecord, and PCQB_RsOpenNextRelatedRecord,  I get an error Code 1000.  If I leave out these commands,  using  PCQB_SgetStatus,  when the result is empty it reports Code 0.

Thanks very much for your assistance.

Bruce Herbach

 

Link to comment
Share on other sites

It's been a long time since I looked at Payroll via the API. It's possible that the Response doesn't contain the data you want. Are you logging into QB via an Admin credential? and does the plug-in have permission to putt "sensitive data" ?

It might be useful to use PCQB_SGetXML( "Response" ; "" ) to see everything that's being returned and confirm that the Earnings node is present.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated

14000 Creekside Drive
Matthews, NC 28105
704.814.6852

Link to comment
Share on other sites

Geoffrey,

I'll give that a try.

Do you have an example file using XML to download all Customers and upload a customer?  I have been using the API version.  Although new to working with QuickBooks it is very similar to other plugins I have worked with.

Thanks very much

Bruce Herbach

Link to comment
Share on other sites

Hey Bruce--

I don't have an example file. What I meant was that I don't use the PCQB_Rq... or PCQB_Rs... functions to create a Request or parse a Response, preferring to build a Request using a process I came up with years ago. I use the PCQB_Z functions to Execute it, and the PCQB_ZParseXML function to process the Response data. When processing a QB Report or a multi-record Query Response, Xpath filtering is awesome.

Using PCQB_SGetXML you can see all the elements of a Request or Response at one time, which is especially useful when digging into problems that may hinge on the presence or absence of an element's value. That's especially true when working with potentially "sensitive" elements like SSN, CC numbers, and wage/payroll data. QB's documentation is mistaken in several places, and it sometimes implies that an elements will appear in a Response when it does not.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC 28105
704.814.6852

Link to comment
Share on other sites

Geoffrey,

Very helpful.  Thanks much.    I'll look at using the PSQB_Z functions.  When I ran the PCQB_SGetXML function,  the result did not have the Earnings section I was looking for which of course explained the errors and blank responses I was getting.

I understand that this request maybe above and beyond so please understand no is a perfectly acceptable answer.  Would you be willing to share an example of your process for building a request?

Again thanks very much for all of the help.  I'm new to working with Quick Books and have made a fair amount of progress with the project I'm working on.  The help and suggestions here have been incredibly helpful

Bruce Hebach

 

Link to comment
Share on other sites

Hey Bruce—

I can't provide an example because my process is built into a "black box" file that I use as middleware between a client solution and QB. That file is the result of many projects that iteratively improved it, and it has hundreds of development hours in it. I started a basic outline of how it works on the Request side, and realized you'd be much better off using the normal functions to create Requests.

Responses, though, are a different matter. The PCQB_Rs functions work fine for simple integrations, but parsing the Response from a complex Query or a Report is much more powerful—and I'd argue, faster to develop—using XPath parsing.

An Invoice Query Response that includes LineItems could apply an XPath filter to return a list of the FullName values of every non-taxable LineItem that had an Amount >= $100, for example. One line of code.

An Invoice Query Response that includes LinkedTxns could do the same to determine all payment method(s) or payment amounts. One line of code.

Super helpful whenever there may be multiple iterations of a node but you only care about an identifiable subset of them.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC 28105
704.814.6852

Link to comment
Share on other sites

This topic is 1349 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.