Recent posts

#91
Programming / Re: REST to GRAPHQL
Last post by Ron Klassen - February 21, 2025, 04:43:43 PM
You've been a big help Loren. I appreciate all the tips and insights.
#92
Programming / Re: REST to GRAPHQL
Last post by Loren Doornek - February 21, 2025, 03:08:59 PM
Yes, you always need to escape the quotes if they are internal to the query.  (Your original post on the query has escaped the quotes before and after the GID.)

The PXPlus JSON parser will generally handle the escaping for you, if you just build the query with the quotes in it.  Below is an example of the code I used.  Note that I did NOT escape the quotes, but they are there in the JSON because I created the JSON using the DIM(LIST ) functionality of PXPlus, and it properly escapes any necessary characters.

Also note that, when building the query string, I use two quotes together quite a bit (see line 20).  That just tells PVXPlus to include the quote in the string you are building, rather than treating the quote as the end of the string.  A lot of people don't know that trick, so I'm pointing it out just in case you have trouble deciphering line 20 of the code below.

0010 LET gid$="gid://shopify/InventoryItem/33749329936442"
0020 LET query$="query { inventoryItem (id: """+gid$+""") { id inventoryLevels(first:2) { edges { node { id location { id name } quantities(names: [""available"",""on_hand""]) { name quan
0020:tity } } } } } }"
0030 LET qry$["query"]=query$; LET post$=DIM(LIST qry${ALL})
0040 PRINT post$

-;run

{"query":"query { inventoryItem (id: \"gid://shopify/InventoryItem/33749329936442\") { id inventoryLevels(first:2) { edges { node { id location { id name } quantities(names: [\"available\"
,\"on_hand\"]) { name quantity } } } } } }"}
-;
#93
Programming / Re: REST to GRAPHQL
Last post by Ron Klassen - February 21, 2025, 02:01:04 PM
Thanks Loren, that was the key. So, do I have to 'escape' quotes whenever I use them?
Strange that none of the examples I've seen had the quotes 'escaped'.
#94
Programming / Re: REST to GRAPHQL
Last post by Loren Doornek - February 21, 2025, 12:48:48 PM
you need to 'escape' the quotes around "available" by putting a backslash in front of them.  Try the example below.  I added the \ before the quotes, and also added a second inventory quantity so that you can see how the additional quantities can be requested.

{"query":"query { inventoryItem ( id: \"gid://shopify/InventoryItem/41450849599575\") { id inventoryLevels(first:2) { edges { node { id location { id name } quantities(names: [\"available\",\"on_hand\"]) { name quantity } } } } } }" }

#95
Language / Error 117 in Keyed file
Last post by James Zukowski - February 21, 2025, 10:35:30 AM
This week, we had an error #117 show up in one of our files that processes thousands of records in and out on any given day. We were able to recover what looks like all of the data in the file using the PxPlus utility.
Are there any insights as to why this would show up?
#96
Programming / Re: REST to GRAPHQL
Last post by Ron Klassen - February 21, 2025, 10:32:35 AM
I'm having a lot of trouble with the 'quantities' field in the InventoryItem section to work. For example, the following works fine:

{ "query": "query { inventoryItem(id:\"gid://shopify/InventoryItem/41450849599575\") { id inventoryLevels(first:2) { edges { node { id location { id name } } } } } }" }

However, if I insert the quantities logic:

{ "query": "query { inventoryItem(id:\"gid://shopify/InventoryItem/41450849599575\") { id inventoryLevels(first:2) { edges { node { id location { id name } quantities(names: ["available"]) { name quantity } } } } } }" }

The response from the query is 'Bad Request'.

I've taken this logic from numerous examples I've found, and I've no clue as to why it doesn't work.

Any ideas would be welcome.

#97
ODBC / Re: Access DB Connect
Last post by Michael Greer - February 21, 2025, 10:03:22 AM
Ok.  I was able to access the design view for the table in question *and* the one that worked.  The one failing had a lookup defined.  When I had the Access developer remove that lookup I was able to get a good open.  Thought others might like to know.
#98
Thin Client/WindX / Re: Windx on a MAC
Last post by Devon Austen - February 21, 2025, 08:09:25 AM
It should be possible.

If you can install Windows you should be able to run PxPlus.

Now I think it is running a arm version of Windows so PxPlus would be running via Windows x86 emulation so may not run as fast as if it was running natively on a x86 machine. Although the hardware is fast itself so that may more then make up for it.
#99
ODBC / Access DB Connect
Last post by Michael Greer - February 20, 2025, 04:29:09 PM
I have an Access DSN (user, I would love to know if anyone has successfully set up an Access System DSN).  This open works:

0220 open (hfn,iol=*,err=9010)"[ODB]TearDownLive;ReceiptTable;key=CoreItemCheckDigit"; in=lfo

But this throws an error 80 - Invalid key definition, number or name.

0220 open (hfn,iol=*,err=9010)"[ODB]TearDownLive;OutInventTable;key=CoreItemCheckDigit"; in=lfo

The person who developed the access tables says they are the same.  Any insight here would be appreciated.  This was supposed to be the easy part :).
#100
Thin Client/WindX / Re: Windx on a MAC
Last post by HendersonS - February 19, 2025, 01:54:55 PM
Hi,

Is it possible to run pxplus using Windows in parallels with the Apple M chip?

Regards,
HendersonS