Bookmarks in M3 is a way to navigate into a specific form without having to go though the list. As it turns out Bookmarks is a key component to M3 Mashups. You configure a M3List or a M3DetailPanel with a bookmark. Not all programs support Bookmarks and even if the bookmark does work there might be issues when you try and open a detail form. In this post I will cover a way to test the bookmark and to analyze issue you might encounter when you build your M3 Mashups.
With a bookmark you can set any filter fields that are in the top pf the program. If the filter is not set correcty after following the guide below then you should submit the issue to support since it might be an issue with the bookmark implementation in that program.
I’ll start with OIS301 and hopefully it will work with bookmarks. As you can see OIS301 has a lot of filter fields and an apply button.
Start with adding a M3 -> ListPanel. Then select to show the list header (at least until we are done with the mashup).
Then you enter OIS320 and press capture. This will run the program in a special Bookmark capture mode. I use ctrl + click to select the fields in the header. Then you will need to navigate into detail panel and then you press “create bookmark”. But wait I can’t navigate to the details becuase I get this error message “Customer order number must be entered”. So I press “Create bookmark” and the I close the capture window. Now I’m back that the M3List and the Bookmark Settings are filled with values.
This did not work as I wanted.
You can see that ORNO and PONO are keys the the file. But how about the ordernumer? Isn’t that shown in the list?
Open OIS301 again and start the conditional styles wizard. Open it by selecting Tools – > Personalize -> Conditional styles. Then select New.
Here you can see all the fields that are required for the bookmark. These are all the fields that are required in order to get to the detail panel. Notice that ORNO is not ORNO in the list but OBKV. So that is why I can’t open the line. This means that I can start the program, set fields in the header but I will not be able to double click and enter the line.
This is a consequence of the first design goal of bookmarks, bookmarks were designed for accessing a detail panel directly without having to work though a panel sequence. That does not mean that we can’t use it for lists but it means that the field has to be avaiable. There are a bunch of fallbacks if the field is not entered in the bookmark but basically you need to have the values there. For coming versions of Lawson Smart Office we will address this but for now at least you’ll be able to know when you don’t have enough information to do to the detail panel. A work around would be to display a seperate detail panel within the mashup (see the end of this post).
How to I set the fields in the header? I add a startup event and set the fields that I selected and pass in values.
Now when I run the fields are added to the header:
Bookmark test program
Enter the program and the file and press enter.
Here you can test the values that you need to set to launch M3 program with a bookmark!
Always try this program if there are issues. When you test in this program and are unable to enter a line this means that you will not be able to double click a line in the Mashup and open a line.
The work around
The workaround that you can try when you can’t enter the line is the following.
1. Disable double click in the list byxxx
2. Add a detail panel
3. Add an event for currentItemChanged on the list and map it to the detail panel where you have the same bookmark but you map the name of the column to the name in the bookmark.
Now I did try and find a sorting order and a view with all the fields that I need to display the details but I can’t see to find a view that has all the keys that I need for the bookmark. So … I’m a little lost on M3 and should probably never have picked OIS301 to start with. Let’s have a look at OIS350 to see if I can try the workaround there. That program has a similar issue. Opening a line will not work since the field is called INVO in the bookmark but the column name is EXIN.
Now this is how far I got in OIS350. I did not get all the way and I’ll explain why.
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ui="clr-namespace:Mango.UI.Controls;assembly=Mango.UI" xmlns:mashup="clr-namespace:Mango.UI.Services.Mashup;assembly=Mango.UI" xmlns:m3="clr-namespace:MForms.Mashup;assembly=MForms"> <Grid.Resources> </Grid.Resources> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <m3:ListPanel Name="master"> <m3:ListPanel.Events> <mashup:Events> <mashup:Event SourceEventName="Startup"> <mashup:Parameter TargetKey="UHCONO" /> <mashup:Parameter TargetKey="UHDIVI" /> <mashup:Parameter TargetKey="UHYEA4" Value="2011" /> <mashup:Parameter TargetKey="UHINPX" /> <mashup:Parameter TargetKey="UHIVNO" /> </mashup:Event> </mashup:Events> </m3:ListPanel.Events> <m3:ListPanel.Bookmark> <m3:Bookmark Program="OIS350" Table="OINVOH" KeyNames="UHCONO,UHDIVI,UHYEA4,SOINPX,UHIVNO" FieldNames="WWYEA4,WWFACI" SortingOrder="1" /> </m3:ListPanel.Bookmark> </m3:ListPanel> <m3:DetailPanel Name="details" Grid.Row="1"> <m3:DetailPanel.Events> <mashup:Events> <mashup:Event SourceName="master" SourceEventName="CurrentItemChanged" TargetEventName="Get" Debug="True"> <mashup:Parameter TargetKey="UHCONO" /> <mashup:Parameter TargetKey="UHDIVI" /> <mashup:Parameter TargetKey="UHYEA4" Value="2011" /> <mashup:Parameter TargetKey="UHINPX" /> <mashup:Parameter TargetKey="UHIVNO" SourceKey="EXIN" /> </mashup:Event> </mashup:Events> </m3:DetailPanel.Events> <m3:DetailPanel.Bookmark> <m3:Bookmark Program="OIS350" Table="OINVOH" KeyNames="UHCONO,UHDIVI,UHYEA4,UHINPX,UHIVNO" Panel="E" SortingOrder="1" /> </m3:DetailPanel.Bookmark> </m3:DetailPanel> <ui:StatusBar Name="StatusBar" Grid.Row="2" Grid.Column="0" /> </Grid>
In the code above notice . This is a mapping from EXIN which is the invoice number field in the list and the parameter that the bookmark wants. But when I run the mashup I get invalid bookmark. Another look at the parameters and I realise that CONO and DIVI will be available in the program but what about UHINPX, what is that.
Ok so I work for Lawson and I check the field help and INPX is “Invoice prefix”.
I didn’t find the field help from within the program’s detail panel like I normally do. This time running the program and looking at fields were not enought. I could not find it. As it turns out I searched the field help in our dev enviroment. Then I actually looked at some M3 code and found that INPX is “subfile hidden key fields from record”. Ok so I have hit another dead end. The field is completly hidden to the client.
Remember when I said that bookmarks are a way to get to a specific panel for a specific item. A bookmark is what you create in M3 when you are on a panel and say “hey, I want a link to this screen, exactly the detail that I have here” then you go Tools -> Bookmarks and create your bookmark. Now that is a bookmark in it’s true essence.
So before you spend too much time on investigating why a bookmark does not work, it is porobably because you are not setting all the fields that needs to be set or those are not available in the screen. Test the bookmark in MTS043 and make sure you know the key fields. In some cases the workaround will be enought (or a simple mapping) in other you just have to make the conclusion that you can’t get what you want. You can always contact support and make a request for an enchancement. Now that we see excellerated use of bookmarks you might think that perhaps they could send INPX to the client in this case. I’m not sure if it is possible but we do our best to make our customers happy so contacting support or a product responsible seems like the thing to do!