cancel
Showing results for 
Search instead for 
Did you mean: 

Translation of Custom Messages on Extended BOs

Former Member
0 Kudos

Hello,

I have an extension to the Customer BO and am looking at options on how to translate the message. Any idea if this is possible and if yes how?


Thanks and Regards
Vikram

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Not possible. You need to raise different message for each language.

Former Member
0 Kudos

Hello Alessandro,

I am trying to follow whats given on the documentation. My code snippet

import AP.Common.GDT;

import AP.FO.BusinessPartner.Global;

import BASIS.Global;

[Extension] businessobject AP.FO.BusinessPartner.Global:Customer raises MsgERPData, MsgERPData_FI, MsgIndividualCustomer, MsgIndividualCustomer_FI {

        // You must activate this business object before you can access the extension fields

        // or messages in script files, forms, and screens.

       

           node AddressInformation {

           }

   

        message MsgERPData text "Fill mandatory data required for promoting the Prospect to Customer";

        message MsgERPData_FI text "Täytä pakolliset tiedot ERP-Tiedot välilehdeltä";

        message MsgIndividualCustomer text "Last Name,First Name,Identity Number required for Individual Customers";

        message MsgIndividualCustomer_FI text "Etunimi, Sukunimi ja Henkilötunnus ovat pakollisia yksityisasiakkaalle";

           ---------------------------------------------------------------------

And on the Validation-OnSave

import ABSL;

if(this.CurrentBusinessCharacters.ProspectIndicator == false)

{

    var userLanguage;

    userLanguage = Context.GetCurrentUserLanguage().ToString();

    //ERP Mandatory

    if((this.CurrentCommon.KNA1_KTOKD == "")|| (this.CurrentCommon.RF02D_BUKRS == "") || (this.CurrentCommon.KNVV_VKORG == "") || (this.CurrentCommon.KNVV_VTWEG == "") || (this.CurrentCommon.KNVV_SPART == ""))

    {

        if(userLanguage == "FI") { MsgERPData_FI.Create("E");}

        else { raise MsgERPData.Create("E");}

        //raise MsgERPData.Create("E");

        return false;

    }

What happens is that for the _FI message we are never getting the error to pop up and we always get the default "Save Failed" error.

Former Member
0 Kudos

Did you try in debug mode to see if your code try to raise the custom error message?

If both custom and standard errors are raised, you should see both in the message area.

Former Member
0 Kudos

Yes I did. It goes to the section where it raises the custom error message. But it does not show it at all. Just shows the default save failed message.

Former Member
0 Kudos

Correct the following

if(userLanguage == "FI") { MsgERPData_FI.Create("E");}

        else { raise MsgERPData.Create("E");}

with

if(userLanguage == "FI") { RAISE MsgERPData_FI.Create("E");}

        else { raise MsgERPData.Create("E");}

refresh and reactivate all.

Former Member
0 Kudos

Thanks Alessandro. It works now as documented