Connecting a S3 form with Landmark Application Data

I’ll show you how easy it is to create a Mashup that connects a S3 Form and data from Contract Management, a Landmark Application. In Lawson Smart Office 9.1.2 we introduced three new DataService controls; the DataPanel, DataListPanel and DataDetailPanel.

In the first version we added support for making REST http calls to web services as well as making M3 API Calls. In 9.1.3 we added support for a Landmark DataService. If you like to implement and plugin your own DataService as part if using LSO SDK that is as simple as implementing an Interface (IDataService) and registering your service.

Note that for M3 API calls we do have specific mashups controls with a better tooling experience than that of the data service. The dataservice basic Mashup tooling is a user interface where you configure operations and set parameters for those operations. It is up to the service to specify what parameters are needed in order to configure the service and in most cases that information should be available in the SDK API documentation.

Ok, so back to my example. I want to be able to see which contracts are avaliable for a specific vendor in AP10 so my Mashup has to have two controls.
1. A S3 FormPanel for AP10.1.
2. A DataListPanel for listing my Contracts from Contract Management.

When I select the DataListPanel I select the Data service type and set it to LANDMARK. This will reload the view and present a Landmark specific configuration as show below.

If you don’t have a type that you expect to see in the drop down for data service type, that is probably because the feature or application is not available in your current profile.

Select the Query type, dataarea and in my case since I selected to view a business class I then select the business class. I select what fields I need and I check the checkbox so a ListView will be created for me. I also select one field to be filter, it’s the Vendor field since I need to filter the list for the Vendor that is selected in the S3 Form.

Before I’m done I need to hook up the events. Becuase without events nothing will happen in the Mashup. The key here is to map the FormDataUpdated event in the S3 Form to the List event in the DataListPanel, passing the VEN-VENDOR from S3 to Vendor.

Here is the final result:

And the Mashup XAML:

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mashup="clr-namespace:Mango.UI.Services.Mashup;assembly=Mango.UI" xmlns:s3="clr-namespace:S3.Client.Mashup;assembly=S3.Client">
  <Grid.Resources>
  </Grid.Resources>

  <Grid.ColumnDefinitions>
    <ColumnDefinition />
  </Grid.ColumnDefinitions>
  <Grid.RowDefinitions>
    <RowDefinition Height="Auto" />
    <RowDefinition Height="Auto" />
    <RowDefinition Height="*" />
  </Grid.RowDefinitions>
  <s3:FormPanel Name="vendorForm" Token="AP10.1" DataArea="APPS901" IsReadOnly="False" EnabledActions="INP" />
  <StackPanel Grid.Row="1">
  <TextBlock Name="TextBlockHeader" FontSize="14" Margin="8,8,0,0" Text="Contracts for selected vendor:" Grid.Row="0" />
  <mashup:DataListPanel Name="dataList">
    <mashup:DataListPanel.Events>
      <mashup:Events>
        <mashup:Event SourceName="vendorForm" TargetName="dataList" SourceEventName="FormDataUpdated" TargetEventName="List">
          <mashup:Parameter SourceKey="VEN-VENDOR" TargetKey="Vendor" />
        </mashup:Event>
      </mashup:Events>
    </mashup:DataListPanel.Events>
    <mashup:DataListPanel.DataService>
      <mashup:DataService Type="LANDMARK">
        <mashup:DataService.Operations>
          <mashup:DataOperation Name="List">
            <mashup:DataParameter Key="Landmark.BusinessClass" Value="Contract" />
            <mashup:DataParameter Key="Landmark.DataArea" Value="procurement" />
            <mashup:DataParameter Key="Landmark.FilterFields" Value="Vendor" />
            <mashup:DataParameter Key="Landmark.OutputFields" Value="Contract,WorkingContractID,Vendor,Name,ContractStatus,EffectiveDate,ExpirationDate" />
          </mashup:DataOperation>
        </mashup:DataService.Operations>
      </mashup:DataService>
    </mashup:DataListPanel.DataService>

    <ListView Margin="8" Height="250" ItemsSource="{Binding Items}" Style="{DynamicResource styleListView}" ItemContainerStyle="{DynamicResource styleListViewItem}">
      <ListView.View>
        <GridView ColumnHeaderContainerStyle="{DynamicResource styleGridViewColumnHeader}">
          <GridView.Columns>
            <GridViewColumn Header="Contract" DisplayMemberBinding="{Binding [Contract]}" />
            <GridViewColumn Header="Working contract ID" DisplayMemberBinding="{Binding [WorkingContractID]}" />
            <GridViewColumn Header="Name" DisplayMemberBinding="{Binding [Name]}" />
            <GridViewColumn Header="Vendor" DisplayMemberBinding="{Binding [Vendor]}" />
            <GridViewColumn Header="Status" DisplayMemberBinding="{Binding [ContractStatus]}" />
            <GridViewColumn Header="Effective Date" DisplayMemberBinding="{Binding [EffectiveDate], StringFormat=d}" />
            <GridViewColumn Header="Expiration Date" DisplayMemberBinding="{Binding [ExpirationDate], StringFormat=d}" />
          </GridView.Columns>
        </GridView>
      </ListView.View>
    </ListView>
  </mashup:DataListPanel>
  </StackPanel>
</Grid>

Now this does not only work against Contract Management but against any 9.2.2 version, perhaps other version as well but the 9.2.2 is the only version I have verified it against.

We use the same LandmarkAdaptor as the ExcelAdd-In and it is great to be able to do these kinds of mashups. There is some support for Actions as well (meaning updates): Now that is not supported via the Mashup tooling but you can configure the data service and still get it to work. But I’ll save that for another post.