Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Use this event to

Add new custom messages (translations) or modify existing messages.

Description

Add translated labels you can use from your code (i.e. error messages, field names and information). Messages you add from this event are inserted into "Mobile Messages" and can be accessed from your custom code using the codeunit MobWmsLanguage.GetMessage('LabelName') function.

You may also overwrite existing messages:

  • Overwrite Mobile WMS Messages that already exists in Mobile Messages table
  • Overwrite labels used in the Android App Mobile Configuration File (used as "@{LabelName}"). Adding a new message "LabelName" (without '@' or '{}') will overrule similar labels from Android App resource files.


Requirements


"Mobile Language Code" must be present on the "Mobile User"

Your new eventsubscriber is executed when:
... you manually select the action "Create Messages" from "Mobile Language" page (after subscribing)
... a mobile user logs into the database and no "Mobile Messages" exists (usually only the first time a mobile user logs on)
... the Mobile WMS Application (BC App) is upgraded to a newer version


If you want to ensure your new messages is always added to an existing Mobile Wms installation, consider (also) adding the messages from your own Install-/Upgrade-codeunits in your customization app project instead.


Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Language", 'OnConvertLanguageCodeToDeviceLanguageCode''', true, true)]
    local procedure OnConvertLanguageCodeToDeviceLanguageCode(_LanguageCode: Code[10]; var _DeviceLanguageCode: Code[20]; var _IsHandled: Boolean)
    begin
    end;

Example

    // [Example] : Suggest device language code 'EN' for Malaysian, and a new custom device language 'FR' for any french language

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Language", 'OnConvertLanguageCodeToDeviceLanguageCode''', true, true)]
    local procedure MyOnConvertLanguageCodeToDeviceLanguageCode(_LanguageCode: Code[10]; var _DeviceLanguageCode: Code[20]; var _IsHandled: Boolean)
    begin
        // Malaysian
        if _LanguageCode = 'MSL' then begin
            _DeviceLanguageCode := 'EN';    // Use english language pack
            _IsHandled := true;
        end;

        // Any french language
        if CopyStr(_LanguageCode, 12'FR' then begin
            _DeviceLanguageCode := 'FR';    // Use some french language pack (not in standard mobile wms, could be developed by a partner)
            _IsHandled := true;
        end;
    end;


See also:

 

Version History

VersionChanges
MOB5.26Introduced
  • No labels