2. Oktober 2015 09:48
Item - OnPreDataItem()
LastFieldNo := FIELDNO("No.");
recArtikel := GETFILTER(Item."No.");
IF recArtikel = '' THEN
ERROR('Bitte geben Sie ein Filterkriterium auf ArtikelNr. an');
Item - OnAfterGetRecord()
BOMComp.RESET;
BOMComp.SETCURRENTKEY(Type,"No.");
BOMComp.SETRANGE(Type,BOMComp.Type::Item);
BOMComp.SETRANGE("No.","No.");
IF BOMComp.FIND('-') THEN
ERROR(Text023,TABLECAPTION,"No.",BOMComp.TABLECAPTION);
ItemJnlLine.SETRANGE("Item No.","No.");
IF ItemJnlLine.FIND('-') THEN
ERROR(Text023,TABLECAPTION,"No.",ItemJnlLine.TABLECAPTION);
RequisitionLine.SETCURRENTKEY(Type,"No.");
RequisitionLine.SETRANGE(Type,RequisitionLine.Type::Item);
RequisitionLine.SETRANGE("No.","No.");
IF NOT RequisitionLine.ISEMPTY THEN
ERROR(Text023,TABLECAPTION,"No.",RequisitionLine.TABLECAPTION);
PurchOrderLine.SETCURRENTKEY(Type,"No.");
PurchOrderLine.SETRANGE(Type,PurchOrderLine.Type::Item);
PurchOrderLine.SETRANGE("No.","No.");
IF PurchOrderLine.FIND('-') THEN
ERROR(Text000,TABLECAPTION,"No.",PurchOrderLine."Document Type");
SalesOrderLine.SETCURRENTKEY(Type,"No.");
SalesOrderLine.SETRANGE(Type,SalesOrderLine.Type::Item);
SalesOrderLine.SETRANGE("No.","No.");
IF SalesOrderLine.FIND('-') THEN
ERROR(Text001,TABLECAPTION,"No.",SalesOrderLine."Document Type");
IF ProdOrderExist THEN
ERROR(Text002,TABLECAPTION,"No.");
ProdOrderComp.SETCURRENTKEY(Status,"Item No.");
ProdOrderComp.SETFILTER(Status,'..%1',ProdOrderComp.Status::Released);
ProdOrderComp.SETRANGE("Item No.","No.");
IF ProdOrderComp.FIND('-') THEN
ERROR(Text014,TABLECAPTION,"No.");
// >> :DMW13.71:1:02
ConstructionHeader.SETCURRENTKEY("Item No.","Variant Code","Location Code","Bin Code","Shipment Date","Order Tracking Relevance");
ConstructionHeader.SETRANGE("Item No.","No.");
IF ConstructionHeader.FINDFIRST THEN BEGIN
ERROR(Text5013630,TABLECAPTION,"No.");
END;
ConstructionLine.SETCURRENTKEY(Type,"No.");
ConstructionLine.SETRANGE(Type,ConstructionLine.Type::Item);
ConstructionLine.SETRANGE("No.","No.");
IF ConstructionLine.FINDFIRST THEN BEGIN
ERROR(Text5013631,TABLECAPTION,"No.");
END;
DocumentBOM.SETCURRENTKEY(Type,"No.");
DocumentBOM.SETRANGE(Type,DocumentBOM.Type::Item);
DocumentBOM.SETRANGE("No.","No.");
IF DocumentBOM.FINDFIRST THEN BEGIN
ERROR(Text5013559,TABLECAPTION,"No.");
END;
MasterBOMLine.SETCURRENTKEY(Type,"No.");
MasterBOMLine.SETRANGE(Type,MasterBOMLine.Type::Item);
MasterBOMLine.SETRANGE("No.","No.");
IF MasterBOMLine.FINDFIRST THEN BEGIN
ERROR(Text5013551,TABLECAPTION,"No.");
END;
// << :DMW13.71:1:02
TransLine.SETCURRENTKEY("Item No.");
TransLine.SETRANGE("Item No.","No.");
IF TransLine.FIND('-') THEN
ERROR(Text016,TABLECAPTION,"No.");
ServInvLine.RESET;
ServInvLine.SETCURRENTKEY(Type,"No.");
ServInvLine.SETRANGE(Type,ServInvLine.Type::Item);
ServInvLine.SETRANGE("No.","No.");
IF ServInvLine.FIND('-') THEN
ERROR(Text017,TABLECAPTION,"No.",ServInvLine."Document Type");
ProdBOMLine.RESET;
ProdBOMLine.SETCURRENTKEY(Type,"No.");
ProdBOMLine.SETRANGE(Type,ProdBOMLine.Type::Item);
ProdBOMLine.SETRANGE("No.","No.");
IF ProdBOMLine.FIND('-') THEN
REPEAT
IF ProdBOMHeader.GET(ProdBOMLine."Production BOM No.") AND
(ProdBOMHeader.Status = ProdBOMHeader.Status::Certified)
THEN
ERROR(Text004,TABLECAPTION,"No.");
UNTIL ProdBOMLine.NEXT = 0;
ServiceContractLine.RESET;
ServiceContractLine.SETRANGE("Item No.","No.");
IF ServiceContractLine.FIND('-') THEN
ERROR(Text023,TABLECAPTION,"No.",ServiceContractLine.TABLECAPTION);
ServiceItem.RESET;
ServiceItem.SETRANGE("Item No.","No.");
IF ServiceItem.FIND('-') THEN
REPEAT
ServiceItem.VALIDATE("Item No.",'');
ServiceItem.MODIFY(TRUE);
UNTIL ServiceItem.NEXT = 0;
MoveEntries.MoveItemEntries(Item);
ItemBudgetEntry.SETCURRENTKEY("Analysis Area","Budget Name","Item No.");
ItemBudgetEntry.SETRANGE("Item No.","No.");
ItemBudgetEntry.DELETEALL(TRUE);
ItemSub.RESET;
ItemSub.SETRANGE(Type,ItemSub.Type::Item);
ItemSub.SETRANGE("No.","No.");
ItemSub.DELETEALL;
ItemSub.RESET;
ItemSub.SETRANGE("Substitute Type",ItemSub."Substitute Type"::Item);
ItemSub.SETRANGE("Substitute No.","No.");
ItemSub.DELETEALL;
SKU.RESET;
SKU.SETCURRENTKEY("Item No.");
SKU.SETRANGE("Item No.","No.");
SKU.DELETEALL;
NonstockItemMgt.NonstockItemDel(Item);
CommentLine.SETRANGE("Table Name",CommentLine."Table Name"::Item);
CommentLine.SETRANGE("No.","No.");
CommentLine.DELETEALL;
ItemVend.SETCURRENTKEY("Item No.");
ItemVend.SETRANGE("Item No.","No.");
ItemVend.DELETEALL;
SalesPrice.SETRANGE("Item No.","No.");
SalesPrice.DELETEALL;
SalesLineDisc.SETRANGE(Type,SalesLineDisc.Type::Item);
SalesLineDisc.SETRANGE(Code,"No.");
SalesLineDisc.DELETEALL;
SalesPrepmtPct.SETRANGE("Item No.","No.");
SalesPrepmtPct.DELETEALL;
PurchPrice.SETRANGE("Item No.","No.");
PurchPrice.DELETEALL;
PurchLineDisc.SETRANGE("Item No.","No.");
PurchLineDisc.DELETEALL;
PurchPrepmtPct.SETRANGE("Item No.","No.");
PurchPrepmtPct.DELETEALL;
ItemTranslation.SETRANGE("Item No.","No.");
ItemTranslation.DELETEALL;
ItemUnitOfMeasure.SETRANGE("Item No.","No.");
ItemUnitOfMeasure.DELETEALL;
ItemVariant.SETRANGE("Item No.","No.");
ItemVariant.DELETEALL;
ExtTextHeader.SETRANGE("Table Name",ExtTextHeader."Table Name"::Item);
ExtTextHeader.SETRANGE("No.","No.");
ExtTextHeader.DELETEALL(TRUE);
ItemAnalysisViewEntry.SETRANGE("Item No.","No.");
ItemAnalysisViewEntry.DELETEALL;
ItemAnalysisBudgViewEntry.SETRANGE("Item No.","No.");
ItemAnalysisBudgViewEntry.DELETEALL;
PlanningAssignment.SETRANGE("Item No.","No.");
PlanningAssignment.DELETEALL;
BOMComp.RESET;
BOMComp.SETRANGE("Parent Item No.","No.");
BOMComp.DELETEALL;
TroubleshSetup.RESET;
TroubleshSetup.SETRANGE(Type,TroubleshSetup.Type::Item);
TroubleshSetup.SETRANGE("No.","No.");
TroubleshSetup.DELETEALL;
ResSkillMgt.DeleteItemResSkills("No.");
DimMgt.DeleteDefaultDim(DATABASE::Item,"No.");
ItemIdent.RESET;
ItemIdent.SETCURRENTKEY("Item No.");
ItemIdent.SETRANGE("Item No.","No.");
ItemIdent.DELETEALL;
ServiceItemComponent.RESET;
ServiceItemComponent.SETRANGE(Type,ServiceItemComponent.Type::Item);
ServiceItemComponent.SETRANGE("No.","No.");
ServiceItemComponent.MODIFYALL("No.",'');
BinContent.SETCURRENTKEY("Item No.");
BinContent.SETRANGE("Item No.","No.");
BinContent.DELETEALL;
// Begin#NAV20100:A1004 02.05.07 TECTURA.SE
IF QualityMgtSetup.GET THEN
QMStdInt.T27OnDelete(Item);
// End#NAV20100:A1004 02.05.07 TECTURA.SE
MobSalesMgt.ItemOnDelete(Item);
// >> :DMW13.60.01:1:01
VariableAttributeMgt.DeleteItemAttributes(Item);
MasterBOMMgt.DeleteItemToMaster(Item);
// << :DMW13.60.01:1:01
// >> :DMW13.60.02:1:01
ItemDrawing.SETRANGE("Item No.","No.");
ItemDrawing.DELETEALL(TRUE);
// >> :DMW14.00:1:99
// ChecklistRelation.SETRANGE("Table ID",27);
ChecklistRelation.SETFILTER("Table ID",'%1|%2',ChecklistRelation."Table ID"::Item,ChecklistRelation."Table ID"::"Item/Vendor");
// << :DMW14.00:1:99
ChecklistRelation.SETRANGE(Code,"No.");
ChecklistRelation.DELETEALL(TRUE);
ItemSearchCharacteristic.SETRANGE(Item,"No.");
ItemSearchCharacteristic.DELETEALL(TRUE);
// << :DMW13.60.02:1:01
// >> KANBAN:DMW15.02:28:01
KANBAN.SETRANGE("Item No.","No.");
KANBAN.DELETEALL(TRUE);
// << KANBAN:DMW15.02:28:01
// >> #TMW1600:A1201 24.11.09 TECTURA.AM
LicPermission.GET(LicPermission."Object Type"::Codeunit, CODEUNIT::"Text Module Delete");
IF LicPermission."Execute Permission" = LicPermission."Execute Permission"::Yes THEN BEGIN
// << #TMW1600:A1201 24.11.09 TECTURA.AM
// Begin#TMW16.00:A1000 16.03.09 TECTURA.FB
TMDelete.DeleteTM(DATABASE::Item, Item);
// End#TMW16.00:A1000 16.03.09 TECTURA.FB
// >> #TMW1600:A1201 24.11.09 TECTURA.AM
END;
// << #TMW1600:A1201 24.11.09 TECTURA.AM
// Artikel LÖSCHEN
Item.DELETE;
Item - OnPostDataItem()
ProdOrderExist()
2. Oktober 2015 09:54
2. Oktober 2015 12:30
2. Oktober 2015 13:02
2. Oktober 2015 13:44
2. Oktober 2015 14:06
Bei einem "Item.Delete(true)" würde nur der Artikeleintrag in der Tabelle Item (27) gelöscht. Verstehe ich das richtig?
5. Oktober 2015 08:04
5. Oktober 2015 23:31
6. Oktober 2015 08:33
enh hat geschrieben:Wenn alles bedacht und geprüft wurde kann man die Artikel schon löschen.
6. Oktober 2015 13:45
fiddi hat geschrieben:Es wird nämlich immer wieder gerne von uns Programmierern vergessen das zu berücksichtigen.
15. Oktober 2015 16:01
16. Oktober 2015 10:46
27. Oktober 2015 15:30
27. Oktober 2015 17:07
fuige hat geschrieben:Ne, ne, ich habe brav das Artikelbuchblatt verwendet.