Fehler bei einer ComboBox
Raphael Strotz
Hallo,ich möcht folgendes machen:
Bei den SAP Aktivitäten folgende Values setzen:
Aktivität: Aufgabe (Value: 'T')
Typ: SAP B1 (Value: '6')
Thema: Service (Value: '13')
Ich setzte diese wie ein eigenes Modul. Das ganze geschieht im FormLoad Event
///
/// Aktivität der Aktivität ComboBox
///
const String m_CMB_Aktivität = "67";
///
/// Aktivitäten Typ ComboBox
///
const String m_CMB_Typ = "68";
///
/// Thema der Aktivität ComboBox
///
const String m_CMB_Thema = "35";
// Aktivität auf "Aufgabe" setzten
ComboBox.GetFromUID(ActForm, m_CMB_Aktivität).Select("T", SwissAddonFramework.UI.Components.ComboBox.SearchKey.ByValue);
// Typ auf "SAP B1" setzten
ComboBox.GetFromUID(ActForm, m_CMB_Typ).Select("6", SwissAddonFramework.UI.Components.ComboBox.SearchKey.ByValue);
// Thema auf "Service" setzten
ComboBox.GetFromUID(ActForm, m_CMB_Thema).Select("13", SwissAddonFramework.UI.Components.ComboBox.SearchKey.ByValue);
Dies funktionierte aber nur für die "Aktivität auf "Aufgabe" setzen". Sobald er den Typ setzten soll läuft das Modul nicht mehr weiter. (Kein Fehler sondern macht einfach erst wieder etwas wenn es neugestartet wird.
Ich habe es dann auch noch so versucht
// Typ auf "SAP B1" setzten
ComboBox Typ = ComboBox.GetFromUID(ActForm, m_CMB_Typ);
Typ.Value = "6";
// Thema auf "Service" setzten
ComboBox Thema = ComboBox.GetFromUID(ActForm, m_CMB_Typ);
Thema.Value = "13";
Doch dies führte zum gleichen Problem.
An was könnte dies legen?
Danke für eure Hilfe!
Michael Egloff
Hallo Raphael,ich habe deinen geposteten Code bei mir laufen gelassen und es hat alles funktioniert...
Kannst du mal versuchen, ein try - catch drumherum zu machen?
etwa so:
try
{
/// Aktivität der Aktivität ComboBox
///
const String m_CMB_Aktivität = "67";
///
/// Aktivitäten Typ ComboBox
///
const String m_CMB_Typ = "68";
///
/// Thema der Aktivität ComboBox
///
const String m_CMB_Thema = "35";
Form ActForm = pVal.Form;
// Aktivität auf "Aufgabe" setzten
ComboBox.GetFromUID(ActForm, m_CMB_Aktivität).Select("T", SwissAddonFramework.UI.Components.ComboBox.SearchKey.ByValue);
// Typ auf "SAP B1" setzten
ComboBox.GetFromUID(ActForm, m_CMB_Typ).Select("6", SwissAddonFramework.UI.Components.ComboBox.SearchKey.ByValue);
// Thema auf "Service" setzten
ComboBox.GetFromUID(ActForm, m_CMB_Thema).Select("2", SwissAddonFramework.UI.Components.ComboBox.SearchKey.ByValue);
}
catch(System.Exception ex)
{
MessageBox.Show("Ein Fehler ist passiert: " + ex.Message, "OK");
}
return true;
0
Please sign in to leave a comment.
Comments
0 comments