+ Start a Discussion
Mick ManMick Man 

Need a help

how can calculate the product of two fields in two different custom objecthel
PratikPratik (Salesforce Developers) 
Hi Micky,

If those 2 objects are having relationship in between them, then you can refer these fields in a Formula field. 

Thanks,
Pratik
Mick ManMick Man
Patrik thank you for your answer, but the problem is I have to create a custom Visualforce page, here is our little code
public class OdtDetailController2 
    {

       
         public list<wrapperclass> Jonintwrapper{get;set;}
         public list<wrapperclass> Odtwrapper{get;set;}
         
         public OdtDetailController2(ApexPages.StandardController controller) 
             {
                 list<Ordre_Travail__c> OrdreTravail = [SELECT id, name, Date__c, Produit__c, Nombre__c FROM Ordre_Travail__c  WHERE produit__c = 'a0Ic000000DCvwEEAT'];
                 list<JointMatProd__c> Jointure = [SELECT id, MatierePremiere__c, Quantite__c FROM JointMatProd__c  WHERE produit__c = 'a0Ic000000DCvwEEAT'];
             
                 Odtwrapper = new list<wrapperclass>();
                 for(Ordre_Travail__c Odt: OrdreTravail)
                     {
                        Odtwrapper.add(new wrapperclass(Odt));
                     }
                     
                 Jonintwrapper = new list<wrapperclass>();
                 for(JointMatProd__c Joint: Jointure)
                     {
                        Jonintwrapper.add(new wrapperclass(Joint));
                     }
              }
    
              public class wrapperclass
                  {
                       public Ordre_Travail__c ODT{get;set;}
                       public JointMatProd__c JOINT{get;set;}
                       
                       public wrapperclass(Ordre_Travail__c OrdreTravail) 
                           {
                                this.ODT = (OrdreTravail);
                           }
                           
                       public wrapperclass(JointMatProd__c Joint) 
                           {
                                this.JOINT = (Joint);
                           }
                  }
    }


and I have to calculate Quantite__c * Nombre__c