You need to sign in to do that
Don't have an account?
Salesforce@322
how to insert record by using wrapper class
Hi All,
am new to wrapper class.I got an urgent requirement like i have 3 objects
as object 1
object 2
object 3
i need to get 3 objects data and with some calculations on the field i need to insert the
record in object 2 with the remaining objects data in apex class.
I used for loops for the above requirement but it is throwing "CPU TIME LIMIT EXCEEDED" exception
so, i thought it is better to take help of wrapper class.
Is it my idea is correct ?
Can we insert record by using wrapper class which contains 3 custom objects data ?
If it is possible means please provide any sample code or links whatever.
Thanks ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
am new to wrapper class.I got an urgent requirement like i have 3 objects
as object 1
object 2
object 3
i need to get 3 objects data and with some calculations on the field i need to insert the
record in object 2 with the remaining objects data in apex class.
I used for loops for the above requirement but it is throwing "CPU TIME LIMIT EXCEEDED" exception
so, i thought it is better to take help of wrapper class.
Is it my idea is correct ?
Can we insert record by using wrapper class which contains 3 custom objects data ?
If it is possible means please provide any sample code or links whatever.
Thanks ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
I've mention some good Links here that will helps you and also help to you to understand the concept of Wrapper class in Apex.
https://developer.salesforce.com/page/Wrapper_Class
https://success.salesforce.com/answers?id=90630000000hSoLAAU (This is the same question like your question)
If this links help you than please mark it as solution and help other. Enjoy APEX
Thank you soo much for your fast reply
Actually my requirement is :
1.Iam using 3 objects
2.OBJECT 1,2,3 's data should be copied to OBJECT 1
by doing some calculations for every field
3.Every field calculation are in seperate methods in the same class which are taking the object 1,object2,object3 field values and then calculating and finally returning the value
4.so, i need to call those methods when ever am assigning the values to object 1 fields
and then finally insert
This is urgent i have to fix this issue today itself ,So am hoping that i will get the reply from you soon
Thanks,,,,,,,,,,,,,,,
Thank you soooo much for your links,
defenetly i will look into that links so that will help for me to know about the wrapper class
http://www.forcexplore.com/2014/07/wrapper-class-in-salesforce.html