Forum Discussion

angela's avatar
angela
Catalyst II
8 years ago

Add Items To Change – how to change dropdown labels?

Hi, I created a custom CM process and added it into the Add Items To Change List by modifing the Methods: - PE_ChooseCMItem_API --> this.ChangeItemList = top.aras.newArray("Simple MCO", "Express ECO", ..., "ABC_MyMagicChange_Main"); - PE_AddChangeItem The modfications were easy to do and my new CM process can now be selected in Add Items To Change But my dropdown list now looks something like this: Change Type: - Simple MCO - Express ECO - ABC_MyMagicChange_Main - ... I do not prefer to use my system-internal ItemType names as a label for the end user. Instead of ABC_MyMagicChange_Main I would prefer to display the label "Magic Change" only. I tried to modify the text attribute of the dropdown options inside the PE_ChooseCMItem_API, but without any success. Is it possible to use custom labels for the dropdown entries? Or should I better rename my ItemType? Thanks and best regards! Angela

2 Replies

  • Hi Angela, In order to use labels, you would need to rewrite a large part of the PE_ChooseCMItem_API to support this change. While it would certainly be possible to do that, the easiest solution would be to change the name of your new CM process to something more readable in the dropdown. Chris ______________________________________ Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, while doing my tests yesterday after 10 minutes I came to the same conclusing as you. It looked easy to do, but wasn´t. I had already begun customizing the ItemType when I discovered that the drop-down label feature is already implemented in the API, but just is not used. The missing label function just requires the modification of 3 lines of code and an additional array for the label. Around line 9: Add label array, it must match to the ChangeItemList this.ChangeItemLabels = top.aras.newArray("Simple MCO", "Express ECO", "Express DCO", "Magic Change"); Around line 40: Add handling of label list: var changeItemLabel = this.ChangeItemLabels; Around line 49: Change function call
    //var option = this.AddOptionToDropDown(this.ChangeTypeInput, changeItemName);
    var option = this.AddOptionToDropDown(this.ChangeTypeInput, changeItemName, changeItemLabel);
    Around line 58: Change text to id
    // var selectedType = this.ChangeTypeInput[this.ChangeTypeInput.selectedIndex].text;
    var selectedType = this.ChangeTypeInput[this.ChangeTypeInput.selectedIndex].id;
    Around line 153: Change text to id
    // result.type = this.ChangeTypeInput[this.ChangeTypeInput.selectedIndex].text;
    result.type = this.ChangeTypeInput[this.ChangeTypeInput.selectedIndex].id;
    Somehow, that was even easier than rebuilding my ItemType...