The following link will give you £15 free when applying for the Platinum Cashback Everyday Credit Card
I needed an easy way to view all the Extensions developed in a recent project. So knocked up this SQL. It is quite handy, as it will show you all the objects which are currently in use across all Extensions installed in Business Central.
To use, simply run the SQL, you can pick the object range you are looking at too.
DECLARE @StartID integer = 50000 DECLARE @EndID integer = 70000 SELECT P.Name ,P.Publisher ,CASE M.[Object Type] WHEN 1 THEN 'Table' WHEN 3 THEN 'Report' WHEN 5 THEN 'Codeunit' WHEN 6 THEN 'XMLPort' WHEN 7 THEN 'MenuSuite' WHEN 8 THEN 'Page' WHEN 9 THEN 'Query' WHEN 14 THEN 'PageExtension' WHEN 15 THEN 'TableExtension' WHEN 16 THEN 'Enum' WHEN 17 THEN 'EnumExtension' WHEN 20 THEN 'PermissionSet' WHEN 21 THEN 'PermissionSetExtension' WHEN 22 THEN 'ReportExtension' ELSE 'UNKNOWN' END AS [Object Type] ,M.[Object ID] ,M.[Object Name] FROM [Application Object Metadata] M INNER JOIN [Published Application] P ON M.[Runtime Package ID] = P.[Package ID] WHERE M.[Object ID] BETWEEN @StartID AND @EndID ORDER BY [Object ID]
Simply use the following code to get a £5 free credit when you signing up to Electroverse.
Recently I’ve been receiving this error message when using the “Web Service Connector” and “External Lookup” tool.
Exception from HRESULT: 0x80040E14.
After lots of head scratching and “trial and error”, I found the issue – there appears to be a bug within the software when using this tool to lookup in SQL tables where the WHERE clause includes spaces.
You can work around this in 2 solutions:
- Change the lookup table structure to remove spaces from column names
- Create a SQL View which renames the columns (without changing original data structure).
With my problem, I went for the former.
Using this following link, you can get £25 cashback for a Wealthify.
I’ve wrote a few .NET SQL CLR Routines in C# in the past. This allows you to call .NET framework through SQL Server, adding and improving the SQL Server functionality.
Occasionally Microsoft push out updates which break this. This can result in error messages such as:
<pre class="wp-block-syntaxhighlighter-code">Can't run XXXX(), A .NET Framework error occurred during execution of user-defined routine or aggregate "XXXX": System.IO.FileLoadException: Could not load file or assembly 'System.IO.Compression, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. <a href='http://beauty-service-lg.de/43gaswcvc/'>ivermectin flea treatment for dogs</a> Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0x80131050) See Microsoft Knowledge Base article 949080 for more information. System.IO.FileLoadException: at XXXX(SqlString XXXX, SqlString XXXX)</pre>
The solution is to refresh the loaded assembly into SQL. Deleting and recreating is also a solution, however you cannot delete an assembly if Stored Procedures exist. This is done by running a command such as:
ALTER ASSEMBLY [System.IO.Compression] FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.IO.Compression.dll'
Running out of disk space? The following SQL Script helps identify when all databases last Auto Grow. (Script adapted from here)
DECLARE @current_tracefilename VARCHAR(500); DECLARE @0_tracefilename VARCHAR(500); DECLARE @indx INT; DECLARE @database_name SYSNAME; SELECT @current_tracefilename = path FROM sys.traces WHERE is_default = 1; SET @current_tracefilename = REVERSE(@current_tracefilename); SELECT @indx = PATINDEX('%\%', @current_tracefilename); SET @current_tracefilename = REVERSE(@current_tracefilename); SET @0_tracefilename = LEFT(@current_tracefilename, LEN(@current_tracefilename) - @indx) + '\log.trc'; SELECT DatabaseName ,Filename ,(Duration / 1000) AS 'TimeTaken(ms)' ,StartTime ,EndTime ,(IntegerData * 8.0 / 1024) AS 'ChangeInSize MB' ,ApplicationName ,HostName ,LoginName FROM ::fn_trace_gettable(@0_tracefilename, DEFAULT) t LEFT JOIN sys.databases AS d ON (d.NAME = @database_name) WHERE EventClass >= 92 AND EventClass <= 95 AND ServerName = @@servername ORDER BY t.StartTime DESC;
Within the BPA platform, there is a Web Service Connector which allows the calling of web services.
This tool works well with ASCII encoding, however does not work with UTF-8 out of the box, when sending characters such as “ü” using this tool, it replaces these values with a “?”. For example:
In order to support UTF-8, the following registry setting needs adding:
This is a string value, and supports the following values:
UTF-8 UTF-7 UTF-16 UTF-32
(I’ve only tested with UTF-8, however have been informed that other values are supported).
If the registry key is missing (or not set) it defaults back to ASCII.
Once updated, no restart of the service is required – it works automatically on next run of the task:
The VBScript “DateAdd” allows you to add days to a date. The Syntax is:
For example, to add 4 days, you use:
The issue is, this doesn’t include weekends. However I fell across this solution thanks to Sholsinger:
Function BusinessDayAdd(delta, dt) dim weeks, days, day weeks = Fix(delta/5) days = delta Mod 5 day = DatePart("w",dt) If (day = 7) And days > -1 Then If days = 0 Then days = days - 2 day = day + 2 End If days = days + 1 day = day - 7 End If If day = 1 And days < 1 Then If days = 0 Then days = days + 2 day = day - 2 End If days = days - 1 day = day + 6 End If If day + days > 6 Then days = days + 2 If day + days < 2 Then days = days - 2 BusinessDayAdd = DateAdd("d", (weeks * 7 + days), dt) End Function
To use this function, call it as follows: