Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Trigger errorTrigger error
Previous
 
Next
New Post
2/22/2007 4:03 PM
 

Thank you - that was useful but did not answer my question.  I don't want to create a module or connect to another database or make any code changes to existing dotnetnuke code.  Instead, I want to create a trigger on the UserProfile table that fires when a new profile record is added.  This trigger adds a record to my own table in the dotnetnuke database.  That all works fine.  However, in certain conditions I want an error to be shown in the users browser.  Is it possible to get an error message to be displayed in the browser resulting from an error raised in the trigger?

Here is the trigger code

set

set

 

 

 

AFTER

AS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

END

 

END

ANSI_NULLS ON QUOTED_IDENTIFIER ONGOALTER TRIGGER [dbo].[AddUserProfile]ON [dbo].[UserProfile]INSERT BEGINDECLARE @DuplicateCount int, @PropertyDefinitionID int, @PropertyValue nvarchar(3750)DECLARE @err_message nvarchar(255)SET NOCOUNT ON;select @PropertyDefinitionID=PropertyDefinitionID, @PropertyValue=PropertyValue from inserted-- PropertyDefinitionID=39 is StoreNoif @PropertyDefinitionID=39 beginselect @DuplicateCount=count(*) FROM T_CuCustTest where StoreNo=@PropertyValueif @DuplicateCount>0 BEGIN-- message( "Store Number already exists")ROLLBACKSET @err_message = 'Store Number already exists on file' -- @CustomerID1 + ' and ' + @CustomerID2 + ' Not found raise sev 11'RAISERROR (@err_message, 11,1)END
 
New Post
2/23/2007 1:46 AM
 
Unless I am sorely mistaken, the trigger runs AFTER and OUTSIDE the scope of the sproc... so the answer would be no.

Scott Willhite, Co-Founder DNN

"It is only with the heart that one can see rightly... what is essential is invisible to the eye. "
~ Antoine de Saint-Exupéry

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Trigger errorTrigger error


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out