Recent posts

#31
Language / Re: Error 117 in Keyed file
Last post by James Zukowski - February 25, 2025, 02:18:15 PM
We're currently on v15.1 (but not for long!). ODBC is not involved in this situation. The file is on one of the server drives.
#32
Language / Re: Error 117 in Keyed file
Last post by kunal.malik - February 25, 2025, 02:11:35 PM
Hi James,

Could you confirm which PxPlus version and ODBC driver version you are using?

I checked the documentation, and this error may occur when running PxPlus versions prior to 4.23 or ODBC driver versions prior to 3.22.
#33
Language / Re: Error 117 in Keyed file
Last post by James Zukowski - February 24, 2025, 04:49:06 PM
Still looking for possible answers. Any ideas?
#34
Programming / functions
Last post by suriakumar - February 22, 2025, 06:37:22 AM
IS it possible to add global functions OR Functions in the REPORT WRITER Library.


Is there anybody knows how to use the following function.  Example code needed. 

SetExpression(Expr$)
SetLibrary(LibraryFile$)
SetTranslationValue(idx,Value$[,isExpression$[,Type$]]
IsTranslationValueExpression(idx)
AddTranslationValue([idx])


Just need more information with example for how to use these commands.
But i am  struggling to add functions.

Is there any way to add this in REPORT WRITER

J.SURIAKUMAR
#35
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.
#36
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 } } } } } }"}
-;
#37
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'.
#38
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 } } } } } }" }

#39
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?
#40
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.