M3 ideas


Home | Pages | Archives


Getting the M3 profile in a Mashup

December 9, 2011 1:18 pm

karinpb sent me the solution to get the current M3 profile (TST, DEV, EDU, etc.) in a Mashup in Lawson Smart Office. In my case, I use the value to launch a URL with the profile as a parameter. Here is the solution:

  1. Add the namespace:
    xmlns:Services=“clr-namespace:Mango.Services;assembly=Mango.Core”
  2. Add a control that shows the value:
    <TextBlock DataContext=“{x:Static Services:ApplicationServices.SystemProfile}” Text=“{Binding Name}” />
  3. Here is a screenshot of the result:

Special thanks to Karin for the solution!

Posted by thibaudatwork

Categories: Infor Smart Office Mashups

Tags: ,

10 Responses to “Getting the M3 profile in a Mashup”

  1. […] to get the current username in a Mashup in Lawson Smart Office. Last week I wrote a post on How to get the current M3 profile in a Mashup which returns DEV, EDU, TST, PRD, etc. depending on which profile you are currently connected. […]

    Like

    By How to get the current username in a Mashup « M3 ideas on December 15, 2011 at 1:49 pm

  2. Hi,

    Very good information on this page.
    Good to know this group

    Question : where can i find all the properties in the UserContext and SystemProfile ?
    I’m looking for the API port, the web service server url and ….

    Like

    By Hervé Brunel on March 16, 2012 at 9:42 am

  3. Bonjour Hervé. You can find those properties in Smart Office > Navigator > Administration Tools > Profile Editor. You read those properties from a Mashup with for example for the LWS server: {mashup:ProfileValue Path=M3/WebService/url} . Karin posted an example. I will post another one soon.

    Like

    By thibaudatwork on March 16, 2012 at 10:38 am

    1. Hervé, voici l’exemple: https://thibaudatwork.wordpress.com/2012/03/19/how-to-get-the-url-to-lawson-web-services-in-a-mashup/

      Like

      By thibaudatwork on March 19, 2012 at 10:59 pm

  4. Hi,

    Thanks a lot for the valuable information. I would like to get the settings from External Profile configured in the profile editor. How can I use Jscript to get the path, parameters, etc.?

    Best Regards,
    Warren

    Like

    By Warren on September 24, 2013 at 2:55 am

    1. Hi Warren, you do something like this: Mango.Services.ApplicationServices.SystemProfile.GetProperty(‘M3’, ‘WebService’, ‘url’)

      Like

      By thibaudatwork on September 24, 2013 at 10:44 am

  5. It is highly appreciated. It helps me find the right syntax to the settings of External Application Group’s property. It is something like

    Mango.Services.ApplicationServices.SystemProfile.GetProperty(‘External′, ‘FASTLSO’, ‘parameters’)

    I can now put our SQL server connection information here to make JScripts more generic.

    Thanks again.

    Best Regards,
    Warren

    Like

    By Warren on September 24, 2013 at 1:15 pm

    1. You’re welcome Warren. Also, you can shorten the statement by adding import Mango.Services at the top of your script, by using a variable var profile = ApplicationServices.SystemProfile, and by simply calling profile.GetProperty(…). As for doing direct SQL from scripts, if that’s what you’re doing, there have been discussions on this blog and/or on http://smartofficeblog.com/ about how a bad idea it is for many reasons, one of them being the need to install/setup an ODBC driver on each user’s computer = maintenance nightmare. The preferred method is creating a Lawson Web Service of type SQL, and making the asynchronous SOAP request from the script. And there’s already a setting for LWS URL in the System Profile (the one I wrote in my previous comment) so you wouldn’t need to add your own settings to the profile. Hope it helps. /Thibaud

      Like

      By thibaudatwork on September 25, 2013 at 11:19 am

      1. Dear Thibaud,

        Thanks a lot for your kindness. Yes, I need to find a way to make my JScipts more generic to call SQL according to the environment. Due to your help I have found it. 10.0.5.2 allows to create new application groups, add new types and new properties. I created an application group called “FAST” (my company name) and a type called “FASTSQL” with the properties of Server, Database, User and Password. Then my scripts can get the values of those properties by calling the SystemProfile object. It is working perfectly. What I need is to replicate the application group to each environment, of course, with different property values. It is better not to use the existing External group, because it is used for launching external applications and the application name can be seen user the Other menu of the Navigator.

        The web service way is used by me only as the data source for data list panel in Mashup, which has no way to call SQL directly. It is a pain, as I have to generate the web service for each call, although the web service designer is easy to use.

        Anyway, now we have a good solution for that purpose. It is a pity that I cannot attach a screen shot here for you to have a look.

        I have another issue, which I will find a correct post to put it on.

        Thanks again and Best Regards,
        Warren

        Like

        By Warren on September 26, 2013 at 12:16 am

  6. […] Getting the M3 profile in a Mashup […]

    Like

    By Site map – M3 ideas on May 9, 2017 at 12:24 pm

Leave a Reply



Mobile Site | Full Site


Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.