You need to sign in to do that
Don't have an account?
Mikhail Nitko 5
PushTopic query creation issue
Hi folks,
I'm trying to create the following PushTopic
And receiving an error that states: "Line: 5, Column: 85 expecting a semi-colon, found 'Walk'"
And I am trying to figure out whats going on, but I know for a fact that the query is formed right, because I use that query in a class and formed it via Workbench.
What is going on?
I'm trying to create the following PushTopic
PushTopic pt = new PushTopic(); pt.Name = 'CaseNotifications'; pt.Query ='SELECT Display_Name__c,Display_Screen_Suffix__c FROM Case WHERE Origin = 'Walk-in' AND Status != 'Closed' AND Remove_From_Screen__c = False ORDER BY CreatedDate ASC NULLS FIRST LIMIT 10'; pt.ApiVersion = 40.0; pt.NotifyForFields = 'Referenced'; pt.NotifyForOperationCreate = true; pt.NotifyForOperationUpdate = true; pt.NotifyForOperationUndelete = true; pt.NotifyForOperationDelete = true; insert pt;
And receiving an error that states: "Line: 5, Column: 85 expecting a semi-colon, found 'Walk'"
And I am trying to figure out whats going on, but I know for a fact that the query is formed right, because I use that query in a class and formed it via Workbench.
What is going on?
Np.
Can you include the column Id as well in your SOQL query?
Vivin
All Answers
Can you try using this query. Can you replace line 05 with this one and try
Sorry it took so long to reply.
When I use that line I get the message: "Error: Line: 19, Column: 1
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD, 'Id' field must be selected: [Query]"
Np.
Can you include the column Id as well in your SOQL query?
Vivin
The error I get now is "Line: 19, Column: 1
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD, 'LIMIT' is not allowed: [Query]"
Does this mean that I won't be able to limit the results this way? .. perhaps its by design?
Yes .. Please refer to this link for unsupported PushTopic queries.
https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/unsupported_soql_statements.htm