You need to sign in to do that
Don't have an account?
DML2020
Creating SOQL query in API without hardcoding ids or string
For an external user to pull records associated with a specific field (say, event for example) amongst a large group of records associated to other events, how would I include that in my method without making a hardcoded reference like the following?
[Select Id, EventName, EventID, Name, Email FROM Registration WHERE EventID = 'abc4e00000KlMnO']
since the following
[Select Id, EventName, EventID, Name, Email FROM Registration]
pulls the records from all events and not the one of interest.
Greetings!
You would need to query the Event records which are required and store it in the list so that you can use that list as a binding variable instead of hard coded record Id.
Then you can use the list in the SOQL Query as below:
Please mark it as best answer if it helps you to fix the issue.
Thank you!
Regards,
Shirisha Pathuri