1 resposta
I will like to do it via trigger because you are making so many sub queries that it is difficult to do via process builder.trigger ProdTrg on Prod2 (After insert, After Update) { for (Product2 P : trigger.new) { list <Product2> lstProd = new list <Product2> (); if() //put your criteria here like P.fieldname == some value && P.fieldname == someother value and so on { // if the criteria to create a new product is meet Product2 NewProd = new Product2 (); NewProd.Name = 'Your Product Name here'; NewProd.ProductCode = 'Your Product Code here'; NewProd.Family = 'Your Product Family here'; NewProd.Historic_R&D_Record__c = P.id; lstProd.add(NewProd); } } insert lstProd;}Please let me know if this resolved your issue or you have any other confussion.