Skip to main content
deleted 4 characters in body
Source Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

Newbie to salesforce and looking for a way to write a trigger that will create 11 line items for when a field is update. Object is credit request and when this is saved would like multiple credit lines to be added which is also an object. Below is a rough start, but looking for guidance. Picture attached showing what I would like to see after the request is saved and line items automatically created.

trigger TestCreditLinesAdd on Credit_Request__c(after insert){
List < Credit_Lines__c > creditlines = new List < Credit_Lines__c > ();
for (Credit_Request__c cr: trigger.new) {
    creditlines.add(new Credit_Lines__c(.Quantity__c = 0.001));
}
insert creditlines;}
 
[![enter image description here][1]][1]

enter image description here

Newbie to salesforce and looking for a way to write a trigger that will create 11 line items for when a field is update. Object is credit request and when this is saved would like multiple credit lines to be added which is also an object. Below is a rough start, but looking for guidance. Picture attached showing what I would like to see after the request is saved and line items automatically created.

trigger TestCreditLinesAdd on Credit_Request__c(after insert){
List < Credit_Lines__c > creditlines = new List < Credit_Lines__c > ();
for (Credit_Request__c cr: trigger.new) {
    creditlines.add(new Credit_Lines__c(.Quantity__c = 0.001));
}
insert creditlines;}
 
[![enter image description here][1]][1]

Newbie to salesforce and looking for a way to write a trigger that will create 11 line items for when a field is update. Object is credit request and when this is saved would like multiple credit lines to be added which is also an object. Below is a rough start, but looking for guidance. Picture attached showing what I would like to see after the request is saved and line items automatically created.

trigger TestCreditLinesAdd on Credit_Request__c(after insert){
List < Credit_Lines__c > creditlines = new List < Credit_Lines__c > ();
for (Credit_Request__c cr: trigger.new) {
    creditlines.add(new Credit_Lines__c(.Quantity__c = 0.001));
}
insert creditlines;}

enter image description here

Newbie to salesforce and looking for a way to write a trigger that will create 11 line items for when a field is update. Object is credit request and when this is saved would like multiple credit lines to be added which is also an object. Below is a rough start, but looking for guidance. Picture attached showing what I would like to see after the request is saved and line items automatically created.

trigger TestCreditLinesAdd on Credit_Request__c (after insert) { List<Credit_Lines__c> creditlines = new List<Credit_Lines__c>();

trigger TestCreditLinesAdd on Credit_Request__c(after insert){
List < Credit_Lines__c > creditlines = new List < Credit_Lines__c > ();
for (Credit_Request__c cr :  trigger.new)
  {
    creditlines.add(new Credit_Lines__c(.Quantity__c = 0.001));
}          
 insert creditlines;}

[![enter image 
insertdescription creditlines;here][1]][1]

} enter image description here

Newbie to salesforce and looking for a way to write a trigger that will create 11 line items for when a field is update. Object is credit request and when this is saved would like multiple credit lines to be added which is also an object. Below is a rough start, but looking for guidance. Picture attached showing what I would like to see after the request is saved and line items automatically created.

trigger TestCreditLinesAdd on Credit_Request__c (after insert) { List<Credit_Lines__c> creditlines = new List<Credit_Lines__c>();

for(Credit_Request__c cr :  trigger.new)
 {
  creditlines.add(new Credit_Lines__c(.Quantity__c = 0.001));
}          
    
insert creditlines;

} enter image description here

Newbie to salesforce and looking for a way to write a trigger that will create 11 line items for when a field is update. Object is credit request and when this is saved would like multiple credit lines to be added which is also an object. Below is a rough start, but looking for guidance. Picture attached showing what I would like to see after the request is saved and line items automatically created.

trigger TestCreditLinesAdd on Credit_Request__c(after insert){
List < Credit_Lines__c > creditlines = new List < Credit_Lines__c > ();
for (Credit_Request__c cr: trigger.new) {
    creditlines.add(new Credit_Lines__c(.Quantity__c = 0.001));
}
insert creditlines;}

[![enter image description here][1]][1]
Source Link
Chris
  • 33
  • 7

Need assistance in writing a apex trigger to add a list of standard lines to an object

Newbie to salesforce and looking for a way to write a trigger that will create 11 line items for when a field is update. Object is credit request and when this is saved would like multiple credit lines to be added which is also an object. Below is a rough start, but looking for guidance. Picture attached showing what I would like to see after the request is saved and line items automatically created.

trigger TestCreditLinesAdd on Credit_Request__c (after insert) { List<Credit_Lines__c> creditlines = new List<Credit_Lines__c>();

for(Credit_Request__c cr :  trigger.new)
{
  creditlines.add(new Credit_Lines__c(.Quantity__c = 0.001));
}          
    
insert creditlines;

} enter image description here