You need to sign in to do that
Don't have an account?
Alex Lamora
SOQL, only want to Query for current record.
Im doing an HTML Post callout, I have an @invokeablemethod that ties to my @future which is where my callout is. Im using the SOQL to give field data in body, serializing json then sending over. It keeps sending over the information of the last opportunity not the current one which ping process builder. How do I select the current opportunity as the only record in the query.
Map < string, object > Postdata =new Map<string, object>(); Map < string, object > Document =new Map<string, object>(); Map < String, object > patientdata = new Map<String, object>(); Map < string, object > insurancedata1 = new Map <string, Object>(); list<object> insurancesdata = new list<object> {insurancedata1}; for (Opportunity client: [SELECT id, first_name__c, Last_Name__c, Date_Of_Birth1__c, Client_SSN1__c, Gender__c, Client_Email__c, Client_Phone__c, Other_Pone__c, Mailing_City__c, Mailing_State__c, Mailing_Street__c, Mailing_Zip_Postal_Code__c, Insurance_Company1__c, Insurance_Phone_Number__c, Subscriber_Name__c, Subscriber_DOB__c, INS_ID__c, INS_Group__c, Client_Relationship_to_Primary__c, Primary_Policy_Holder_Employer__c from opportunity where Opportunity.id = : ]){ insurancedata1.put('subscriber_employer', client.Primary_Policy_Holder_Employer__c); insurancedata1.put('subscriber_relationship', client.Client_Relationship_to_Primary__c); insurancedata1.put('group_ID', client.INS_Group__c); insurancedata1.put('policy_no', client.INS_ID__c); insurancedata1.put('subscriber_DOB', client.Subscriber_DOB__c); insurancedata1.put('subscriber_last_name', client.Subscriber_Name__c); insurancedata1.put('insurance_phone', client.Insurance_Phone_Number__c); insurancedata1.put('insurance_company', client.Insurance_Company1__c); patientdata.put('insurances_attributes',insurancesdata); patientdata.put('address_zip', client.Mailing_Zip_Postal_Code__c); patientdata.put('address_street', client.Mailing_Street__c); patientdata.put('address_state', client.Mailing_State__c); patientdata.put('address_city', client.Mailing_City__c); patientdata.put('alternate_phone', client.Other_Pone__c); patientdata.put('phone', client.Client_Phone__c); patientdata.put('email', client.Client_Email__c); patientdata.put('gender', client.Gender__c); patientdata.put('ssn', client.Client_SSN1__c); patientdata.put('dob', client.Date_Of_Birth1__c); patientdata.put('last_name', client.Last_Name__c); patientdata.put('first_name', client.first_name__c); patientdata.put('sending_app_patient_id', client.Id); document.put('data', patientdata); document.put('sending_app_name', 'Salesforce'); document.put('recipient_id', Kipuinstanceid); postdata.put('document', Document); }
May I suggest you please refer the below link for reference.SOQL, only want to Query for the current record.
- https://developer.salesforce.com/forums/?id=906F0000000BCYmIAO
- https://salesforce.stackexchange.com/questions/73163/rest-api-soql-query-want-to-get-only-current-users-record
I hope it will be helpful.Best Regards
RahulKumar