Over the years, I have had more than one occasion to wonder what planet the developers of IIS are from. It seems that every version of IIS has had at least one default setting that made no sense at all... probably not even on their planet.
Today installed an aspx application on a shiny new Windows 2008 R2 / IIS 7.5 environment.
When I ran the application, all the image tags were broken. I verified that the images were in the correct file location and that IUSR had read access to that folder. So why would NONE of the images display?
From the people who brought you Windows ME:
The answer is another poor decision by some IIS developer. By default, the static content role is not installed. Installing it fixes the issue.
I hereby issue a challenge to anyone who wishes to take it. Go try to find a single web site running on IIS that does not have at least one image AND does not use CSS. You will fail, because there isn't one... anywhere... I bet you would have trouble faking one. The whole point of a website is to render content, not just text.
So I am left to ponder the extreme depth of this obtuseness.... and dream of visiting this other planet.
David Jedziniak maintains this blog and posts helpful tips and tricks on SQL Server and Dynamics GP development. The opinions expressed here are those of the author and do not represent the views, express or implied, of any past or present employer. The information here is provided without warranty of fitness for any particular purpose.
Thursday, February 18, 2016
Tuesday, February 16, 2016
Did my trigger fire from and update, insert, or delete?
I recently got a question on a trigger and I could see that the coder was trying to handle two operations in a single trigger and perform separate actions based on the operation.
Now, we all know that we could create a separate trigger for each operation. However, it is sometimes helpful for maintaining code if we use a single trigger.
Here is a simple example of how to handle the different operations in a single trigger.
create table test(
myfield varchar(1)
)
go
create TRIGGER cstr_test
ON test
AFTER INSERT, UPDATE, DELETE
AS
BEGIN
if exists(select 1 from deleted)
begin
if exists(select 1 from inserted)
begin
print 'update'
end
else
begin
print 'delete'
end
end
else
begin
print 'insert'
end
END
go
insert into test select 1
update test set myfield=2 where myfield=1
delete from test
I hope this helps someone!
Now, we all know that we could create a separate trigger for each operation. However, it is sometimes helpful for maintaining code if we use a single trigger.
Here is a simple example of how to handle the different operations in a single trigger.
create table test(
myfield varchar(1)
)
go
create TRIGGER cstr_test
ON test
AFTER INSERT, UPDATE, DELETE
AS
BEGIN
if exists(select 1 from deleted)
begin
if exists(select 1 from inserted)
begin
print 'update'
end
else
begin
print 'delete'
end
end
else
begin
print 'insert'
end
END
go
insert into test select 1
update test set myfield=2 where myfield=1
delete from test
I hope this helps someone!
Monday, February 8, 2016
Add items to list object in Dex using VBA
Let's say you have a drop down list box on your Dynamics GP window and you want to add an item to it. Unfortunately, the list items are being set by dexterity code when the window opens, so this seems impossible.
However, using a little VBA, we can add our own items to the list.
We do this using SanScript!
Here is an example of how to accomplish this:
However, using a little VBA, we can add our own items to the list.
We do this using SanScript!
Here is an example of how to accomplish this:
Private
Sub Window_BeforeOpen(OpenVisible As Boolean)
Dim
CompilerApp As Object
Dim CompilerMessage As String
Dim CompilerError As Integer
Dim CompilerCommand As String
' Create link without having reference marked
Set CompilerApp = CreateObject("Dynamics.Application")
CompilerCommand = ""
CompilerCommand = CompilerCommand & "add item str(2099) to
'Year' of window MyWindow of form MyForm;"
' Execute SanScript
CompilerApp.CurrentProductID = 131
CompilerApp.CurrentProduct = CompilerApp.CurrentProduct &
"!Modified"
CompilerError = CompilerApp.ExecuteSanscript(CompilerCommand,
CompilerMessage)
If CompilerError <> 0 Then
MsgBox CompilerMessage
End If
End
Sub
Subscribe to:
Posts (Atom)
SQL 2022 TSQL snapshot backups!
SQL 2022 now actually supports snapshot backups! More specifically, T-SQL snapshot backups. Of course this is hardware-dependent. Here ...
-
If you are reading this, you are probably aware of the fact that you cannot deploy SSRS 2008 reports on an SSRS2005 server. SSRS reports ar...
-
SQL Job to refresh TEST from PRODUCTION Last Updated: 2018.11.12 I like to include each of these steps as a separate job step. If you ...
-
I ran into an issue today where I had a report parameter default that I couldn't seem to get rid of. In BIDS, I deleted the defaults f...