You need to sign in to do that
Don't have an account?
Bridgetree
pageBlockTable object contents to fields of another object
I have pageblock table having contents of one object. i have cretaed another custom object
with similar fields of table. I want to create instance of the pageBlocktable with the table of
the custom object fields.
How can i do it..
Any suggestion with code????
nadi
Can you please explain more what do you mean by "Instance of the PageBlockTable" ?
Thanks
Ankit Arora
Blog | Facebook | Blog Page
I don mean anything strange. I jus want to know how to have pageBlockTable with fields
belongs to two different objects.. rest i will do it..
If you want to show two different object data in pageblock table then I think you need a wrapper class to do this. Lets say i have a list of account and list of contact (considering we are not fetching the related contacts), now I can use only one list in pageblocktable. I can not loop on both together in "value" attribute of pageblocktable.
To do this you need a wrapper class in which both list will be passed and a single instance of wrapper will be returned. Now you can use that instance in pageblocktabe and display values of both objects.
Here is the sample code :
VFP
Class
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Thanks Ankit Sir, This Code is awsome but solves my requirement 50%
If we take the same example i want to copy the fields in Account fields to Contact fields.
Please tell me the modification
Sorry I didn't get you. Can you please explain more?
Thanks
Ankit Arora
Blog | Facebook | Blog Page
I have a Prdouct STD object and Trade Custom object. I have written a VFP for Trade object. Now with the above code i will get the products into the pageBlockTable, i will click the save button.
Once all other stuffs are done, i will click the save button. this creates a record in trade object. i want the same pageBlockTable to be in the record. So what is required is that, The values in the fields of Product object that come in the pageBlockTable should be copied to fields of Trade Object. i have created similar fields in the Trade object as well.
Did you find a solution? I have a similar requirement as well.
-Hkp716