Windev Quickbooks SDK OpenConnection2 - quickbooks

I've been trying to find a way to connect my Windev application using the Quickbooks SDK.
I wish to connect to my local QB instance using the qbXML API.
I've been able to get a reference to the library using :
myconnection = new object Automation "QBXMLRP2.RequestProcessor"
However, when it comes to the OpenConnection2 method, I only get errors. Either "missing parameter" or "invalid parameter". I am aware that I should pass a "localQBD" type to the function, but I have not found out how to reference it. The following represents my invalid script.
myconnection>>OpenConnection2("","My Test App", localQBD)
How can I achieve a connection to QB through Windev?

After much searching, I have found that I was on the right path using the automation variable type.
However, I have yet to find how to reference the constants provided by the library. Instead, I declare them beforehand like so
CONSTANT
omSingleUser = 0
omMultiUser = 1
omDontCare = 2
qbStopOnError = 0
qbContinueOnError = 1
ctLocalQBD = 1
ctLocalQBDLaunchUI = 3
FIN
Which gives us this working example
myconnection = new object Automation "QBXMLRP2.RequestProcessor"
ticket = myconnection>>BeginSession("",::omDontCare)
XMLresponse = myconnection>>ProcessRequest(ticket,XMLrequest)
myconnection>>EndSession(ticket)
myconnection>>CloseConnection()
delete myconnection
A huge thanks goes to Frank Cazabon for showing me the proper constant values.

I have a complete external WinDev component that accesses QB and a helper program that can generate the WinDev calls in the correct order with the correct spelling and provides an OSR for all the QuickBooks fields and modules.
I have a similar product for the Clarion language and am in the final stages of the WinDev version. Contact me if you are interested. qbsnap at wybatap.com

Related

Problem finding metrics in the new Google My Business APIs

I am having some issues migrating my Google MY Business API python code.
My original code looks like:
Get my accounts:
service, flags = sample_tools.init(argv, "mybusiness", "v4", __doc__, __file__,
scope="https://www.googleapis.com/auth/business.manage",
discovery_filename=cfg.discovery_doc_old)
output = service.accounts().list().execute()
accounts = output["accounts"]
Get my locations name per account with the following call:
self.service.accounts().locations().list(parent=account['name']).execute()
For each location I get my insights report with the following call:
service.accounts().locations().reportInsights(name=self.account, body=body).execute()
Now since these calls are going to be deprecated, I need to update this code to the new Business APis. So far I managed to reproduce step 1 & 2 of my old code:
Get my accounts (using the my business account management api):
service, flags = sample_tools.init(argv, "mybusinessaccountmanagement", "v1", __doc__, __file__,
scope="https://www.googleapis.com/auth/business.manage",
discovery_filename=cfg.discovery_doc_new)
output = self.service.accounts().list().execute()
accounts = output["accounts"]
Get my location (using my business business information api):
service, flags = sample_tools.init(argv, "mybusinessbusinessinformation", "v1", __doc__, __file__,
scope="https://www.googleapis.com/auth/business.manage",
discovery_filename=cfg.discovery_doc_gmb_info)
output = service.accounts().locations().list(parent=self.accounts[0]['name'],
readMask='name',
).execute()
locations = output['locations']
Now I am missing the equivalent to the old
reportInsights(name=self.account, body=body).execute()
I haven't found anywhere some similar. I thought maybe I need to add it as the readmask, but also could find any documentation. I basically want to get the values of these metrics for each location using one of the new APIs:
https://developers.google.com/my-business/reference/rest/v4/Metric
I already went through this tutorial, even though I prefer using the client libraries:
https://developers.google.com/my-business/content/basic-setup
but it doesn't tell me where to find these metrics.
I have also tried the same structure as in the old API but I get the error message:
AttributeError: 'Resource' object has no attribute 'reportInsights'
Can someone help me with this? I am quite new to the Google APIs and maybe there is something obvious I missing out :/
Thanks a lot,
Rafael
As #devinthemaking has stated correctly, the reportInsights method is not deprecated and does not have a successor method yet.
The list of deprecated methods can be found here: Deprecation schedule

.NET SDK for JIRA (Atlassian.SDK) wont allow me to add a custom field even though it exists on JIRA

I am using the latest Atlassian.SDK package for .NET to integrate my application with JIRA
I am trying to create an issue as follows
Jira jiraConn = new Jira("<theurl>", "<theuser>", "<thepasswd>");
Issue objIssue = jiraConn.CreateIssue("EF");
objIssue.Type = "Escalation";
objIssue.Priority = "Major";
objIssue.Summary = "Test with custom fields";
objIssue.CustomFields.Add("Field 1", "Anthony Drive");
objIssue.SaveChanges();
However the line 'objIssue.CustomFields.Add' throws an exception stating 'Could not find custom field with name 'Field 1' on the JIRA server. Make sure this field is available when editing this issue. For more information see JRA-6857'
Is there something that i am missing ?
I am using the SDK ver 2.4.0 and JIRA version 6.3
So there is a bug in the API. When ever a custom field is added , the API fetches a random issue and checks if the field is present in it.
You would need to work with the source code to solve this issue yourself.
I had the same problem. If you use constructor Jira(...) so the API uses SOAP. But when you use Jira.CreateRestClient, client will use REST API. With REST API inserting epics works fine.
Jira jiraConn = Jira.CreateRestClient("<theurl>", "<theuser>", "<thepasswd>");

The field 'Commons' not defined in freebase provider for fsharp

I'm having some problems with the freebase api. I have managed to put a key to the freebase provider so I don't see any 403 errors, relating quota restrictions. But since I used a google api key, commons is not being recognized when I hit "alt + enter". But while I'm writing, the provider manages to show me data.
[<Literal>]
let FreebaseApiKey = "AIzaSyCOn15-T31Ls"
type FreebaseDataWithKey = FreebaseDataProvider<Key=FreebaseApiKey>
let dataWithKey = FreebaseDataWithKey.GetDataContext()
let travelDestinations = dataWithKey.Commons.Travel.``Travel destinations``
let all = travelDestinations |> Seq.toList
let first = all.Head.Name
As you can see, I have access to Travel Destinations, so the provider shows me data correctly but when I execute it:
Script.fsx(17,38): error FS0039: The field, constructor or member 'Commons' is not defined
The weird thing is that if I delete the google key, and use the provider, this error does not happen. Any clues?
In a provider like freebase, we need to do things asynchronously, and that unfortunately causes the error reporting not to be very good (see https://github.com/fsharp/fsharp/issues/280)
What's probably happening is that freebase is returning errors due to the api key not being right or something similar, and does errors are not surfacing, as the toplevel objects are already cached. You can either look under Fiddler to see the json being returned, use data.DataContext.SendingQuery or data.DataContext.SendingRequest, or clean the cache by deleting the FreebaseSchema and FreebaseRuntime folders under your temporary internet files system folder.
We recently tried to change this to cause errors to surface by generating the toplevel types synchronously, but that caused other problems (https://github.com/fsharp/FSharp.Data/issues/522)

Windows Shell and Citrix

I have this line of code in my Delphi app:
sh := CoShellWindows.Create;
When run through a Citrix session, this raises an exception "Not enough storage is available to complete this operation."
Can someone confirm my suspicion that I can't access this through Citrix? I'm running in Seamless mode if that makes any difference. Maybe there's something I need to change on the published icon to make it work?
I am guessing that there is no "Shell" in Citrix to create.
Thanks
EDIT
The CoShellWindows is simply a class which creates an object which implements the IShellWindows interface. This interface is then used to iterate through it's items looking for an instance of Internet Explorer (or more specifically, an item which implements the IWebBrowser2 interface).
There are a few other use case scenarios using the CoShellWindows, but all ultimately are used to interact with the IWebBrowser2 interface (Internet Explorer 8). My requirement is to obtain this IWebBrowser2 object.
The call, behind the scenes is calling the Windows API CoCreateInstance with the following parameters:
rclsid = {9BA05972-F6A8-11CF-A442-00A0C90A8F39} (CLSID of
IShellWindows)
pUnkOuter = null (nil)
dwClsContext = CLSCTX_ALL (I've tried various combinations of these
flags)
riid = {85CB6900-4D95-11CF-960C-0080C7F4EE85} (IID of IShellWindows)
ppv = a variable declared as type IShellWindows
eg:CoCreateInstance(CLASS_ShellWindows, nil, CLSCTX_ALL, IID_IShellWindows, sh)
Your exception "Not enough storage is available to complete this operation." should really read "Shell does not exist so no instance can be created"
Basically you are correct in your assumption that there is no shell to create in Citrix.
What are you using the shell for? as if you provide more information we may well be able to offer a full work around.

JavaMail and the Blackberry JRE

I am trying to make use of the JavaMail jar on my blackberry app so I can access my GMail emails. I usually make use of this sort of function:
Properties props = System.getProperties();
props.setProperty("mail.store.protocol", "imaps");
String html_email = "";
try {
Session session = Session.getDefaultInstance(props, null);
Store store = session.getStore("imaps");
store.connect("imap.gmail.com", email, password);
However, eclipse is complaining about the Properties object as I am not making use of the standard JRE but rather the blackberry JRE.
Is there anyway, I can work around this with minimal changes to my function as far as the Properties is concerned?
In addition, I am having trouble with the use of System:
The method getProperties() is
undefined for the type System.
Is this even likely to work?!
Thanks all
Hmm, looks like JavaMail is not built for use on JavaME.

Resources