Querying Jobs for a Customer - intuit-partner-platform

I'm trying to query Jobs for a specific Customer, but am running into a little issue. It appears that the ParentRef is not queryable:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-02-19T10:20:31.635-08:00">
<Fault type="ValidationFault">
<Error code="4001">
<Message>Invalid query</Message>
<Detail>QueryValidationError: property 'ParentRef' is not queryable</Detail>
</Error>
</Fault>
</IntuitResponse>
However, that's the only thing I can think of to limit the query on the server-side. In the old world, we submitted a Filter of CustomerId :EQUALS: #{id} to the Jobs API, but now the Customer/Job APIs have been combined. My v3 query is SELECT * FROM Customer WHERE Job = true AND ParentRef = '#{id}' which seems like a reasonable thing to do.
Am I missing something? Could you allow us to query on ParentRef?

Something like this works OK:
SELECT * FROM Customer WHERE FullyQualifiedName LIKE 'Your Customer Name:%'

the above works if you only have one level. Try a cast:
if (null != cust.ParentRef && ((ReferenceType)cust.ParentRef).Value == c.Id)
Then if you were building a treeview for instance just wrap it in a recursive method.

Related

PDI: how to handle many rows as a single xml value

I have to handle these steps:
- order (table input)
- id
- order row (table input)
- order_id
- row_id
- product_id
- quantity
- a soap web service to call
I have to execute the soap web service for every order passing all the order's rows for the given order.
For example, if I have 3 orders I must execute the web service 3 times and at every execution I must pass to the soap web service all the order's rows as xml argument like this:
<rows>
<item>
<order_id>1</order_id>
<row_id>1</row_id>
<product_id>123</product_id>
<quantity>12</quantity>
</item>
<item>
<order_id>1</order_id>
<row_id>2</row_id>
<product_id>456</product_id>
<quantity>65</quantity>
</item>
... and so on...
</rows>
I cannot figure out how to design the trasformation so it can executes the soap web service for each single order passing all the order's rows as xml single value.
Any help ? (many thanks in advance...)
It looks like u need to look on examples which are distributed with data-integration package.
Look into $KETTLE_HOME/sample/transformations/transformation-executor
2 helpful steps are "Get rows from result" and "Copy rows to result" will let u manage your needs.
Same.
Look inside of example directory and find "XML Join - Create a multilayer XML file".
But there are another ways to solve problem. U can just dump all fragments to xml file and then load file again in next transformation.

List All domains and data sources use in the domains in Jaspersoft

How can i List All domains and data sources use in the domains in Jaspersoft.
i mean i have different domains like audit domains,customer domain etc is there any way to get all domains with tables(Data sources) use in these domains in jaspersoft?
I have around 20 domains and manually going to each domain and listing tables is cubersome so i need some help!
there is not a good way that i have found (i am sure you can dig into the DB)
one way to get this is to export the domains and it exports to a nice neat XML file.
As we only use JDBC sources we only need to look for "jdbcTable" and "jdbcQuery" tags to see what a domain is using this is all in the second 1/2 of the xml. if you use other datasources you may nee to review the xml to see how Jasper references them in the XML.
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.jaspersoft.com/2007/SL/XMLSchema" version="1.0">
<resources>
<jdbcTable id="" datasourceId="" tableName="">
<jdbcQuery id="" datasourceId="">
<query> select * from table <\query>
Below solution is for identifying Adhoc Views that depend on Domains, but I believe you could implement a similar solution with domains that depend on Datasources.
In the domain I created a derived table [AdhocViewName].
The query for this domain is:
SELECT a.id as AdhocID,
r.label as AdhocLabel,
a.reportDataSource as AdhocDataSourceID,
t.AdhocDataSourceLabel
FROM (SELECT id as AdhocDataSourceID,
label as AdhocDataSourceLabel
FROM public.jiresource
) as t
INNER JOIN public.jiadhocdataview a ON a.reportDataSource = t.AdhocDataSourceID
INNER JOIN public.jiresource r ON a.id = r.id
Notes:
even though the tables appear with underscore (public_jiresource, the query only worked by substituting "." (public.jiresource).
for some reason jasper doesn't like it when you use brackets; eg, a.id [AdhocID], thus I used a.id as AdhocID.
When you pull the derived table into an Adhoc View,
create a table
filter with resourcetype is one of SemanticLayerDataSource, AdhocDataView
Colums: Resource Label, uri
Groups: adhocdatasourcelabel

Getting error QB -sdk NAME must be unique

I am using the IPPDotNetDevKit.2.1.12.0 SDK to first get a list of all customers. I then add new customers which works 99.9 percent of the time, but for some (and thereafter persistant for that perticular entity) I am getting this error;
QB -sdk NAME must be unique in QB! name = ABC Company
I don't see the customer in QuickBooks (so sync error), and I look at the set of customers returned in the 1st request (where I set qb_query.ActiveOnly = false)
<xml version="1.0" encoding="utf-8"?>
<CustomerQuery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.intuit.com/sb/cdm/v2">
<StartPage>1</StartPage>
<ChunkSize>500</ChunkSize>
</CustomerQuery>
and the customer in question "ABC Company" is clearly not there (only have 43 customers returned so ChukSize is not the issue). So it seems I tired to add that customer, it got "stuck", and now everytime I try to add it again, I get "name must be unique". However checking sync errors;
<?xml version="1.0" encoding="utf-8"?>
<CustomerQuery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ErroredObjectsOnly="true" xmlns="http://www.intuit.com/sb/cdm/v2">
<StartPage>1</StartPage>
<ChunkSize>100</ChunkSize>
</CustomerQuery>
I get no rows returned. (it does look a little funny where the SDK puts ErroredObjectsOnly but what do I know).
So my question is, how can I get either the customer query or the sync error query to return the "lost" customer so I can find the ID and delete it or fix it?
Thank you.
Names have to be unique across all Customers, Vendors, Employees, and "Other Name" elements.
Did you also check to make sure that there's no Vendor, Employee, or "Other Name" with that same name?

How to combine results from two rather different YQL SELECTs (not a subselect)?

I have the following two YQL queries, each of which work fine on their own, but I'm pretty sure there's a way I haven't been able to find to fetch them both in a single more complicated query:
SELECT * FROM xml WHERE url="http://www.google.com/ig/api?weather=Tbilisi"
AND itemPath="//current_conditions/temp_c"
and
SELECT * FROM html WHERE url='http://amindi.ge/'
AND xpath="//*[#id='maincityholder']/h1"
The questions here with similar wording all turn out to be questions about subselects, use query.multi which doesn't seem to exist any more, or select something other than * which I couldn't get to work with either of my queries even in isolation.
It could be that the itemPath and the xpath clauses are the problem, but as I say I can't get either to work without these. Am I missing something or is this not possible with my particular queries?
The query.multi table exists in the same place it always has. Did you forget to load that table (or the usual env=store://datatables.org/alltableswithkeys)?
There's also a yql.query.multi table, which is used in exactly the same way as query.multi but exists in YQL proper, so does not require the data table to be loaded into the environment.
The following query, taking your individual queries (and changing/escaping quotes where necessary)
SELECT * FROM yql.query.multi WHERE queries='
SELECT * FROM xml WHERE url="http://www.google.com/ig/api?weather=Tbilisi"
AND itemPath="//current_conditions/temp_c";
SELECT * FROM html WHERE url="http://amindi.ge/"
AND xpath="//*[#id=\'maincityholder\']/h1"
';
Gives
<results>
<results>
<temp_c data="-2"/>
</results>
<results>
<h1>6°</h1>
</results>
</results>
(Try it in the YQL console)

How to retrieve user information from facebook using fqlquery?

I have the fql query as shown below.
Select uid,profile_url,pic_square from user where name="Ershad"
here i am getting a response as below.
xml version="1.0" encoding="UTF-8"
fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true"
But i want all the list.All the details uid,profile_url and pic_square.
Please anyone help me out..
When you get a return result like that, it means that there was no data returned that matched your query. I can immediately think of two things that would cause this:
There is no user named "Ershad" that has your application installed. Note that the name field is a full name search, so you'll need to put the person's entire name in there.
You are querying with the wrong application API Key
I would suggest you try your query in the API Test Console. Select your application, then choose "fql.query" from the Method drop-down, and try your query there.