Linked Questions

0 votes
1 answer
3k views

callout inside for loop [duplicate]

I am inserting multiple records in a transaction then i have to send those details to another system. Currently after inserting i am querying the records in a list and inside for loop doing the ...
Raj SF's user avatar
  • 327
-1 votes
1 answer
3k views

How to query two unrelated objects? [duplicate]

I want to query two unrelated objects, and I can't create a lookup relationship between them. They have the same global picklist sets in both of them and I want to query the records from one of the ...
lipton98's user avatar
1 vote
1 answer
2k views

SOQL query on non-related objects [duplicate]

Account is a parent to Object B and Object C. Object B and Object C does not have any relationship. From Object B I want to find Object C's fields(like name etc.,) using Account in a single SOQL query....
Raksha's user avatar
  • 47
0 votes
1 answer
1k views

Refer to parent object in Trigger [duplicate]

I have a trigger on Contact which gets fetches 2 custom field from account (customfieldaccount) and contact(customfieldcontact). I am having null value for the custom field on the Account object. Here ...
fijit's user avatar
  • 3
0 votes
1 answer
1k views

How to avoid for loop and use map or some other technique for below logic [duplicate]

I have below code ,but not able to understand how i can avoid second for loop inside account please suggest public static void getOpenCaseOnAccount() { Map<id,user> userIds = new map<...
Sandy's user avatar
  • 7
0 votes
1 answer
914 views

how to avoid SOQL query inside for loop? [duplicate]

I have below code in which there is a SOQL query inside for loop. I have been advised to use map to avoid SOQL in the loop. As i am a beginner in Salesforce I dont know how to do it. Here's my code ...
Priya Mukherjee's user avatar
-2 votes
2 answers
432 views

How to relate a Case with a Contract using Apex? [duplicate]

Use case : Once contract is inserted with : record type = B2C AccountId = Case.AccountId ContactId = Case.ContactId GEG_Correspondance_Offre_Produit__r.Type_Energie__c = Case....
Farkous's user avatar
  • 27
0 votes
1 answer
318 views

Use Map instead of For loop in my Apex Trigger [duplicate]

I'm new to coding and I need help in modifying the apex trigger below to the correct one. Can you also help me in creating a test class for this? Thank you so much! trigger UpdateLadderedFields on ...
Salesforce Dev's user avatar
0 votes
1 answer
367 views

After Insert Trigger on Email Message to Update a field on Case [duplicate]

I have one custom checkbox field on Case named Check__c and I want it to be checked if the From Address of the incoming email message linked to that case is equal to the Case Owner's email. there is ...
SFDC Alex's user avatar
0 votes
1 answer
361 views

How to pull SOQL-query out of the loop in the trigger [duplicate]

Hello) I need to create a trigger that will record the number of reviews and the average rating from custom object (Review__c) in the corresponding fields on other custom object (Job_Applications__c). ...
Valentin Romanov's user avatar
-3 votes
1 answer
226 views

How to prevent loop in batch correct way [duplicate]

I have the following Batch which currently runs. I am still wandering if the way I set my for loops are correct. Is this solution the right way? I have a Quote which is related by several amount ...
Thomas's user avatar
  • 2,320
0 votes
1 answer
178 views

SOQL to be outside of for loop [duplicate]

I am new to Apex and I am trying to make SOQL to be outside of FOR Loops but then my trigger stopped working. Here is my code: trigger AccountFieldUpdate on Contract (after insert, after update) { ...
Nomad's user avatar
  • 15
0 votes
2 answers
86 views

How to avoid using SOQL with in For loop? [duplicate]

When i run the test code, it throws me message "System.LimitException: Too many SOQL queries: 101". How do i avoid using too many SOQL in this code. trigger GetObjLabel on Task (before ...
Saaki's user avatar
  • 55
-3 votes
1 answer
97 views

Bulkify the code [duplicate]

I have below code Please tell me how can i bulkify it:- Its checking for duplicate email and if found then a task is created. But because of this class many test classes are failing with error as too ...
Saachi's user avatar
  • 3
0 votes
0 answers
55 views

Trigger to update fields from one object to another (Relationship unrelated to each other ) [duplicate]

I have two custom objects:- 1.Product__c:- Fields - L1__c,L2__c,L3__c,L4__c,L5__c,Origin__c,Craft__c,Fabric__c,Zari_type__c 2.L1_L5_Master__c:-Fields - L1__c,L2__c,L3__c,L4__c,L5__c,...
Gyan in Salesforce's user avatar

15 30 50 per page