web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Batch job language

(0) ShareShare
ReportReport
Posted on by 70

Hi everyone,

I was wondering if a batch job takes its language when running from another place rather than the user, company or system language.

I am filling a string with a label (already created both in english and spanish) launching a batch job and even though I have set my user, company and system language in spanish, it uses english. This doesn't happen when I launch the process without a batch job.

As a workaround I forced the language of the user in the label, but I'd like to know why this happens.

Greetings.

Alex.

*This post is locked for comments

I have the same question (0)
  • Alex Gisbert Profile Picture
    70 on at
    RE: Batch job language

    These three infos will return 'es':

    info("Company: " + CompanyInfo::languageId());

    info("User: " + new xInfo().language());

    info("System: " + SystemParameters::getSystemLanguageId());

    But, this will return the label in english:

    MyTable.Txt = "@MyLabels:LabelText";

    And this will return it in spanish:

    MyTable.Txt = SysLabel::labelId2String(literalstr("@MyLabels:LabelText"), 'es');

  • Verified answer
    Crispin John Augustine Profile Picture
    37,081 on at
    RE: Batch job language

    A Batch Job keeps running under the account of the user who started the Job. So, the System takes the language of this user (who started).

    The example shared by Nikolaos, as to Reports is correct. But the reason why it takes a specific language is because, it uses the explicit conversion SysLabel::labelId2String(literalStr("labelId"), languageId)

    I recommend you to use this conversion in your Batch Job as well, so as to get desired language Labels.

    A good example to refer this in Standard AX is SalesInvoiceController.documentTitle()

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Batch job language

    To my understanding it should use the user's language.

    But in some places, like some printouts, it could use the customer / vendor language.

    Could you share more details about your solution, such as the x++ code where you use the label?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans