<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>[HOW TO] MySQL Trigger</title>
        <link>https://interactivetools.com/forum/forum-posts.php?HOW-TO-MySQL-Trigger-71609</link>
        <description></description>
        <pubDate>Sat, 07 Mar 2026 10:27:51 -0800</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;HOW-TO-MySQL-Trigger-71609" rel="self" type="application/rss+xml" />

                <item>
          <title>Re: [richb] [HOW TO] MySQL Trigger</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2206164#post2206164</link>
          <description><![CDATA[Hi richb,<br /><br />Glad that helped! :)<br /><br />There isn't documentation on creating plugins quite yet. Our plugin system is still relatively new and we're still settling on how we want to do things. Many plugins will require advanced knowledge of CMS Builder internals (or the determination to examine the source until such knowledge is gained.)<br /><br />The first parameter is known as the &quot;hookName&quot;. If you want to see where it's called, search the source code for 'record_presave'. You'll see that it's called by doAction(). There's also a sister function to that called applyFilters(). You can find out what other options there are for hookNames by searching the CMS Builder source code for doAction( and applyFilters(.<br /><br />Please note: this is not for the faint of heart! ;)<br />]]></description>
          <pubDate>Wed, 18 Aug 2010 15:24:10 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2206164#post2206164</guid>
        </item>
                <item>
          <title>Re: [chris] [HOW TO] MySQL Trigger</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2206140#post2206140</link>
          <description><![CDATA[This work great.  I added brand and category info to clearly define the &quot;sku&quot;.  Is there more documentation on creating plugins?  For example, on the addAction function the first parameter 'record_presave', what other parameters are there.  <br /><br />Thanks again this was perfect.<br />]]></description>
          <pubDate>Tue, 17 Aug 2010 22:01:54 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2206140#post2206140</guid>
        </item>
                <item>
          <title>Re: [richb] [HOW TO] MySQL Trigger</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2206133#post2206133</link>
          <description><![CDATA[Hi richb,<br /><br />I've modified the plugin to only function on a table called 'Products' and have attached it.<br />]]></description>
          <pubDate>Tue, 17 Aug 2010 16:52:46 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2206133#post2206133</guid>
        </item>
                <item>
          <title>Re: [chris] [HOW TO] MySQL Trigger</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2206130#post2206130</link>
          <description><![CDATA[Yes, I would like a specific example of how I would generate a unique sku.  Below is the specifics.<br /><br />Table: Products<br />Field: prodname [textfield]<br />Field: sku [textfield] (plugin to update this field on new rec)<br />Field: qty [textfield]<br /><br />Thank you<br />richb.<br />]]></description>
          <pubDate>Tue, 17 Aug 2010 15:38:19 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2206130#post2206130</guid>
        </item>
                <item>
          <title>Re: [richb] [HOW TO] MySQL Trigger</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2206127#post2206127</link>
          <description><![CDATA[Hi richb,<br /><br />The plugin I attached will generate &quot;unique&quot; sku's (see the documentation for PHP's uniqid function) for new records on any table that has a field called 'sku'. If your field is actually called 'SKU' instead of 'sku', you will need to change 'sku' to 'SKU' in the plugin.<br /><br />If you have other tables with 'sku' fields which you <b>don't</b> want auto-generated, let me know and I'll customize the plugin to only work for your Products table.<br /><br />To install the plugin, save it in your /cmsAdmin/plugins/ directory, log into CMS Builder, go to Admin -&gt; Plugins, find it there (it's called &quot;Custom Generate SKU&quot;) and activate it.<br /><br />Please let me know if you have any questions.<br />]]></description>
          <pubDate>Tue, 17 Aug 2010 15:14:16 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2206127#post2206127</guid>
        </item>
                <item>
          <title>Re: [chris] [HOW TO] MySQL Trigger</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2206086#post2206086</link>
          <description><![CDATA[I have a table called &quot;Products&quot; and in the table there is a field called &quot;SKU&quot;.  When a new product is entered I want to generate the unique sku.  How would this code look?<br />]]></description>
          <pubDate>Mon, 16 Aug 2010 22:46:16 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2206086#post2206086</guid>
        </item>
                <item>
          <title>Re: [richb] [HOW TO] MySQL Trigger</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2206069#post2206069</link>
          <description><![CDATA[Hi richb,<br /><br />The simplest solution would be to use the existing &quot;num&quot; field. You could add some silly-huge number to this to make your SKUs all look uniform.<br /><br />I think that using a trigger might not work because of how CMS builder updates records right after inserting them. I'm not entirely sure if this would work or not, but the good news is that it's super easy to do with a tiny custom plugin (see attached.)<br /><br />I hope this helps! Please let me know if you have any questions.<br />]]></description>
          <pubDate>Mon, 16 Aug 2010 14:41:42 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2206069#post2206069</guid>
        </item>
                <item>
          <title>[HOW TO] MySQL Trigger</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2206066#post2206066</link>
          <description><![CDATA[Do you see any issues with creating a MySQL Insert Trigger when a new row is created?  I have a field called &quot;SKU&quot; and I want this to be a random #.  Instead of user entering (and having to know a unique#) I was going to create a MySQL trigger to do this upon insert.  Any concerns?<br />]]></description>
          <pubDate>Mon, 16 Aug 2010 13:22:27 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2206066#post2206066</guid>
        </item>
              </channel>
    </rss>
  