I'd like to insert all Labels from a labelModuleId in an AX2009 table.
I have this job, that does nearly everything I need. But I have to enter the max Id (toLabel = 1000):
static void OcShowAllLabel(Args _args)
{
    xInfo               xinfo;
    LanguageId          currentLanguageId;
    LabelModuleId       labelModuleId = 'OCM'; // hier evt eine Eingabe durch Benutzer zur Auswahl
    LabelIdNum          frLabel;
    LabelIdNum          toLabel = 1000;
    LabelId             labelId;
    OcShowAllLabels_RS  tab;
    Label               blub = new Label();
    str                 label;
    ;
    xInfo = new xInfo();
    currentLanguageId = xInfo.language();
    delete_from tab
        where tab.LanguageId == currentLanguageId
        && tab.LabelModuleId == labelModuleId;
    for (frLabel = 1; frLabel <= toLabel; frLabel++)
    {
        labelId = strfmt('@%1%2', labelModuleId, frLabel);
        label = SysLabel::labelId2String(labelId, currentLanguageId);
        if (labelId != label)
        {
            tab.initValue();
            tab.LabelId = labelId;
            tab.Label = label;
            tab.LanguageId =  currentLanguageId;
            tab.LabelModuleId = labelModuleId;
            tab.insert();
        }
    }
    Info('done');
}