-
ChatterFeed
-
60Best Answers
-
0Likes Received
-
0Likes Given
-
0Questions
-
422Replies
expecting a right parentheses, found 's'
but query gets failed on soap ui as well as developer console with error :
from Group where (Name = 'AMER SDR's Group') AND Group.Type='Regular'
^ERROR at Row:1:Column:45
expecting a right parentheses, found 's'
Escaping ' with ' not worked
- Ikram Momin 16
- November 25, 2020
- Like
- 0
- Continue reading or reply
Error: Compile Error: Missing ')' at ',' at line 20 column 62
I am receiving above error in below code
global class RetrieveMedicalInquiryStatusBatchMVN implements Database.Batchable<sObject>, Database.AllowsCallouts, Database.Stateful, Schedulable {
String query = 'SELECT Id,Account_vod__c, Status_vod__c, MA_Response_AZ__c ' +
// Query Closing
'FROM Medical_Inquiry_vod__c ' +
'WHERE Sent_to_GMIP_MVN__c = TRUE ' +
'AND Id IN :Ids';
List <String> statuses;
List<String> Ids = new List<String>('a0tU000000784Gbdue' , 'a0tU00000090WERThc') ;
Can you please help me in sorting this out
Thanks,
Monisha
- Monishan M
- November 23, 2020
- Like
- 0
- Continue reading or reply
query api to get contact details using email id
- iliyas bagwan
- November 23, 2020
- Like
- 0
- Continue reading or reply
How can we fetch Account data using standard rest APIs?
- MKA
- November 16, 2020
- Like
- 0
- Continue reading or reply
How to add error message in apex trigger ?
if(trigObj = null){
trigObj.addError('Cloned record should not have the same period as that of Parent record');
}
I am using this code not getting the output as excepted.
- toby curtis 6
- November 15, 2020
- Like
- 0
- Continue reading or reply
Lookup autofill with a selected picklist value?
I have a picklist that has names (text) that are the same as my contact names (Appointment_with__c)
I have a lookup field to contact that I want to autofill whenever a name is selected from my picklist. The lookup field is called (Staff__c)
I made a basic trigger but encountering silly errors and perhaps not the best code as I am a beginner:
trigger Autofill on Event (before insert, before update) {
Set<String> ids = new Set<String>();
for(Event evt: Trigger.New)
{
if(evt.Appointment_with__c != null)
{
ids.add(evt.Appointment_with__c);
}
}
List<Staff__c> dclocation = [SELECT Id, Name FROM Staff__c WHERE Name in: ids];
for(Event evt1: Trigger.New)
{
evt1.Staff__c = dclocation[0].id;
}
}
I keep getting 'Invalid type: Staff__c'
Variable does not exist: id'
- Faizan Ali 17
- November 12, 2020
- Like
- 0
- Continue reading or reply
Package download error - what is happening
1. (ReportsforPackage/Campaigns_with_Influenced_Closed_Opps) ReportType: CustomizableCampaignInfluence is not available
ReportsforPackage/Campaigns_with_Influenced_Closed_Opps: ReportType: CustomizableCampaignInfluence is not available
2. (ReportsforPackage/Campaigns_with_Influenced_Open_Opps) ReportType: CustomizableCampaignInfluence is not available
ReportsforPackage/Campaigns_with_Influenced_Open_Opps: ReportType: CustomizableCampaignInfluence is not available
I thought it was because they didn't have campaign influence turned on in their instance, but they do. What else could it be?
- Reachdesk Demo
- November 11, 2020
- Like
- 0
- Continue reading or reply
How to make 64% to 100% code coverage for Test class for Batchable to insert records, iterate over the results, and persist information about any failures to the database
How to make 64% to 100% code coverage for Test class for Batchable to insert records, iterate over the results, and persist information about any failures to the database
Here is class
global class ertnoonbatch3pm implements Database.Batchable<sObject> { global Database.QueryLocator start(Database.BatchableContext BC) { // collect the batches of records or objects to be passed to execute String query = 'select Case__c, Level_1__c, Level_2__c,Level_3__c FROM ERT_Case_Type__c'; System.debug('ERT Case No is =====>' +query); return Database.getQueryLocator(query); } global void execute(Database.BatchableContext BC, List<ERT_Case_Type__c> exeList) { // process each batch of records List<Case_Type__c> listCTD = new List<Case_Type__c>(); System.debug('ERT Case No is =====>' +exeList); for(ERT_Case_Type__c exe : exeList) { listCTD.add(new Case_Type__c(Case__c=exe.Case__c,Level_1__c=exe.Level_1__c,Level_2__c=exe.Level_2__c,Level_3__c=exe.Level_3__c)); // System.debug('ERT Case No is =====>' +Case__c); } System.debug('ERT Case No is =====>' +listCTD); insert listCTD; Database.SaveResult[] srList = Database.insert(listCTD, false); // Iterate through each returned result for (Database.SaveResult sr : srList) { if (sr.isSuccess()) { // Operation was successful, so get the ID of the record that was processed System.debug('Successfully inserted Case_Type__c: ' + sr.getId()); } else { // Operation failed, so get all errors for(Database.Error err : sr.getErrors()) { System.debug('The following error has occurred.'); System.debug(err.getStatusCode() + ': ' + err.getMessage()); System.debug('Case_Type__c fields that affected this error: ' + err.getFields()); } } } } global void finish(Database.BatchableContext BC) { // execute any post-processing operations } }
here is test class
@isTest public class testertnoonbatch3pm{ static testMethod void testMethod1() { List<ERT_Case_Type__c> lstExecutive_RT= new List<ERT_Case_Type__c>(); Case c = new Case(); c.Contact_First_Name__c = 'first name'; c.Contact_Last_Name__c = 'last name'; c.Address_Line_1__c = 'first name'; c.Address_Line_2__c = 'first name'; c.Address_City__c = 'first name'; c.Address_State__c = 'WA'; c.Address_Zip__c = '12345'; c.Home_Phone__c = '123-456-7890'; c.E_Mail__c = 'abc@abc.com'; c.hasdevice__c = true; c.IMEI__c = 1234567890123.0; c.InterestedinTFB__c = true; insert c; for(Integer i=0 ;i <200;i++) { ERT_Case_Type__c rt = new ERT_Case_Type__c(); //5001Q000016wP1BQAU rt.Case__c = c.Id; rt.Level_1__c ='Customer Service'; //rt.Level_1__c ='Customer Service'+i; rt.Level_2__c ='Customer Care - T-Mobile'; rt.Level_3__c ='Upholding policy - account services'; system.debug('inserted value'+rt); lstExecutive_RT.add(rt); } insert lstExecutive_RT; Test.startTest(); ertnoonbatch3pm objbatch3pm = new ertnoonbatch3pm(); DataBase.executeBatch(objbatch3pm); Test.stopTest(); } }
How to make this code100 % code covered ,here are code lines not covered
- fiona gentry
- November 10, 2020
- Like
- 0
- Continue reading or reply
Email Deliverability
- MKA
- November 10, 2020
- Like
- 0
- Continue reading or reply
Map is null
thanks
P
if( Trigger.isInsert){ Map<String, Product__c> prodMap = new Map<String, Product__c> ([select id,Zip_Code__c,Type__c from Product__c]); for (Product__c newprod : (List<Product__c>) trigger.New) { Product__c prod= prodmap.containskey(newprod.Zip_Code__c) ? prodmap.get(newprod.Zip_Code__c) : null; string fieldtype = newprod.Type__c == 'Field' ? 'F' : 'R'; if(prod!= null){ string prodname = fieldtype; string postal = newprod.Zip_Code__c; integer prodnum = prodMap.size()+1; newprod.Name = fieldtype +'_'+ newprod.Zip_Code__c +'_'+ prodnum; } } }
- Phuc Nguyen 18
- November 10, 2020
- Like
- 0
- Continue reading or reply
How to send email on delete?
- MKA
- November 10, 2020
- Like
- 0
- Continue reading or reply
Test class for Batchable to insert records, iterate over the results, and persist information about any failures to the database
Need a Test class for Batchable class with database.insert function then saves the results and iterate through each results
global void execute(Database.BatchableContext BC, List<ERT_Case_Type__c> exeList) { // process each batch of records List<Case_Type__c> listCTD = new List<Case_Type__c>(); System.debug('ERT Case No is =====>' +exeList); for(ERT_Case_Type__c exe : exeList) { listCTD.add(new Case_Type__c(Case__c=exe.Case__c,Level_1__c=exe.Level_1__c,Level_2__c=exe.Level_2__c,Level_3__c=exe.Level_3__c)); // System.debug('ERT Case No is =====>' +Case__c); } System.debug('ERT Case No is =====>' +listCTD); insert listCTD; Database.SaveResult[] srList = Database.insert(listCTD, false); // Iterate through each returned result for (Database.SaveResult sr : srList) { if (sr.isSuccess()) { // Operation was successful, so get the ID of the record that was processed System.debug('Successfully inserted Case_Type__c: ' + sr.getId()); } else { // Operation failed, so get all errors for(Database.Error err : sr.getErrors()) { System.debug('The following error has occurred.'); System.debug(err.getStatusCode() + ': ' + err.getMessage()); System.debug('Case_Type__c fields that affected this error: ' + err.getFields()); } } } } global void finish(Database.BatchableContext BC) { // execute any post-processing operations } }
- fiona gentry
- November 10, 2020
- Like
- 0
- Continue reading or reply
How to retrieve the Account id
list<Configuration__c> conf = [select id, name, Basket__r.id, Basket__r.Account__r.id from Configuration__c where Basket__r.id = : basketId]; for (Configuration__c confList: conf){ Attachment att = [select id, body from Attachment where name like parentId = :confList.id]; system.debug(att); system.debug(att.Body); system.debug(att.Body.toString()); list <Guarantee_Line__c> guara = new list <Guarantee_Line__c>(); guara = GuaranteeCreator.createGuarantee(att.Body.toString(), confList, Account id); }
- Christos Kolonis
- November 09, 2020
- Like
- 0
- Continue reading or reply
Apex class search for value in Field
For example a new record is created and the code Id is 12345
If a record exist with this value I need to set the new record code Id to 12345_001. This will continue so if the latestcode ID value is 12345_054 the new code Id needs to be 12345_055
So how do I search for this value and set the new one? Will this be an issue on data loads?
Thanks,
P
- Phuc Nguyen 18
- November 09, 2020
- Like
- 0
- Continue reading or reply
How to auto increment Object Name when created or deleted
Need some help creating a process for creating an object name. So the name will be a text value plus an auto incremetnted value.
For example Opportunity created would be 'Test_001 '
But what if the count is up to Test_089 and they need to delete 5 opportunities and the opportunities are in different sequences? So they need to delete Test_055 and Test_041 and Test_020. The naming needs to stay in sequencial order. Is this possible?
How do I handle the naming when they do a data load?
Thanks,
P
- Phuc Nguyen 18
- November 09, 2020
- Like
- 0
- Continue reading or reply
Click on any action button should validate whether user has read/write or read access
- Hemant Reddy
- November 08, 2020
- Like
- 0
- Continue reading or reply
How To Error Handle Batchable Salesforce apex code such that it shouldn't be failing where the Level1, Level2 or Level3 are not there.
Here is my current Batchable apex code,currently this batch job copies the data over from the new custom object ERT_Case_Type__c to the old custom object Case_Type__c
But problem is this job failing where the Level1, Level2 or Level3 are not there.
This is due to the old picklist restricting based on what values we had in the old picklist on these 3 fields...so I have removed that restriction on the 3 Level fields in Case Type
How can i make sure that Batchable Salesforce apex code shouldn't be failing where the Level1, Level2 or Level3 are not there.
global class ertcopybatch3pm implements Database.Batchable<sObject> { global Database.QueryLocator start(Database.BatchableContext BC) { // collect the batches of records or objects to be passed to execute String query = 'select Case__c, Level_1__c, Level_2__c,Level_3__c FROM ERT_Case_Type__c'; System.debug('ERT Case No is =====>' +query); return Database.getQueryLocator(query); } global void execute(Database.BatchableContext BC, List<ERT_Case_Type__c> exeList) { // process each batch of records List<Case_Type__c> listCTD = new List<Case_Type__c>(); System.debug('ERT Case No is =====>' +exeList); for(ERT_Case_Type__c exe : exeList) { listCTD.add(new Case_Type__c(Case__c=exe.Case__c,Level_1__c=exe.Level_1__c,Level_2__c=exe.Level_2__c,Level_3__c=exe.Level_3__c)); // System.debug('ERT Case No is =====>' +Case__c); } try { System.debug('ERT Case No is =====>' +listCTD); insert listCTD; } catch(Exception e) { System.debug(e); } } global void finish(Database.BatchableContext BC) { // execute any post-processing operations } }
Thanks in advance,
Fiona
- fiona gentry
- November 08, 2020
- Like
- 0
- Continue reading or reply
Community Users Login Option
- NewSFDCDeveloper
- November 07, 2020
- Like
- 0
- Continue reading or reply
How to deal with white spaces in key JSON value
I need to create records based on a JSON. The problem right now is that the key value of the JSON contains white spaces, so the deserialization comes with null values. How can i deal with that?
public class GuaranteeJSON { public List<Configurations> configurations; public class Configurations { public String guid; public String Guarantee Type; public String Guarantee Amount; public String In Advance Amount; } public static GuaranteeJSON parse(String json) { return (GuaranteeJSON) System.JSON.deserialize(json, GuaranteeJSON.class); } }
- Christos Kolonis
- November 07, 2020
- Like
- 0
- Continue reading or reply
sobject update API returning NOT_FOUND error code
Following is my REST call
GET https://xxx.xxx.xxx/services/data/v49.0/sobjects/Contact/updated?start=2020-11-01T00%3A00%3A00%2B05%3A30&end=2020-11-06T14%3A56%3A00%2B05%3A30
But I keep getting
[
{
"errorCode": "NOT_FOUND",
"message": "The requested resource does not exist"
}
]
What am I missing here ?
Thanks
Suhel
- Suhel Cruise
- November 06, 2020
- Like
- 0
- Continue reading or reply
Trigger Task On Account
Application is child to account, Application has picklist field status__c
if, Application Statas__c ='inProgress' , Account and Opportunity records should get locked,
if status=='InProgress' records should get unlock.
- himanshu huske 7
- November 25, 2020
- Like
- 0
- Continue reading or reply
expecting a right parentheses, found 's'
but query gets failed on soap ui as well as developer console with error :
from Group where (Name = 'AMER SDR's Group') AND Group.Type='Regular'
^ERROR at Row:1:Column:45
expecting a right parentheses, found 's'
Escaping ' with ' not worked
- Ikram Momin 16
- November 25, 2020
- Like
- 0
- Continue reading or reply
Field to hold multiple date/time stamps
- Matt de Camara
- November 24, 2020
- Like
- 0
- Continue reading or reply
No option to upgrade to Master Detail
I'm trying to upgrade a lookup to Lead from a custom object to Master-detail, but the option is not there.
- This is a custom object
- There are records already
- Every record has Lead populated
J
- Specialist Queue
- November 24, 2020
- Like
- 0
- Continue reading or reply
Error: Compile Error: Missing ')' at ',' at line 20 column 62
I am receiving above error in below code
global class RetrieveMedicalInquiryStatusBatchMVN implements Database.Batchable<sObject>, Database.AllowsCallouts, Database.Stateful, Schedulable {
String query = 'SELECT Id,Account_vod__c, Status_vod__c, MA_Response_AZ__c ' +
// Query Closing
'FROM Medical_Inquiry_vod__c ' +
'WHERE Sent_to_GMIP_MVN__c = TRUE ' +
'AND Id IN :Ids';
List <String> statuses;
List<String> Ids = new List<String>('a0tU000000784Gbdue' , 'a0tU00000090WERThc') ;
Can you please help me in sorting this out
Thanks,
Monisha
- Monishan M
- November 23, 2020
- Like
- 0
- Continue reading or reply
Approval process - When is Date is added or changed
When the date is changed or added in the field, Process the Approval process. In Approval process i want to perform the Approval Request, Approval Accepted ,Approval Denied.
how it can be achieved. If it is achieve through Wokflow, please let me know the possible cases.
- Ranjith Dev
- November 23, 2020
- Like
- 0
- Continue reading or reply
How to convert <table> to image and download?
- sujin h s
- November 23, 2020
- Like
- 0
- Continue reading or reply
Upserting records from JSON
below is my apex code:
HttpRequest req = new HttpRequest(); req.setMethod('GET'); req.setTimeout(120000); req.setEndpoint('<endpoint>'); req.setHeader('Authorization', 'Bearer ' + '<bearer token>'); Http http = new Http(); HTTPResponse res = http.send(req); String response = res.getBody(); JsonParser jsondes = (JsonParser) JSON.deserialize(response, JsonParser.class);
I have a JSON Parser class and it is as follows:
public class JSONParser{ public Integer code; public cls_value value; public class cls_value { public cls_data[] data; public String message; public Integer code; } public class cls_data { public String agencyName; public String agentID; public string id; } }
Now, from the above code peice, ID is unique and if the id matches with existing Policy__c's Unique_ID__c field value, the record should be updated. Else, the record should be inserted.
Can anyone please let me know on how to do so.
Thanks!
- sksfdc221
- November 23, 2020
- Like
- 0
- Continue reading or reply
Is changed for fomula
Can anyone help me with the below requirement?
I need to add a condition for updating the records when country value is equal to Singapore of Philippines or if the country value changes then the record should get updated
- Shruthi Narsi
- November 23, 2020
- Like
- 0
- Continue reading or reply
query api to get contact details using email id
- iliyas bagwan
- November 23, 2020
- Like
- 0
- Continue reading or reply
How do i get myself into a Sandbox without refreshing?
Hey Admins! How do i add myself to a sandbox?
New Admin here. i cannot refresh a Sandbox and old Admin is gone, any way to get myself into Sandbox without refreshing?
- Jorge Diaz 28
- November 23, 2020
- Like
- 0
- Continue reading or reply
Filtered Lookup component
So My first question is can I use something like this to resolve my issue: https://sfcure.com/2019/07/06/showing-a-lookup-field-which-respects-with-lookup-filters/
Second. Do I need a separate custom lookup component for each filtered lookup field?
Thanks
P
- Phuc Nguyen 18
- November 23, 2020
- Like
- 0
- Continue reading or reply
What is the correct syntax to combine OR and AND in soql query?
Need a query that basically says
(ExposeCase = true OR CreatedByID = UserInfo.getUserId()) AND isClosed = false
which would be in the following syntax and sort of a combination of these:
soql += ' Where CreatedById = \'' + UserInfo.getUserId() + '\' OR Expose_Case__c = true';
soql += ' Where Expose_Case__c = true AND isClosed = false';
I am unable to figure out the syntax. I've tried the following
soql += ' Where CreatedById = \'' + UserInfo.getUserId() + '\' OR Expose_Case__c = true' + 'AND isClosed = false';
- Vinay Temburnikar 7
- November 22, 2020
- Like
- 0
- Continue reading or reply
Identify if a value in a record is the same as the value on another record.
For example:
Record A: Serial__c = 12345
Record B: Serial__c = 12345
I would liek to create a query that group in a list all the Sobject that have the same value in the Serial__c.
- Marco Polo
- November 22, 2020
- Like
- 0
- Continue reading or reply
Send customer an email after CaseComment
Hello,
I've been having some issues getting emails to send when inserting a CaseComment. I'm currently using the nForce npm module as my program is written for use with nodejs.
Some sample code
const casecoment = nforce.createSObject('CaseComment', { CommentBody: 'API-based nForce test for a comment', ParentId: cParentId, IsPublished, }); org.insert({ sobject: casecoment, oauth, }, (err, resp) => { if (err) { console.log("Could post to case comment"); console.log(JSON.stringify(err)); } else { console.log('posting comment worked!'); } });
What I'm wondering is what else I may need to do in order to get emails for case updates to the contact sent out. I'm able to get emails as the case owner without any issues. On the CaseComment sObject page, I saw that "IsNotificationSelected" is a column I can read, but isn't something I can create as I just receive an error when adding it to my code above.
Is there a way to programmatically have the notification email sent out like the "Send Customer Notification" in the website interface?
- Robert Baker 4
- November 21, 2020
- Like
- 0
- Continue reading or reply
Click on any action button should validate whether user has read/write or read access
- Hemant Reddy
- November 08, 2020
- Like
- 0
- Continue reading or reply