• NagaSudheer Kamepalli 4
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I need to use the angular 6 with salesforce visualforce . Is that possible
I am looking to create a trigger off of a custom object (ObjA - Looks up to Accounts and Opportunities) that will create a record in custom object (ObjB) based on fields from ObjA and some related fields from Accounts/Opportunities.
I receive errors that my related fields do not exist. Can anyone provide insight?
 
trigger OpptyHierarchy on Additional_Account__c (after insert) {
	List<Opportunity_Hierarchy__c> recordsToInsert = new List<Opportunity_Hierarchy__c>();
	for (Additional_Account__c l : Trigger.new) {
		if (l.IsInsert) {
			Opportunity_Hierarchy__c la = new Opportunity_Hierarchy__c();
			V.Account__r.Name = O.Account_Name__c;
			v.Name = o.Account__c;
			v.Account__r.Enterprise_Account__r.Name = o.Enterprise_Account__c;
			v.Account__r.Billing_Location__r.Name = o.Main_Account__c;
			v.Opportunity__c = o.Opportunity__c;

	
			recordsToInsert.add(la);
		}
	}
	insert recordsToInsert;
}