Michel_ VIP
Total posts: 61
18 Jun 2012 00:47

The add new record (frontend) works fine and is very easy to use.

But I'd like to use some fields (in the form content) to add them in another (non Cobalt) table.

Very easy to do ... except that I don't find where to add my code !

Can you tell me which file I have to modify ?

I try to find it for a few hours, but I'm really lost... ._.

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
18 Jun 2012 07:24

That really depends. If you use core Cobalt fields then you go to /controllers/form.php and add your code in postSaveHook()

If you have your own field then you have special method there.

Explain more.


Michel_ VIP
Total posts: 61
19 Jun 2012 16:50

Thanks, Sergey.

I added my code in postSaveHook() , and it works fine.

But I have the same question with 'update' and 'delete' from the front-end (for registered users). I mean update and delete my own non Cobalt records.

Which files I have to modify ?


Sergey
Total posts: 13,748
19 Jun 2012 21:14

When you update the same postsavehook is triggered. For deletion go to /contrllers/records.php function delete()


Michel_ VIP
Total posts: 61
20 Jun 2012 17:08

Thanks for your help, Sergey.

It works just perfect, and because Cobalt is very well structured, it's easy to add some code.


Sackgesicht VIP
Total posts: 1,636
20 Jun 2012 17:22

@michel

Maybe you can post your code sample with some description here. It might help others who want to implement a similar solution.

Or Sergey might see a way to integrate this in a future Cobalt version, so that you dont have to do the changes every time a new Cobalt build is released (which is on a weekly basis as of now).


pepperstreet VIP
Total posts: 3,837
20 Jun 2012 18:43

Or Sergey might see a way to integrate this in a future Cobalt version, so that you dont have to do the changes every time a new Cobalt build is released (which is on a weekly basis as of now).

Agree with it, two thumbs up!

A.) What about a super-advanced CustomSQL Queries field ?

B.) Or extend the existing CustomSQL field parameter with externalDB credentials...

All this reminds me on CommunityBuilder Incubator -> CB AutoActions plugin -> Queries Action (Use case tutorial)


Sergey
Total posts: 13,748
19 Mar 2013 02:26

I can add event so extension code may be in the plugin.


pepperstreet VIP
Total posts: 3,837
08 May 2013 14:51

Sackgesicht

Or Sergey might see a way to integrate this in a future Cobalt version, so that you dont have to do the changes every time a new Cobalt build is released (which is on a weekly basis as of now).

Agree with it, two thumbs up!

A.) What about a super-advanced CustomSQL Queries field ?

B.) Or extend the existing CustomSQL field parameter with externalDB credentials...

All this reminds me on CommunityBuilder Incubator -> CB AutoActions plugin -> Queries Action ( Use case tutorial)

Any news on this? Or the events solution?

Powered by Cobalt