You need to sign in to do that
Don't have an account?

Wizard quick query
I have built a wizard, it goes through various steps and creates 3 records across 3 objects all linked.
I now want to create more than one type of record on the same object and again link, but when I do only one record is created.
Is there anything obvious I should be doing.
Thanks
Ross
Its very difficult to suggest anything without sight of the code.
Thanks for the post, and sorry for not posting the code, it's below. As you can see it's very basic. There is a also a very basic visualforce page.
The booking object is easy. The customer object is basically the same as contact. The traveller object is really a junction which allows me to have a lookup (1 to many) to both customer and booking.
The wizard creates 1 booking, customer and traveller records. But I need it to be able to create many customer and traveller. And to be honest not sure how to start. Any advice would be great.
Thanks
Ross
Do you want to create these all in the save method? E.g. are a bunch of different types to create at the same time or similar?
Thanks for the reply.
This is a good example you might have one booking for one person. So one booking, traveller and customer record.
You could have a booking with 3 people so 1 booking 3 customer and 3 traveller records.
I need them all created and saved within the same action.
Right now I have a simple solution which is you create a booking with one person and the booking, traveller and custom records are created and linked. You are then returned to the booking page and you simply add the extra travellers.
It would be nice to have this all in one Wizard.
So at the moment can you capture the three people into your booking form?
If you can (for example) capture them into a list, you could simply iterate that to create the objects like so:
Hi,
Thanks so much for sample code and kind of understand the principle.
At the moment no, I can only create one booking, one customer, one traveller.
I want to be able to create many.
I have tried to create more but it's clear to me that the code I have is wrong.
I will use the code you sent to try and build a solution.
Thanks again for taking the time.
Thanks again for your help. Just wanted to ask another question, very similar.
I have an expense form object (master) and an expense item object (child). Idea is you create the form and then, via the related list add new expense items. I want to simplify the data entry process using a wizard which would auto populate some of the fields on the child using the master.
So there will be one expense form and many expense items. The controller below was based on the code you kindly provided but I am going wrong.
All I am looking for is to be able to create the form and then as many items as need using visualforce and this controller. Any tips would be good.
It looks like the right sort of thing - can you explain a bit about how you are going wrong?
Yeah I just can't see were I am going wrong, the problem is with the save page reference. I keep getting errors like
Variable does not exist: Eforms at line 26 column 36.
You are getting this error because you don't have a property on the controller called eforms. You have one called eform, but that is a single instance rather than a list, so you can't iterate it.
If I read correctly, this is a user filling in an expenses form with expenses items. That being the case, presumably you should be iterating the eitems added to the page and creating a new instance of Expense_Item__c for each of those.