Here is the solution to get the current Company (CONO), Division (DIVI), and Facility (FACI) in a Mashup in Lawson Smart Office. Last week I wrote a post on How to get the current username in a Mashup. This week I post about CONO, DIVI, FACI:
- Add this namespace to the Mashup:
xmlns:mforms=”clr-namespace:MForms;assembly=MForms” - Get the values with this extension method:
{mashup:UserContextValue Path=M3/Company}
{mashup:UserContextValue Path=M3/Division}
{mashup:UserContextValue Path=M3/Facility} - Alternatively, you can use the field names:
{mashup:UserContextValue Path=M3/CONO}
{mashup:UserContextValue Path=M3/DIVI}
{mashup:UserContextValue Path=M3/FACI} - Use the value for example in a TextBlock:
<TextBlock Text=”{mashup:UserContextValue Path=M3/Company}” />
<TextBlock Text=”{mashup:UserContextValue Path=M3/Division}” />
<TextBlock Text=”{mashup:UserContextValue Path=M3/Facility}” />
Here are the values you can get:
CONO | Company, CompanyName
DIVI | Division, DivisionName
FACI | Facility, FacilityName
WHLO | Warehouse, WarehouseName
LANC | Language
DTFM | DateFormat
DCFM | DecimalFormat
TIZO | TimeZone
CUNO | Customer
DEPT | Department
Menu
MenuVersion
Here is a screenshot of the result:
Special thanks to karinpb and Juan V of Spain for their help!
UPDATE: This syntax works also: {Binding Source={x:Static mforms:UserContext.CurrentCompany}}
LikeLike
Actually these are the values to use, otherwise you can never switch Division.
{mashup:UserContextValue Path=M3/CurrentCompany}
{mashup:UserContextValue Path=M3/CurrentDivision}
{mashup:UserContextValue Path=M3/CurrentFacility}
LikeLike
Correct, thank you
LikeLike