Results 1 to 2 of 2

Thread: mssql trigger help

  1. #1
    Meyer is offline Sugar Community Member
    Join Date
    Oct 2006
    Location
    south africa
    Posts
    646

    Default mssql trigger help

    Good morning.

    to start of i am not a programmer so i try to help myself as i go by, but i ran into a problem.

    i created an update trigger on opeertunities custom which whould to a sum of all the contacts opertunities and update a field with that value.

    the update works but the trigger only fires if you press save twice?? i know theres something like an inserted column, but there it flies above my radar. please help.
    here is the trigger below

    ip_income_provider_info_cstm is a custom module i built with module builder -

    -----------------------------------------------------------------------------------

    ALTER TRIGGER [dbo].[ipassosiattejan]
    ON [dbo].[opportunities_cstm]
    after INSERT,DELETE,UPDATE
    AS

    --------------------------------------------------------------
    BEGIN
    UPDATE ip_income_provider_info_cstm
    SET sales_total1_c = Sales_Activity_Per_ip.l0_cstm_sum_association_amou
    FROM Sales_Activity_Per_ip INNER JOIN
    ip_income_provider_info_cstm ON Sales_Activity_Per_ip.id = ip_income_provider_info_cstm.id_c AND
    Sales_Activity_Per_ip.l0_cstm_sum_association_amou <> ip_income_provider_info_cstm.sales_total1_c
    WHERE (Sales_Activity_Per_ip.income_generator_month_c = 'january')
    SET NOCOUNT ON;

    END

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: mssql trigger help

    Have you checked the table ip_income_provider_info_cstm to see if the data is there after the first click on Save?

    I've seen similar behavior with other applications where it is related to a refresh issue, rather than the data not being written.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. problem to connecting SurarCRM 4.5.1g to MSSQL !Please Help me
    By everlives in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2007-11-11, 04:37 AM
  2. Moving Existing data from MySQL to MSSQL
    By Dustd in forum Installation and Upgrade Help
    Replies: 3
    Last Post: 2007-04-23, 06:18 PM
  3. Install SugarCRM OS, MSSQL 2005 on IIS5.1
    By vidtechsteve in forum Installation and Upgrade Help
    Replies: 1
    Last Post: 2007-04-01, 06:24 PM
  4. Install Sugar with MSSQL
    By power1000 in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2007-03-13, 05:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •