6. Juli 2007 12:39
6. Juli 2007 13:30
6. Juli 2007 13:57
6. Juli 2007 14:39
OBJECT Codeunit 50001 Job Queue Start
{
OBJECT-PROPERTIES
{
Date=06.07.07;
Time=14:28:37;
Modified=Yes;
Version List=;
}
PROPERTIES
{
TableNo=472;
OnRun=VAR
ObjectNoText@1140000 : Text[30];
ObjectTypePos@1140002 : Integer;
ObjectPos@1140001 : Integer;
ObjectNo@1140003 : Integer;
BEGIN
// Position von Objekttyp und Objektnummer ermitteln
ObjectTypePos := STRPOS("Parameter String", c_Codeunit);
ObjectPos := ObjectTypePos + STRLEN(c_Codeunit);
IF ObjectTypePos = 0 THEN BEGIN
ObjectTypePos := STRPOS("Parameter String", c_Report);
ObjectPos := ObjectTypePos + STRLEN(c_Report);
END;
IF ObjectTypePos = 0 THEN BEGIN
CALCFIELDS("Object Name to Run");
ERROR(c_ErrorParameterFormat, FIELDCAPTION("Parameter String"), "Parameter String",
"Object Type to Run", "Object Name to Run");
END;
ObjectNoText := COPYSTR("Parameter String", ObjectPos);
IF DELCHR(ObjectNoText, '=', '1234567890') <> '' THEN BEGIN
CALCFIELDS("Object Name to Run");
ERROR(c_ErrorParameterFormat, FIELDCAPTION("Parameter String"), "Parameter String",
"Object Type to Run", "Object Name to Run");
END;
// Ermitteltes Objekt starten
EVALUATE(ObjectNo, COPYSTR("Parameter String", ObjectPos));
CASE COPYSTR("Parameter String", 1, 1) OF
'C': CODEUNIT.RUN(ObjectNo);
'R': REPORT.RUNMODAL(ObjectNo, FALSE);
END;
END;
}
CODE
{
VAR
c_Codeunit@1140000 : TextConst 'ENU="Codeunit="';
c_Report@1140002 : TextConst 'ENU="Report="';
c_ErrorParameterFormat@1140001 : TextConst 'DEU=Der Parameter %2 für %1 für den Aufruf der %3 %4 ist nicht korrekt.;ENU=The parameter %2 for %1 for running %3 %4 is incorrect.';
BEGIN
END.
}
}
9. Juli 2007 14:21
LtParameter := "Parameter String";
LiObjektTypPos := STRPOS(LtParameter, TgField001);
LiObjektNrPos := LiObjektTypPos + STRLEN(TgField001);
IF LiObjektTypPos = 0 THEN BEGIN
ERROR(TgError001,LtParameter);
END;
LtObjektNr := COPYSTR(LtParameter, LiObjektNrPos);
IF NOT EVALUATE(LiObjektNr,LtObjektNr) THEN BEGIN
ERROR(TgError001,LtParameter);
END;
CODEUNIT.RUN(LiObjektNr);
17. Juli 2007 13:13
9. August 2007 18:00
9. August 2007 18:41