it's the first time I'm not able to find a solution for an error on my own.
I try to perform a fql query but I', getting a very strange response :/
FQL:
{
"477215715631180":
"SELECT name, start_time, location, creator, pic_square
FROM event WHERE eid=477215715631180",
"creator_477215715631180":
"SELECT name FROM profile WHERE id IN (SELECT creator FROM #477215715631180)"
}
Response:
(#601) Parser error: unexpected '#' at position 58.
Position 58:
... FROM event WHERE ...
API Explorer.
Is there anybody with a solution?
The problem seems to be that you can't have a sub-query named the same as a reserved FQL item. You're using an id for your query designator here. Facebook doesn't like that.
I was able to get your query to run by adding a 'q' to the beginning of your subquery name:
{
"q477215715631180":
"SELECT name, start_time, location, creator, pic_square
FROM event WHERE eid=477215715631180",
"creator_477215715631180":
"SELECT name FROM profile WHERE id IN (SELECT creator FROM #q477215715631180)"
}
For your parser error, Facebook's messages don't reference the whole FQL multiquery. Facebook parses each query individually and throws an error just for the current query it's parsing. So in your case, the first query parsed fine, then this error came from your creator_ query, where the # occurs at position 58.
Related
The django graphene documentation shows a test example like this:
class MyFancyTestCase(GraphQLTestCase):
def test_some_query(self):
response = self.query(
'''
query {
myModel {
id
name
}
}
''',
op_name='myModel'
)
content = json.loads(response.content)
# This validates the status code and if you get errors
self.assertResponseNoErrors(response)
# Add some more asserts if you like
...
They don't have any API documentation for what op_name is, and what we should set it as. I tried to set it to my query name, but get the error:
[{'message': 'Unknown operation named "myQuery".'}]
Operation name is only needed when there are multiple operations in the query string. You only have one operation so the default (None) is fine.
https://docs.graphene-python.org/en/latest/execution/execute/#operation-name
As per my comment:
If the query is a mutation or named query, you must supply the op_name. For annon queries ("{ ... }"), should be None (default)
I am not sure how to create a "named query" with django graphene, but apparently my query is NOT a named query. Leaving op_name as None got my query to work via my unit test.
I have a datastore entity like this below
Name/ID Parent Rollen email first_name last_name
name=CidassUID Key(Tenant, 'CidassGroupID') ["user","admin"] user#email.com user first name user last name
I would like to make a query w.r.t Name/ID
In GQL I am trying like this
select * from User where Name/ID='CidassUID'
and in python like this..
query = client.query(kind='User')
query.add_filter('Name/ID', '=', 'name=CidassUID')
return list(query.fetch())
Can somebody help how can I get the result via Name/ID?
Thanks a lot
so thats how i solve it in GQL..
select * from User where __key__= Key(Tenant, 'CidassGroupID', User, 'CidassUID')
and for python..
query_key=client.key('Tenant', 'CidassGroupID','User', 'CidassUID')
query.key_filter(query_key,'=')
I am trying to add a new field through the customization browser to the Purchase Orders screen (PO301000). I created the field through the New Field button and edited the Data Access slightly to provide a default parameter for the field. Here is the code in the Data Access:
[PXDBDecimal]
[PXDefault(TypeCode.Decimal, "0.0")]
[PXUIField(DisplayName="Weight Total")]
This field will be used to calculate the total weight of the purchase order and I would like it to be stored in the database.
I get this error when publishing:
An error while publishing the database item POOrder
with the message:
Nullable object must have a value.
I have tried changing the PXDBDecimal to a PXDBQuantity. This has to be done through the customization browser and not the database itself because this project will be going on a SaaS hosted site where I do not have access to the database. I have also tried creating the field through the DAC only and I receive this error when trying to open the page:
Invalid column name 'UsrWeightTotal'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'UsrWeightTotal'.
When reviewing the project xml for the POOrder table entry in the customization I found there were some extra/missing attributes required for a column type of decimal.
There was a MaxLength property and no DecimalLength property. I compared it to adding a new field of type decimal and looked at the project xml to come up with the following:
<Table TableName="POOrder">
<Column TableName="POOrder" ColumnName="UsrWeightTotal" ColumnType="decimal" AllowNull="True" DecimalPrecision="6" DecimalLength="19" IsNewColumn="True" IsUnicode="True" />
</Table>
I bet the error was complaining about the missing DecimalLength value (as a result was null but required for the publish process).
I'm trying to filter the list of users returned from Directory.Users.List, and want to use the creationTime value in the filter. According to this:
Search for users
...you can use Date fields in comparisons, however when I try something like:
creationTime>=2016-06-30 (or the same value quoted)
...I get:
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid Input: creationTime>=2016-06-30",
"reason" : "invalid"
} ],
"message" : "Invalid Input: creationTime>=2016-06-30"
}
The message isn't particularly helpful - is this a syntax issue with the query, or is it the case that the field isn't available for query (it isn't listed in that article, but it is part of the JSON response)?
The article specifies the format for Date field queries, however this field also includes a time component, so I tried to also replicate the exact format that shows in the JSON, with the same result.
Also, same result in the Try it! section of the Users reference page.
Also also, tried using a numeric value (Date.getTime(), in effect) - same error.
Thanks...
P.S. Interestingly, Google does document how to search on date fields for Chromebooks, and it's entirely different than they imply for users. I still can't use creationTime with this, but it does work for Chromebooks. The other part of this is that it refers to fields that aren't documented, and why I try to use the documented field (e.g. lastSync vs. sync), it fails with the same message. This whole thing seems half-baked.
View Chrome device information
Only the fields listed in the table are searchable via the users.list search.
A workaround (I don't know if this is suitable for you) may be to push the data you want to use in a search into custom user fields. These fields are searchable.
I am getting an error message when I try to instert a custom object into an exisiting lead object.
List<Lead> leads =[select Id from Lead where Email =:lead.Email ];
if(leads.size()>0)
{
Lead existing_lead = new Lead(Id = leads[0].id);
social_account.Lead__c = existing_lead.Id; //social_account is a custom object that
//has a child relationship to lead.
//ie lead is a parent of social_accounts.
update existing_lead;
insert social_account; //if there is an existing lead with same same email,
//i'd like to insert new social_account to an exsiting lead.
}
I am getting this error:
554 System.DmlException: Update failed. First exception on row 0 with id 00Q3000000WW3isEAD; first error: CANNOT_UPDATE_CONVERTED_LEAD, cannot reference converted lead: []
Class.ProcessContact.handleInboundEmail: line 81, column 9
External entry point
even if I comment out the 'update existing_lead', i get a similar error message.
554 System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_UPDATE_CONVERTED_LEAD, cannot reference converted lead: [Lead__c]
Class.ProcessContact.handleInboundEmail: line 82, column 9
External entry point
I would appreciate any suggestions.
regards
This error means that the Lead record has been converted to a Contact. Once converted, the Lead record cannot be updated. The Lead object has an IsConverted property that you can check to see if it has been converted. If IsConverted is true, ConvertedContactId will hold the contact ID of the new Contact record.
Lead Object reference
You cannot update converted Lead by default, but after Sprint 16 release, there is possibility, just you need to setup few things.
-From Setup, enter User Interface in the Quick Find box, then select User Interface then select Enable "Set Audit Fields upon Record Creation" and "Update Records with Inactive Owners" User Permissions.
-From Setup, enter Profiles in the Quick Find box, then select Profiles. Select the profile and then select Set Audit Fields upon Record Creation.
Here you can find more information's about this.