Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Use this event to

Populate new Item Cross Reference prior to record being inserted.


Replaced by: 64848647  (MOB5.26 or newer)


Template

    // [Template]
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Item Cross Reference Mgt.", 'OnPostAdhocRegistrationOnItemCrossReference_OnBeforeInsertItemCrossReference''', true, true)]
    local procedure OnPostAdhocRegistrationOnItemCrossReference_OnBeforeInsertItemCrossReference(var _RequestValues: Record "MOB NS Request Element"; var _ItemCrossReference: Record "Item Cross Reference")
    begin
    end;

Example

    // [Example]: Populate Description on new Item Cross Reference
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Item Cross Reference Mgt.", 'OnPostAdhocRegistrationOnItemCrossReference_OnBeforeInsertItemCrossReference''', true, true)]
    local procedure MyOnPostAdhocRegistrationOnItemCrossReference_OnBeforeInsertItemCrossReference(var _RequestValues: Record "MOB NS Request Element"; var _ItemCrossReference: Record "Item Cross Reference")
    var
        RegistrationType: Text;
        ItemNo: Text;
        VariantCode: Text;
        UoM: Text;
    begin
        RegistrationType := _RequestValues.GetValue('RegistrationType');
        ItemNo := _RequestValues.GetValue('ItemNumber');
        VariantCode := _RequestValues.GetValue('Variant');
        UoM := _RequestValues.GetValue('UoM');

        _ItemCrossReference.Validate(Description, CopyStr(StrSubstNo('%1 Item: %2 Variant: %3 UoM: %4', RegistrationType, ItemNo, VariantCode, UoM)1, MaxStrLen(_ItemCrossReference.Description)));
    end;


More examples

There are no items with the selected labels at this time.


Version History

Version

Changes

MOB5.17Introduced as OnPostAdhocRegistrationOnItemCrossReference_OnBeforeInsertItemCrossReference (MOB5.17 - MOB5.22)
MOB5.26Moved to new "MOB Item Cross Reference Mgt."
  • No labels