Archive for the ‘workspace’ tag
Sage 200 Labs – MetaPack Integration
Today we have released a new project into the Sage 200 Labs – an integration with delivery management service provider, MetaPack.
The aim of the project is to demonstrate how to hook into various points of Sage 200 processing using the messaging service. This particular project hooks into the SOP order processing pipeline by subscribing to a message published by Sage 200 after a sales order is saved. There are more extension points published by Sage 200, both in the SOP order processing pipeline, and elsewhere.
Metapack is a provider of delivery management solutions, and it makes its functionality available through a set of web services. There are services to fetch a list of delivery options, for example, and a service to allocate a consignment to a carrier for delivery.
By hooking into the sales order process, the integration module can read information relating to the saved sales order, and construct a request to the MetaPack web services to create a consignment for delivery. It is automatically allocated to the carrier which best fits the requirements of the order. The allocation process can take into account factors such as package size and weight, the pick-up and drop-off locations, and despatch and delivery dates.
A workspace showing order tracking information.
To read more about the project, and to download the source code, visit the MetaPack integration Labs project page (you need to be a registered developer to get there).
Sage 200 Labs
UPDATE – the Sage 200 2011 release introduced a new naming convention for Content Part Types assemblies required so that we could support a new discovery mechanism. Therefore, if you have already downloaded and installed the package and would like it to run as part of your 2011 release, you will need to find the CustomMapContentList.dll assembly and rename it to CustomMapContentList.Plugins.dll If you have not installed the package the simplest thing to do is rebuild the solution and rename the assembly that is built to CustomMapContentList.Plugins.dll – you can then repackage the content part type yourself for future distribution.
Some people may have heard of a concept called Sage 200 Labs that we floated a while ago. The idea is that we provide an area where developers can download source code for useful, innovative or experimental add-ons to Sage 200 that can then be built on and shipped to customers.
The projects will usually be much bigger and more complete than the samples that we ship with the developer SDK, but at the same time, they are not necessarily release quality. They should provide a really good platform for you to build on though.
The source code is free to download and use and is released under a permissive open source license that is designed to encourage commercial use. Over time we hope that the labs concept will evolve into a genuine open source community with contributions coming from Sage and external developers. From day one though, we expect to be creating the projects ourselves.
Anyway, I’m very pleased to announce that the first labs project is now ready! It is a custom content part type that allows you make workspaces showing Sage 200 data on a map. Like this:
To find out more and to download the project source code follow this link to the mapping content part landing page. You need to be a registered developer to get there. There is also a place on the forums where you can comment or ask questions. There is also some general information about the Labs concept.
Hopefully, you will find this interesting and useful. As always, comments and feedback are welcome.
Quick Tip: Outer joins with LINQ
The syntax for a flat left outer join in LINQ is a bit different from the corresponding SQL. Using Lambda syntax it looks like this.
(Note: to make these samples work in LINQPad you have to remove the references to “context”. See this post for details.)
var q =
context.PCProjectItems
.GroupJoin
(
context.PCProjectEntries,
item=>item.PCProjectItemID,
entry=>entry.ProjectItemID,
(item,entry)=>new{item.PCProjectItemID,entry}
)
.SelectMany
(
itemEntry=>itemEntry.entry.DefaultIfEmpty(),
(itemEntry,entry)=>new
{
itemEntry.PCProjectItemID,
Goods=(decimal?)entry.GoodsAmountInBaseCurrency
}
);
In comprehension syntax, the same query looks like this:
var q = from item in context.PCProjectItems
join entry in context.PCProjectEntries
on item.PCProjectItemID equals entry.ProjectItemID into itemEntries
from itemEntry in itemEntries.DefaultIfEmpty()
select new
{
item.PCProjectItemID,
Goods = (decimal?)itemEntry.GoodsAmountInBaseCurrency
};
Take your pick which syntax you prefer, or you can mix them in the same query if you like! In any case, both queries result in the same SQL being issued to the database:
SELECT [t0].[PCProjectItemID], [t1].[GoodsAmountInBaseCurrency] AS [Goods]
FROM [PCProjectItem] AS [t0]
LEFT OUTER JOIN [PCProjectEntry]
AS [t1] ON [t0].[PCProjectItemID] = [t1].[ProjectItemID]
