close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Insert and update issue

Thread began 4/17/2012 1:25 pm by Christopher West | Last modified 4/19/2012 2:21 pm by Christopher West | 1912 views | 8 replies |

Christopher WestCommunity Expert

Insert and update issue

Hi there, I have a system where I am adding product options to a product. I have an Insert and an Update on the same page (wanted this method as its easier for the client to navigate around). The Insert works fine... but then I have 2 issues....

(the results are displayed on the same page - which is what i want so that client can update them (they are just tick boxes and a delete record link).

on the very first Insert the page doesnt display the newly inserted record (i noticed in the URL the product ID is missing...so I have to use the browser back button to come out of that page then reenter and then it appears)...however when I go and insert a second, third, forth..record for that same product..it updates the display of the page and all is fine (so the problem is ONLY on the first record being inserted for that product).

my second issue is that the update record doesnt do anything on that page...so I am wondering how I can get the insert and update to both work nicely on the same page.

here is the file in question....

regard in advance Chris

Attached Files
update-productoptions.zip
Sign in to reply to this post

Jason ByrnesWebAssist

Insert redirect: step back from this for a moment and think about it. The important thing to realize is this:
the redirect link is created before the record is inserted

this means that it is impossible to set the redirect link to pass the product ID before the product has been inserted to the database.

You should redirect the insert to the detail page, then if you want to update, click the link to load the update page, it would require hand coding to look up the inserted product ID to be able redirect to the update page.


for the update, you are trying to update multiple records, so you will need to use the update multiple records behavior, not the update single records

Sign in to reply to this post

Christopher WestCommunity Expert

Hi Jason thanks. I changed the update to a multi record update but getting this error :

Fatal error: Cannot redeclare WA_AB_getLoopedFieldName() (previously declared in C:\Server\www\dinky\WA_DataAssist\WA_AppBuilder_PHP.php:11) in C:\Server\www\dinky\webassist\database_management\wa_appbuilder_php.php on line 20

is this because I have used a repeat selection on another page and its trying to use the same variable.

Sign in to reply to this post

Jason ByrnesWebAssist

delete the requirte once line that is trying to attach the webassist\database_management\ wa_appbuilder_php.php file.

Sign in to reply to this post

Christopher WestCommunity Expert

is that because I have used Insert/Update that came with Secruity Assist and also Im now using Insert/Update that comes with Data Assist both using different references to appbuilder?

I have uploaded but its not updating the record unless I tick or untick ALL boxes down one column (for example for the records to update the code is forcing me to tick/untick all of "Price includeed boxes). bt I only want to tick one box per prodroduct depending on what I want to chose.

its so frustrating I thought I was getting good :( maybe lack of sleep is making me go wrong)

Attached Files
update-productoptions.zip
Sign in to reply to this post

Jason ByrnesWebAssist

in the update form, the checkboxes do not have a checked value. you need to provide a checked value for the checkboxes to store in the database when that box is checked, otherwise, it wont send any thing to trigger the update.

Sign in to reply to this post

Christopher WestCommunity Expert

Ive tried that but its still not working.....I have included the up to date file.. I know I have set something wrong but I think I have added so many that I am now lost in the code.

could you check the code file and see what I have overlooked :)

Chris

Attached Files
update-productoptions.zip
Sign in to reply to this post

Jason ByrnesWebAssist

I started an incident for an eCart issue you are having, I will look into this issue at the same time.

Sign in to reply to this post

Christopher WestCommunity Expert

Thanks Jason, as always i think I need to stand back and look at the logic when coding. Some many times I miss what can be considered so simple to others. Def a great learning experience talking and getting help with all you guys :)

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...