Info | ||
---|---|---|
| ||
If you have no customizations to ReferenceData you should have no issues upgrading. |
...
When will I need to update my existing customizations?
When installed on-premise:
- The next time you intends to upgrade the standard Mobile WMS al extension to a version MOB5.14 (or never) you may need to recompile your own existing customizations to work with the syntax changes.
- As long as your existing Mobile WMS al extension remains compatible with the underlying Business Central base application you are not forced to update.
For cloud environments:
- You in general manually controls when an extension is updated in an existing environment (by uninstalling/reinstalling from AppSource).
- During next major deployment you will likely be auto-updated to latest Mobile WMS al extension version.
- Therefore, it is recommended to update your Mobile WMS al extension to latest version prior to next major launch to avoid issues during that upgrade process.
How to rewrite your existing customization
Rewrite your existng OnGetReferenceData_OnAfterCreateHeaderConfigurations eventsubscriber to use OnGetReferenceData_OnAddHeaderConfigurations instead.
All references to Record "MOB RefD HeaderConfig Element" should now be Record "MOB HeaderField Element".
Existing calls to helper methods on this input parameter table must be changed to follow new naming conventions (see examples below).
Example - existing code
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAfterCreateHeaderConfigurations', '', true, true)]
local procedure OnGetReferenceData_OnAfterCreateHeaderConfigurations(var _HeaderConfigurationElement: Record "MOB RefD HeaderConfig Element")
begin
with _HeaderConfigurationElement do begin
Create('CustomPrintLabel'); // New ConfigurationKey
// ItemNumber
Add_TextValue(
1, //id
'ItemNumber', //name
CopyStr(MobWmsLanguage.GetMessage('ITEM') + ':', 1, 100), //label
100, //label width
true, //clear on clear
true, //accept barcode
30, //length
false, //optional
'ItemSearch', //search type
CopyStr(MobBaseToolbox.GetItemNoGS1Ai(), 1, 30), //ean GS1Ai
false); //locked
// Lot Number
Add_TextValue(
2, //id
'LotNumber', //name
CopyStr(MobWmsLanguage.GetMessage('LOT_NO_LABEL') + ':', 1, 100), //label
100, //label width
true, //clear on clear
true, //accept barcode
30, //length
false, //optional
'', //search type
CopyStr(MobBaseToolbox.GetLotNoGS1Ai(), 1, 30), //ean GS1Ai
false); //locked
end;
end;
Example 1 - new code (1:1 conversion)
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAddHeaderConfigurations', '', true, true)]
local procedure My01OnGetReferenceData_OnAddHeaderConfigurations(var _HeaderFields: Record "MOB HeaderField Element")
var
MobToolbox: Codeunit "MOB Toolbox";
MobWmsLanguage: Codeunit "MOB WMS Language";
begin
with _HeaderFields do begin
InitConfigurationKey('CustomPrintLabel'); // New ConfigurationKey
// ItemNumber
Create_TextField(1, 'ItemNumber');
Set_label(MobWmsLanguage.GetMessage('ITEM') + ':');
Set_clearOnClear(true);
Set_acceptBarcode(true);
Set_length(20);
Set_searchType('ItemSearch');
Set_eanAi(MobToolbox.GetItemNoGS1Ai());
// Default values no longer needs to be set:
// Set_labelWidth(100);
// Set_optional(false);
// Set_locked(false);
// LotNumber
Create_TextField(2, 'LotNumber');
Set_label(MobWmsLanguage.GetMessage('LOT_NO_LABEL') + ':');
Set_clearOnClear(true);
Set_acceptBarcode(true);
Set_length(20);
Set_eanAi(MobToolbox.GetLotNoGS1Ai());
// Default values no longer needs to be set:
// Set_searchType('');
end;
end;
Example 2 - new code using templates - then setting only properties different from the template (if any)
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAddHeaderConfigurations', '', true, true)]
local procedure My02OnGetReferenceData_OnAddHeaderConfigurations(var _HeaderFields: Record "MOB HeaderField Element")
begin
with _HeaderFields do begin
InitConfigurationKey('CustomPrintLabel'); // New ConfigurationKey
// ItemNumber by template
Create_TextField_ItemNumber(1);
Set_length(20);
// LotNumber by template
Create_TextField_LotNumber(2);
Set_length(20);
end;
end;