Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...


Info
titleSystem requirements
  • Business Central 17 with feature "Item Reference" enabled.
  • Business Central 18 (or newer)
  • MOB5.24 (or newer)

Use this event to

Excerpt

Populate new Item Reference prior to record being inserted.


Requires Business Central 17 (or newer) with feature "Item Reference" enabled.See also: MobItemCrossReferenceMgt - OnPostAdhocRegistrationOnItemCrossReference_OnBeforeInsertItemCrossReference


Template

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

Example

    // [Example]: Populate Description on new Item Reference
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Item Reference Mgt.", 'OnPostAdhocRegistrationOnItemReferenceOnPostAdhocRegistrationOnItemCrossReference_OnBeforeInsertItemReference''', true, true)]
    local procedure MyOnPostAdhocRegistrationOnItemReference MyOnPostAdhocRegistrationOnItemCrossReference_OnBeforeInsertItemReference(var _RequestValues: Record "MOB NS Request Element"; var _ItemReference: Record "Item 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');

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


Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
cqllabel = "bc" and label = "example" and label = "onbeforeinsertitemreference"


Version History

Version

Changes

MOB5.2324Introduced