I'm trying to retrieve all the accounts from a company by using the DataService.FindAll(...) method but it only seems to be returning active accounts. Is there a way to get all the accounts regardless of the active status?
I know I've got inactive accounts because I purposely put them there to test and such.
My current line looks like this:
Dim accounts As List(Of Intuit.Ipp.Data.Account) = ds.FindAll(New Intuit.Ipp.Data.Account()).ToList()
I've also tried adding a ... With {.Active = False}... in there too just to see if that would find all that are inactive. Still nothing.
Am I overlooking something or should this work and get me all accounts?
Thanks for any help.
Also, I'm using Intuit's .NET SDK with VB.NET.
You can try this -
SELECT * FROM Account WHERE Active IN (true, false)
ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V3QBO#Account
JAVA Code
Account account = GenerateQuery.createQueryEntity(Account.class);
String accountQuery = select($(account)).where($(account.isActive()).in(new Boolean[]{true, false})).generate();
service.executeQuery(accountQuery);
Thanks
Related
I'm attempting to modify quickbooks desktop employees via the employeemod API. Everything is working except I can't make multiple pay rate updates for an employee. The documentation states that making one change will wipe out all current earnings items - which is fine, but only if I can add multiple pay rates back in. Instead it is only showing the last update when I run the code below. Is there a way to pass multiple pay rates for an employee using QBFC?
Set EmployeeMod = setRequest.AppendEmployeeModRq()
EmployeeMod.ListID.SetValue rsWageRates!EmployeeExternalReferenceKey '"80000001-1512843728"
EmployeeMod.EditSequence.SetValue "1654178687"
Dim vQBstr As IEarnings
Set vQBstr = EmployeeMod.EmployeePayrollInfoMod.OREarnings.EarningsList.Append()
vQBstr.PayrollItemWageRef.ListID.SetValue "8000000C-1204061990"
vQBstr.ORRate.Rate.SetValue "18.2"
vQBstr.PayrollItemWageRef.ListID.SetValue "8000000D-1204061990"
vQBstr.ORRate.Rate.SetValue "27.3"
Set setResponse = smgr.DoRequests(setRequest)
I need to have a script which can copy the value from InternetAddress Field in the person document one by one in names.nsf and append it in the User Name field. Can someone help with a working script?
This can literally be done with a one-line formula, using a simple assignment statement and the list append operator. It is really the most basic thing you can do in all of Lotus Notes programming. It doesn't even need to use any of the #functions.
The syntax for an assignment is:
FIELD fieldThatYouWantToSet := value;
The syntax for the list append operator is:
value1 : value2;
The only other thing you need to know is that value1 and value2 can simply be the names of existing items (a.k.a. fields), and the list of values in the second item will be appended to the list of values in the first item.
Then, all you will need to do is to put this one-liner into a formula agent that runs against all documents in the current view, and run the agent from the Actions menu while you are in the view.
Option-1:
There are a few ways to accomplish this, the simplest being , as the user specified before, a simple field function would do.
FIELD UserName := UserNAme:InternetAddress;
You could set and run the above field function in an agent in $UsersView
In option-2, you could also use the "UnProcessedDoc" feature and set and run as an agent.
But, here, I have written one another way to set and run as an agent in $UsersView.
Hope this helps, please approve this answer if this had helped anyone.
Option:2
At present , no Domino in my System, in order to test this snippet. I wish there exists any method online to test this snippet before I post.
But, logically, consider this snippet as a pseudo-code to accomplish ur objective.
Above all, it has been more than a decade or two ever since I have programmed in Domino. Because, I moved on to RDMS, DW, BI and now to Cloud... well Cloud-9. :)
Here is a portion of lotus script code to copy the value from InternetAddress Field in the person document one by one in names.nsf and append it in the UserName field.
Dim db As New NotesDatabase( "Names Db", "names.nsf" )
Dim view As NotesView
Dim doc As NotesDocument
Dim InternetAddress_value As Variant
Set view = db.GetView( "$Users" )
// loop thru all docs in $Users view.
// Get InternetAddress_value and rep it in UserName
Set doc = view.GetFirstDocument
If doc.HasItem("InternetAddress") Then
While Not(doc Is Nothing)
// in this line we concatenate username with IAaddress_value
new_value= doc.GetItemValue( "username" ) + doc.GetItemValue( "InternetAddress" )
Call doc.ReplaceItemValue( "UserName", new_value)
Call doc.Save( False, True )
Set doc = view.GetNextDocument(doc)
Wend
End If
This solution is posted by Mangai#Notes#Domino#Now_HCL . Encourage to post more solutions by approving the answer.
This old URL worked perfectly
http://query.yahooapis.com/v1/public/yql?q=select%20Symbol%2C%20LastTradeDate%2C%20Open%2C%20DaysHigh%2C%20DaysLow%2C%20LastTradePriceOnly%2C%20Volume%20from%20yahoo.finance.quotes%20where%20symbol%20in%20('MSFT','AAPL')&diagnostics=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
The SQL is
select Symbol,LastTradeDate,Open,DaysHigh,DaysLow,LastTradePriceOnly,Volume from yahoo.finance.quotes where symbol in ('MSFT','AAPL')
So now yahoo.finance.quotes table has died, I replace it with the new pm.finance table, on the console i type select * from pm.finance where symbol="AAPL" and I get the new table field format
<Name>Apple Inc.</Name>
<Symbol>AAPL</Symbol>
<Open>174.000000</Open>
<DaysHigh>174.240005</DaysHigh>
<DaysLow>171.119995</DaysLow>
<MarketCapitalization>896.093B</MarketCapitalization>
<YearHigh>174.240005</YearHigh>
<YearLow>104.080000</YearLow>
<Volume>44234059</Volume>
<AverageDailyVolume>-</AverageDailyVolume>
<PERatio>19.696367</PERatio>
<LastTradePriceOnly>173.485596</LastTradePriceOnly>
<Change>5.375595</Change>
<realtime_price>173.485596</realtime_price>
<realtime_change>5.375595</realtime_change>
<realtime_chg_percent>3.197665</realtime_chg_percent>
<eps_curr_year>8.808000</eps_curr_year>
<realtime_ts>11 03 2017 17:36:24 GMT</realtime_ts>
<ts>11 03 2017 17:36:24 GMT</ts>
So I change the above SQL to .. AND IT WORKS ON THE CONSOLE YIPPEE
select Symbol,ts,Open,DaysHigh,DaysLow,LastTradePriceOnly,Volume from pm.finance where symbol in ('MSFT','AAPL')
Now the trick to convert it to the URL ??
I tried
https://query.yahooapis.com/v1/public/yql?q=select%20Symbol%2C%20ts%2C%20Open%2C%20DaysHigh%2C%20DaysLow%2C%20LastTradePriceOnly%2C%20Volume%20from%20pm.finance%20where%20symbol%20in%20(%27MSFT%27,%27AAPL%27)&diagnostics=false
and I get
Authentication Error. The table pm.finance requires a higher security level than is provided, you provided ANY but at least APP is expected
Question, do I need an App ID key, or something, I cant find any exmaples of how to add 'Authentication'..
Please advise
MORE INFORMATION I am using Vb.net and this was the code used for the URL at top of the screen
Dim doc As New Xml.XmlDocument
doc.Load(URL)
etc
Now it seems we need to use OATH 2 authentication like Google APIs, but they have dll for that in .Net like here
https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth
Does yahoo YQL have this ??
We've been continuously working on this issue for a few months and not getting far with it. Since this was first asked, we changed the code (based on what the original developer for the site suggested), but we are still not getting where we need to be.
I'm relatively new to Ruby and am currently taking some courses to learn more about it, so please bear with me. We're using Ruby 1.9 and Rails 3.2 We use AS/400 for our database. We've tried using Active Record for this before, and it doesn't want to work because of our versions of Ruby and Rails being older combined with getting it to connect with the 400.
We have an online ordering site that you have to have an account set up to access. Depending on what type of account you are set up as, you might have to have your order approved by someone. I.e. if I am a drop ship account, my distributor has to approve what I'm ordering. The way it had been set up, the distributor wasn't getting any kind of approval email.
Each account that requires approval has x number of email addresses attached to it of people who are able to approve the order. We have been told that target_email needs to be a string, so we tried numerous ways of making it a string to no avail. As is, it's only sending the first two email, not the approval email. If we run target_email = Contact.find_by_sql ["SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"] in console, it returns the expected email addresses associated with that account. So we know that's working the way it should... but we're at a loss as to what is wrong with the rest of the code.
# notify Customer
Mailer.deliver_order_coastal_notify_email("", "Coastal Pet Online Ordering<noreply#coastalpet.com>", "Order Confirmation", email_details)
target_email = Contact.connection.select_values "SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"
# Order Approval
if sign_on.acctypw1.strip == "DS" or sign_on.acctypw1.strip == "DSD"
# If there is no distributor email address, the mailer model will substitute in the admin's email from their settings
target_email.each do | email_address | Mailer.deliver_order_distributor_approval_email(email_address, 'Coastal Pet Online Ordering<noreply#coastalpet.com>', "Order Confirmation Approval", email_details)
end
# notify Coastal staff
Mailer.deliver_order_coastal_notify_email("", "Coastal Pet Online Ordering<noreply#coastalpet.com>", "Order Confirmation-Notify Staff", email_details)
end
I tried
target_email = Contact.connection.select_values("SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 = act223").uniq
This works but it sends emails to multiple accounts why this would happen? I think I need to set a value for act223
act223 = "ACT223"
target_email = Contact.connection.select_values("SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 = #{Contact.connection.quote(act223)}").uniq
this throws NameError (undefined local variable or methodact223' for #):`
in development.log.
Here is a link to the relevant table data if more table information is needed just let me know and I can add it to that page. I am looking to do some sort of a join of a field from another table. In this same model I have SignOn.prefdstw1 which gets me the same account number is there a way to Join this field in the query with the 400?
Any help or suggestions would be greatly appreciated! Thank you in advance!
find_by_sql always returns an array of model objects, so
Contact.find_by_sql ["SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"]
is not an array of email addresses - it's an array of Contact objects, with only one object
You could either extract the email addresses from this, using something like
Contact.find_by_sql(["SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"]).collect do |contract|
contact.emal23
end
I'm not entirely sure what rails will do to the uppercased column name.
If you don't want to instantiate a whole Contact object just to get the email you could also do
Contact.where("ACT223 = ''").pluck('EMAL23')
which would return an array of emails, assuming that Rails knows that the correct table to use for this is WEBOEL23 - it's not clear to me whether that is the table for Contact (and thus you've use set_table_name to configure this) or whether Contact is just a random model unrelated to that table.
You could also drop down a level and do
Contact.connection.select_values "SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"
which will also return an array of email addresses.
Inside the each loop, target_email is a bareword variable (without quotes), but the first argument to the mailer is the string (within quotes) 'target_email'.
Remove those quotes to get to this (whitespace added for readability):
target_email.each do | email_address |
Mailer.deliver_order_distributor_approval_email(
email_address,
'Coastal Pet Online Ordering<noreply#coastalpet.com>',
"Order Confirmation Approval",
email_details
)
end
Then the mailer should have access to the email address.
I have several domains, only one website and one databse table for each domain.
example: wbesite.us - data from USA goes to database table main_usa
wbesite.co.uk - data form UK goes to database table main_uk
Only have one database with name of the website. Having only one website structured and having variables like this:
$sql="select * from main_".$countrycode." where bla..bla...
and many other variables to catch the domain extension, and so on...
Now, instead of having one full website for each domain, how can set a script and wher do I put it in order to detect the domain that the user uses.
In my server root do I create something like website.$domain?
Something like website OLX but for different purposes.
I hope I made myself clear.
Thank you.
You could use the $_SERVER['SERVER_NAME'] global and somehow parse it, to get the country code.
I didn't try it, but something like this should work:
$servername_array = explode('.', $_SERVER['SERVER_NAME']);
$country_code = array_pop($servername_array);
That way, $country_code will be com, uk, or whatever is after the last dot in the domain name.