You need to sign in to do that
Don't have an account?
Mick Man
Apex + visualforce
I want to calculate the Nombre__c * Quantite__c, what should I do? please help me
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); } } }
Try this code:
Created an other parameter called Total and an other constructore which takes Joint instance and Total value to assign it back to its variables.
Hope it helps.
Thanks,
Balaji
All Answers
Were you looking for this?
(sum of all Nombre__c * sum of all Quantite__c) ??
If so, below code will help:
Note: The requirement is unclear, so just did the best i can, if it doesnt fit your requirement, please give the entire reuqirement and the object specficiations as asked by @ Suneel#8 so that the issue can be resolved quicker.
Thanks,
balaji
I sent you a picture for more detail
Try this code:
Created an other parameter called Total and an other constructore which takes Joint instance and Total value to assign it back to its variables.
Hope it helps.
Thanks,
Balaji
Thanks,
Balaji