You need to sign in to do that
Don't have an account?
salesforce sfdx
Requirement to create Records depending on the Quantity in Flow
Custom Object: Product__c
Custom Fields: Name, Quantity__c, Address__c, EmiNumber__C.
If User Creates a record :
Name ='Samsung Pro Max';
Quantity=10;
Address='xxxx'.
After Save
Here i need to Create same product with ten Records.
Say...!
Name ='Samsung Pro Max';
Quantity =1;
Address='xxxx'.
Name ='Samsung Pro Max';
Quantity =1;
Address='xxxx'.
Name ='Samsung Pro Max';
Quantity =1;
Address='xxxx'.
------------->so on 10 times
including the first record to be updated as 1
so that i can track each item seperately .
Can this action can be acheived using the flow.
Thanks
Prathushya Reddy.
Custom Fields: Name, Quantity__c, Address__c, EmiNumber__C.
If User Creates a record :
Name ='Samsung Pro Max';
Quantity=10;
Address='xxxx'.
After Save
Here i need to Create same product with ten Records.
Say...!
Name ='Samsung Pro Max';
Quantity =1;
Address='xxxx'.
Name ='Samsung Pro Max';
Quantity =1;
Address='xxxx'.
Name ='Samsung Pro Max';
Quantity =1;
Address='xxxx'.
------------->so on 10 times
including the first record to be updated as 1
so that i can track each item seperately .
Can this action can be acheived using the flow.
Thanks
Prathushya Reddy.
Trigger code below :
Try This below code if you are searching for Apex code.
Apex Class :-
public class ProductClass {
public static boolean firstTime = true;
public static void ProductMethod(){
list<product__c> Pl = new list<Product__c>();
for(integer i=0; i<=10; i++){
Product__c p = new Product__c();
p.Name = 'Samsung Pro Max '+i;
p.Quantity__c= 1;
p.Address__c = 'xxxx';
pl.add(p);
}insert pl;
}
}
Trigger Code :-
trigger ProductTrig on Product__c (after insert){
if(ProductClass.firstTime == true){
ProductClass.firstTime = false;
ProductClass.ProductMethod();
}
}
Note :- Let me know if it works are not.