CodeIgniter Forums
[SOLVED] can't save transaction without details - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: [SOLVED] can't save transaction without details (/showthread.php?tid=27165)

Pages: 1 2 3 4 5 6 7 8 9 10 11


[SOLVED] can't save transaction without details - El Forum - 02-08-2010

[eluser]theprodigy[/eluser]
before I can make a proper response, I need to know the structure of your sec_companyaccess table (what columns do you have, and what columns are not allowed to be null)


[SOLVED] can't save transaction without details - El Forum - 02-08-2010

[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1265708505"]before I can make a proper response, I need to know the structure of your sec_companyaccess table (what columns do you have, and what columns are not allowed to be null)[/quote]

i have attached here the image of the sec_companyaccess table you can look at it.


[SOLVED] can't save transaction without details - El Forum - 02-08-2010

[eluser]theprodigy[/eluser]
can I assume that:
1. company_access_id is auto_incremented
2. user_id and company_id are both required (not null)

If so, you might be in trouble. The user_id is not getting passed with the creation of the company.
And if this is setup the way I think it is, you are trying to create a company in a grid that is showing a list of companies assigned to the user you are viewing.

Which means one of two things:
1. You should create the company in a different section of the site, and use this to assign a pre-made company to the user.
2. You can grab the user_id from session, or URL, or where ever you are keeping it stored, and pass it to the savecompany_details method along with the rest of the info.


[SOLVED] can't save transaction without details - El Forum - 02-08-2010

[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1265709244"]can I assume that:
1. company_access_id is auto_incremented
2. user_id and company_id are both required (not null)[/quote]

yes your assumptions were right.

Quote:If so, you might be in trouble. The user_id is not getting passed with the creation of the company.
And if this is setup the way I think it is, you are trying to create a company in a grid that is showing a list of companies assigned to the user you are viewing.

yes.. im having a hard time to do it because im just enhancing the web app. and even the database isn't cooperating with me... i can't view if have added the data correctly.

Quote:Which means one of two things:
1. You should create the company in a different section of the site, and use this to assign a pre-made company to the user.
2. You can grab the user_id from session, or URL, or where ever you are keeping it stored, and pass it to the savecompany_details method along with the rest of the info.

you mean that i will create another module for the company to call the user and integrate it with the pre-made company module??

how can i call the user_id via session?? thru the uri??


[SOLVED] can't save transaction without details - El Forum - 02-08-2010

[eluser]theprodigy[/eluser]
[quote author="maria clara" date="1265710050"][quote author="theprodigy" date="1265709244"]can I assume that:
1. company_access_id is auto_incremented
2. user_id and company_id are both required (not null)[/quote]

yes your assumptions were right.

Quote:If so, you might be in trouble. The user_id is not getting passed with the creation of the company.
And if this is setup the way I think it is, you are trying to create a company in a grid that is showing a list of companies assigned to the user you are viewing.

yes.. im having a hard time to do it because im just enhancing the web app. and even the database isn't cooperating with me... i can't view if have added the data correctly.

Quote:Which means one of two things:
1. You should create the company in a different section of the site, and use this to assign a pre-made company to the user.
2. You can grab the user_id from session, or URL, or where ever you are keeping it stored, and pass it to the savecompany_details method along with the rest of the info.

you mean that i will create another module for the company to call the user and integrate it with the pre-made company module??

how can i call the user_id via session?? thru the uri??[/quote]

Here is how I typically do things:
1. Company management section (add, edit, delete companies)
2. User management section (add, edit, delete users)

In section 2 (user management) is the ability to assign them to a company that was added in section 1 (company management). In the user management section, there is no adding, deleting, or modifying of company data in any way. Only user data.

Here is how it appears you are doing it:
1. User management section

In section 1 is the ability to add, edit, delete companies and assign them to the current user.

Do I have this assumption correct, or am I missing something?


[SOLVED] can't save transaction without details - El Forum - 02-08-2010

[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1265710650"]

Here is how it appears you are doing it:
1. User management section

In section 1 is the ability to add, edit, delete companies and assign them to the current user.

Do I have this assumption correct, or am I missing something?[/quote]

yes your assumptions was right.. because in one form i have the user info and below is the company info in the jquery grid. i have to add, edit, delete company_code and company_name in the jquery grid


[SOLVED] can't save transaction without details - El Forum - 02-08-2010

[eluser]theprodigy[/eluser]
when you submit the form to add the company_name and company_code, is it possible to also grab the user_id from the form above and send that as well?
This may be easy on editting a user, but on the add a user, you probably won't have a user_id yet, so you'll have to do a work around (like add the user, then afterwards, let them assign companies to them).


[SOLVED] can't save transaction without details - El Forum - 02-09-2010

[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1265716467"]when you submit the form to add the company_name and company_code, is it possible to also grab the user_id from the form above and send that as well?
This may be easy on editting a user, but on the add a user, you probably won't have a user_id yet, so you'll have to do a work around (like add the user, then afterwards, let them assign companies to them).[/quote]

yes,but i have to be able to save first the company_code and company_name in the jquery grid because if it was not save, when you click the save button above, there will be a message stating "cannot save transaction without details" which pertains to the jquery grid. i have attached here the image of the form i am working at.


[SOLVED] can't save transaction without details - El Forum - 02-09-2010

[eluser]theprodigy[/eluser]
well, since when you add the data via the jquery grid, it saves to the database, and sends the data back, then you shouldn't have to worry about making sure it gets saved first, because it will already be in the database by the time you click the save button.

So, when you click the save button, all you have to worry about is grabbing the company_id(s) from the submitted jquery grid, and using them in your query to add/edit the user.

Where are you stuck at?


[SOLVED] can't save transaction without details - El Forum - 02-09-2010

[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1265718551"]well, since when you add the data via the jquery grid, it saves to the database, and sends the data back, then you shouldn't have to worry about making sure it gets saved first, because it will already be in the database by the time you click the save button.

So, when you click the save button, all you have to worry about is grabbing the company_id(s) from the submitted jquery grid, and using them in your query to add/edit the user.

Where are you stuck at?[/quote]

im stuck at the jquery grid details because it wasn't posting the details in the jquery grid and it seems that it can't pull back the details the was saved there from the database whenever i refresh the grid (if you refreshed the grid the data should be already postedin the grid)so, when i click the main save button it recognizes not the jquery details so it has a message like "cant save transacetion without details".. and also i can't pull the company_id to the sec_companyaccess maybe that's why it was not posting anything in the jquery grid..