Getting stock symbol from company name - java

I have a company name and i want to get the stock symbol of that company and all the information related to it. I have tried using yahoo call back Stock ticker symbol lookup API but for some reason it returns a http 400 bad request. Could someone please tell me how i would go about getting the symbol for that stock so that i can query yahoo and get all the data. Also is it possible to just use this company name to get all the stock related data.
request i sent-"http://d.yimg.com/autoc.finance.yahoo.com/autoc?"+symbol+"=yahoo&callback=YAHOO.Finance.SymbolSuggest.ssCallback" where symbol=Thomas Scott

Your query is malformed. Try:
http://d.yimg.com/autoc.finance.yahoo.com/autoc?query=Thomas%20Scott&callback=YAHOO.Finance.SymbolSuggest.ssCallback

Related

Getting "INVALID_FIELD_FOR_INSERT_UPDATE" error message when try to update Salesforce Contact objet via Java(EnterpriseWSDL)

I tried to update Department field in Salesforce Contact object. I got this error response :
"INVALID_FIELD_FOR_INSERT_UPDATE Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set".
When I tried the Opportunity object(Fields : Amount, stageName), the update succeeded.
I checked the field security levels on both objects' fields. Security levels are same but I am not able to update the Contact object. Could anyone help me with this issue? Stage(opportunity) field access levels -
Department(Contact) field access levels
The error message indicates "Unable to create/update fields: Name" not the department field. The name field on contact is a read-only field computed from lastName & firstName fields, you can't send it in an update request. You need to update your code to just send the fields you want to change.

Firebase Database Query Data

I am new to Firebase Database, I am making an android app in which the structure of the data is like this :
{
posts={
-Ks4AoL7F-oKtwd3M8Ao={
address=Address of mine,
title=Title ,
subcategory=E-waste, category=Garbage,
time=21-08-2017 07:54 p.m.,
mobileNumber=some mobile number,
comment=hhdhdehsbsbhs,
statusText=Pending,
imagePath=https://firebasestorage.googleapis.com/v0/b/path-to-image
},...
}
So in this structure i want to query the posts on the basis of the mobile number i.e., if the mobile number matches than the current post will be retrieved else skip this post and check for next post and so on...
you can get all the list of data from post object with the help of simple queries which you can find in documentation part of firebase, where you can check for each object's mobile no, accordingly apply the conditions to keep or discard the object.
for more info please look into the link:-
sample to retrieve the data from firebase
You can refer this post and
This

Unable to retrive Projection/Multi- Relantion field Requests.Custom_SFDCChangeReqID2 using versionone java sdk

I have been trying to retrieve information from querying a specific Asset(Story/Defect) on V1 using the VersionOne.SDK.Java.APIClient. I have been able to retrieve information like ID.Number, Status.Name but not Requests.Custom_SFDCChangeReqID2 under a Story or a Defect.
I check the metadata for:
https://.../Story?xsl=api.xsl
https://.../meta.V1/Defect?xsl=api.xsl
https://.../meta.V1/Request?xsl=api.xsl
And the naming and information looks right.
Here is my code:
IAssetType type = metaModel.getAssetType("Story");
IAttributeDefinition requestCRIDAttribute = type.getAttributeDefinition("Requests.Custom_SFDCChangeReqID2");
IAttributeDefinition idNumberAttribute = type.getAttributeDefinition("ID.Number")
Query query = new Query(type);
query.getSelection().add(requestCRIDAttribute);
query.getSelection().add(idNumberAttribute);
Asset[] results = v1Api.retrieve(query).getAssets();
String RequestCRID= result.getAttribute(requestCRIDAttribute).getValue().toString();
String IdNumber= result.getAttribute(idNumberAttribute).getValue().toString();
At this point, I can get some values for ID.Number but I am not able to retrieving any information for the value Custom_SFDCChangeReqID2.
When I run the restful query to retrieve information using a browser from a server standpoint it works and it does retrieve the information I am looking for. I used this syntax:
https://.../rest-1.v1/Data/Story?sel=Number,ID,Story.Requests.Custom_SFDCChangeReqID2,Story.
Alex: Remember that Results is an array of Asset´s, so I guess you should be accessing the information using something like
String RequestCRID= results[0].getAttribute(requestCRIDAttribute).getValue().toString();
String IdNumber= results[0].getAttribute(idNumberAttribute).getValue().toString();
or Iterate through the array.
Also notice that you have defined:
Asset[] results and not result
Hi thanks for your answer! I completely forgot about representing the loop, I was too focus on the retriving information part, yes I was actually using a loop and yes I created a temporary variable to check what I was getting from the query in the form
Because I was getting the variables one by one so I was only using the first record. My code works after all. It was just that What I was querying didn't contain any information of my use, that's why I was not finding any. Anyway thanks for your comment and observations

Where/How do I find the tax reference code needed to create an invoice using the QuickBooks API v3?

I'm trying to create invoices using the Java SDK (2.2.1) with the v3 API. My API calls to create invoices are failing because of a Business Validation Error stating that my transaction line does not have a tax code associated with it (error code: 6000).
I'm trying to set the tax for the transaction (sales line) like this:
TaxLineDetail taxLineDetail = new TaxLineDetail();
taxLineDetail.setPercentBased(true);
taxLineDetail.setTaxPercent( getTaxPercent() );
salesLine.setTaxLineDetail(taxLineDetail);
I've also tried using Invoice#setTxnTaxDetail(TxnTaxDetail) but it fails in both cases. It seems the API wants a tax code, presumably one that I set with:
TaxLineDetail#setTaxRateRef(ReferenceType)
But I don't understand where I get this tax rate code from. My QB account does have two taxes configured (23% and 0%) but how do I associate one of these with an invoice? Where is this (integer?) code that I need?
For what it's worth, this is a non-US account.
I think the bigger problem here is that you're looking at the completely wrong object type.
The error message is about:
does not have a tax code associated with it
But you're trying to set a:
TaxLineDetail
And a:
TaxLineDetail#set TaxRate Ref(ReferenceType)
Bottom line here - tax codes are NOT the same thing as tax rates. They are related, but totally separate entities.
What QuickBooks is complaining about is that you're not setting a tax code on your line items. See the line item documentation, and look for the TaxCodeRef node which you should be setting.
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/invoice#SalesItemLineDetail
You should query for tax codes, using a query like this:
SELECT * FROM TaxCode
And then set your TaxCodeRef value.
You can query TaxCode and TaxRate ref to get details and use the corresponding Ids in time of Invoice creation.
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/taxcode
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/taxrate
ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V3QBO#TaxCode
To get a correct XML structure of an Invoice object with TaxCode and TaxRate, you can create an invoice from QBO UI(with tax) and retrieve the same using API.
Thanks

How to get last status message of each record using SQL?

Consider the following scenario.
I have a Java application which uses Oracle database to store some status codes and messages.
Ex: I have patient record that process in 3 layers (assume 1. Receiving class 2. Translation class 3. Sending class). We store data into database in each layer. When we run query it will show like this.
Name Status Status_Message
XYZ 11 XML message received
XYZ 21 XML message translated to swift format
XYZ 31 Completed message send to destination
ABC 11 XML message received
ABC 21 XML message translated to swift format
ABC 91 Failed message send to destination
On Java class I am executing the below query to get the last status message.
select STATUS_MESSAGE from INTERFACE_MESSAGE_STATUS
where NAME = ? order by STATUS
I publish this status message on a webpage. But my problem is I am not getting the last status message; it's behaving differently. It is printing sometimes "XML message received", sometimes "XML message translated to swift format", etc.
But I want to publish the last status like "Completed message send to destination" or "Failed message send to destination" depending on the last status. How can I do that? Please suggest.
You can use a query like this:
select
i.STATUS_MESSAGE
from
INTERFACE_MESSAGE_STATUS i,
(select
max(status) as last_status
from
INTERFACE_MESSAGE_STATUS
where
name = ?) s
where
i.name = ? and
i.status = s.last_status
In the above example I am assuming the status with the highest status is the last status.
I would recommend you to create a view out of this select query and then use that in your codebase. The reason is that it is much easier to read and makes it possible to easily select on multiple last_statuses without complicating your queries too much.
You have no explicit ordering specified. As the data is stored in a HEAP in Oracle, there is no specific order given. In other words: many factors influence the element you get. Only explicit ORDER BY guarantees desired order. And/or creating a index on some of the rows.
My suggestion: add a date_created field to your DB and sort based on that.

Categories

Resources