• Aparna J
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
Could you please let me know the best way to auto populate lookup field based on other field value while inserting the records .

E.g :
1. We have a custom object and it has a lookup field for contact object
2.  While inserting the records in custom object, auto populate contact lookup field value based on email address in the record
Hi Everyone,
  I have Cus_Object__c and Account(Cust_Status__c in Account). In my Cus_Object__c have a field called 'Cus_Status__c' this field values are inserted by apex code.
Like:
Cus_Object__c cus  = new Cus_Object__c();
cus.Cus_Status__c = 'Success';

Whenever the Cus_Status__c field value is not null, I need to update Cus_Status__c field value in my Account object Cust_Status__c field.

Is possible? Any Suggestions?
Thanks in advance.
Hello All,
Was wondering if someone will help me with the best approach for adding  multiple child records:
Parent is Project  and finance is child.  The Child records will mostly be the same exexpt for a text field that I will populate:
List<Finance__c> finline = new List<Finance__c>();   

if(trigger.isInsert){        
            for (SObject so : Trigger.New) {
                Project__c newP = (Project__c) so;
                
                if (newP.ProjectChild__c != null ) { 
                   Finance__c newF = new Finance__c();
                        newF.Subject = newP.ProjectSubject__c;
                        newF.description__c = 'Custom text for finance record';
                        finline .add(newF);

                        newF.Subject = newP.ProjectSubject__c;
                        newF.description__c = 'Another Custom text for finance record';
                        finline .add(newF);

                }
            }
        }
Was wondering if there is a better way to perform this action.  There will be 5-6 child records.  Also, I will a different child record that will be created off the same parent record and there may be 3-4 records for this custom object.  
Any suggestions would be greatly appreciated.
Cheers,
P
 
Hi Everyone,

What I have done?
 Trigger to get Record when it's generate JSON data and validate. And, send that JSON data as a setBody while  sending  HttpRequest. Once the response get from web service, need a help to handling web service response.

Requirement:
 My team have a requirements regarding API call, 
We have a pass HttpRequest in the form of JSON data.While, requesting to web service need data field validations like remove null and empty data, required fields should be filled or else throw an error in record page.  And, get back HttpResponse as JSON form.Once, get Reponse from web service need to handling the server response if response.GetStatusCode == 200 'success' or else need to stop the process and throw an error on the record page.



Any Suggestions?
 Thanks in advance.