Redirect to a list on formation update or another form if New data

maphaneuf

New Member
Hi, i have 2 forms, one for clients and one for lead.
I want to add leads and link those lead to clients.

I start by adding a client, then I redirect to the lead form. The forms are linked with databasejoin on client id.
When i want to edit ? customer from the lead form, I want to be redirected to the lead list and not the lead form.
 
OMG, I was trying so hard to do this with php code inside the condition and it was so simple.
It works like a charm.
Now I just need to ajust small things, but thank you.
 
OK, I want to improve this little thing,
in my form that I have, I have a yes/no field that I want to look at the value to decide where I redirect. In my menus, I have the same list, but they are prefiltered according to the yes/no field element.

So my form as 3 redirect now
redirect 1 - New
redirect 2 - Edit yes/no flag = 0
Redirect 3 - Edit yes/no flag = 1

I create these condition to run as per example on the wiki

Redirect 1
$leadweb = '{e10g_bdc_clients___Lead_web}';
return (int) $leadweb === 0;

Redirect 2
$leadweb = '{e10g_bdc_clients___Lead_web}';
return (int) $leadweb === 1;

I know the $leadweb is returning a 0 or a 1, I use dump($var, "name"); to print the data from variable, but it seems it always run the redirect 1 wheater the $leadweb = 0 or 1.
 
Which site / form is this? I need to log in and take a look.

And is it live, can I submit test data?

-- hugh
 
It is a live site.

Elog.technocritik.com
I put in all the login info on my fabrication data.

Menu bdc/opportunit? Web.
 
When in the List
http://www.elog.technocritik.com/index.php?option=com_fabrik&view=list&listid=25&Itemid=219

if I select to edit an object, any one, There is a tab called client, and another called client 1. Client1 is the one if I click on the customer name, I should eb able to edit the data and based on the yes /no fields I want to be redirected to one or another list.

If customer is to Yes, should be redirected to:index.php?option=com_fabrik&view=list&listid=25&Itemid=219

If set to NO: index.php?option=com_fabrik&view=list&listid=25&Itemid=167

Initially, I created a custom link to add new data, so I can create a customer first and once I create the customer, I get redirected to another form to create the log data.
I then changed that to a LEFT JOIND database in my list so I can edit the customer info at the same time as the log data, but I noticed that by doing this, I create doubles in my database so if I edit a listing after it was save, it seems to recreate a new customer each time so I don't get consistent data. I want to go back to my original idea of creating 1 form to create the cusstomer and then a log data. (

Client1 tab is the old way and how I want to do it and client is the database join fileds.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top