Showroom Sample Manager for Microsoft Dynamics 365 Business Central
A custom AL (Application Language) Extension for Business Central was written to manage Showroom Samples for a large International bookseller.
Sample books are pulled from purchase receipts, stored in a special section in the warehouse until needed by sales, and then retrieved to be sent to a showroom or trade show location as required by the sales team.
A custom label printing extension in AL was needed with remote printing capabilities for a label printer anywhere in the world.
Showroom Sample Manager for Business Central
A custom Business Central role “Showroom Manager” was created for to manage the Showroom Samples
Showroom Sample Manager for Business Central
Here’s how it works.
The Showroom asks for samples to be sent of this book “Disney Baby 100 First Words Lift-the-Flap”
Showroom Sample Manager for Business Central
The Showroom Sample Manager for Business Central uses the Showroom->Samples List menu - to filter for ‘Disney Baby*’
Showroom Sample Manager for Business Central
12 copies of the title needed are found in the Showroom Samples database.
Showroom Sample Manager for Business Central
The Showroom Storage Location is named after the book Category, with a sequential number appended so copies of that title (ISBN) can be easily found in the Showroom Storage Area
Showroom Sample Manager for Business Central
Drilling into the Showroom Location, “Children 325” shows the book samples are located in Room 1 in the Children’s section.
Showroom Sample Manager for Business Central
The Showroom Location table lists the locations alphabetically by Category, in this case “CHILDREN” and then a sequential number as a suffix appended to the Category. Here the Category is “CHILDREN” and the suffix is 325. We already saw from the Showroom Samples List that “Disney Baby 100 First Words Lift-the-Flap” was located in ROOM 1 in Location “CHILDREN 325”
Warehouse personnel will easily pull samples for this book from ROOM 1.
Showroom Sample Manager for Business Central
Presently, Sample Books are stored in 3 large rooms in the warehouse.
Showroom Sample Manager for Business Central
Our task was to pull 2 samples of Disney Baby … and record that in the Showroom Sample Manager for the Business Central table.
Showroom Sample Manager for Business Central
Adjusting a samples line for books pulled from storage to send to the Showroom is as simple as inserting a minus number on the line in the Adjustment Qty Column.
Showroom Sample Manager for Business Central
We created a Samples Ledger to record all transactions for every ISBN. With all the back-and-forth testing of ISBN 9781484718018. The remaining quantity now is 10, if you sum the column.
Showroom Sample Manager for Business Central
The remaining quantity of samples for “Disney Baby: 100 First Words Lift the Flap” is now 10
Showroom Sample Manager for Business Central
The 2 samples can’t be sent to the Showroom without custom labels
There is no custom label program in BC, so we created one inside Business Central for this purpose.
Let’s see how that works.
Showroom Sample Manager for Business Central
It is quite simple to generate labels for sample books to be sent from the Warehouse to the Showroom or a Book Fair.
Use the Showroom Sample Manager for Business Central entry window to open the Labels action menu to “Samples Labels Print Sheet.”
Showroom Sample Manager for Business Central
The Samples Labels Print Sheet is a database of all sample labels printed. Use it to print or reprint labels. In this case search by the ISBN (9781484718018).
Showroom Sample Manager for Business Central
Found the Disney Baby book by its ISBN. Now let’s print the labels.
Showroom Sample Manager for Business Central
Using the Reprint Function I am able to print the 2 labels I need to send with the 2 sample books.
Showroom Sample Manager for Business Central
The 2 labels are printed.
Showroom Sample Manager for Business Central
How is a label printer at a book fair in England able to communicate with our custom label printing app for Business Central Cloud?
Insight Works provides a free application (PrintNode Connector PowerTool) that connects a network printer (at a Web address) to Business Central. This accesses the “PrintNode” remote printing API so a network printer can be anywhere in the world. The tool from Insight Works is free, but access to the PrintNode API starts at $9/month.
Showroom Sample Manager for Business Central
And here’s the code …
table 90313 Samples Labels Print
Showroom Sample Manager for Business Central
And here’s the code…
table 90314 Samples Labels Setup
Showroom Sample Manager for Business Central
And here’s the code for the Labels setup page…
page 90315 Samples Labels Setup
Showroom Sample Manager for Business Central
And here’s the code…
page 90313 “Samples Labels Print Sheet”
page 90313 "Samples Labels Print Sheet"
{
Caption = 'Samples Labels Print Sheet';
PageType = List;
SourceTable = "Samples Labels Print";
UsageCategory = Lists;
ApplicationArea = All;
layout
{
area(content)
{
group(Scan)
{
ShowCaption = false;
field(MarkPrinted; MarkPrinted)
{
ApplicationArea = all;
Caption = 'Mark Printed';
ToolTip = 'Enter Number of Labels To Print.';
}
field(PrintCnt; PrintCnt)
{
ApplicationArea = all;
Caption = 'Number of Prints';
ToolTip = 'Enter Number of Labels To Print.';
// To print minimum 1 label and maximum 3 labels..
MinValue = 1;
MaxValue = 3;
}
field(ScanISBN; ScanISBN)
{
ApplicationArea = all;
Caption = 'Scan ISBN';
ToolTip = 'Scan the Sample Showroom ISBN';
}
}
repeater(General)
{
field(ISBN; Rec.ISBN)
{
ApplicationArea = All;
ToolTip = 'Specifies the value of the ISBN field.';
}
field(Title; Title)
{
ApplicationArea = All;
Editable = false;
}
field(Avail; Avail)
{
ApplicationArea = All;
Editable = false;
}
field(QtyonPO; QtyonPO)
{
ApplicationArea = All;
Editable = false;
}
field(NetPrice; netprice)
{
ApplicationArea = All;
Editable = false;
}
field(Retail; Retail)
{
ApplicationArea = All;
Editable = false;
field(Category1; Category1)
{
ApplicationArea = All;
Editable = false;
}
field(Category2; Category2)
{
ApplicationArea = All;
Editable = false;
}
field(CSPK; CSPK)
{
ApplicationArea = All;
Editable = false;
}
field("Note 1"; rec."Note 1")
{
ApplicationArea = All;
// Editable = false;
}
field("Note 2"; rec."Note 2")
{
ApplicationArea = All;
// Editable = false;
}
field(Printed; Rec.Printed)
{
ApplicationArea = All;
ToolTip = 'Specifies the value of the Printed field.';
Editable = false;
}
field("Printed Count"; Rec."Printed Count")
{
ApplicationArea = All;
ToolTip = 'Specifies the value of the Printed Count field.';
Editable = false;
}
}
}
}
actions
{
area(Processing)
{
action(Print)
{
Caption = 'Reprint';
Promoted = true;
PromotedIsBig = true;
PromotedCategory = Process;
ApplicationArea = All;
trigger OnAction()
var
begin
IF Confirm('Do you want to Reprint Label For ISBN %1', false, Rec.ISBN) then
Reprint();
end;
}
action(Print2)
{
Caption = 'Mark Printed';
Promoted = true;
PromotedIsBig = true;
PromotedCategory = Process;
ApplicationArea = All;
trigger OnAction()
var
begin
Rec.TestField(Printed, false);
IF Confirm('Do you want to Mark as Printed For ISBN %1 ', false, Rec.ISBN) then begin
Rec."Printed Count" := Rec."Printed Count" + 1;
rec.Printed := true;
Rec.Modify();
CurrPage.Update();
end;
end;
}
action(Print3)
{
Caption = 'Un-Mark Printed';
Promoted = true;
PromotedIsBig = true;
PromotedCategory = Process;
ApplicationArea = All;
trigger OnAction()
begin
IF Confirm('Do you want to Un-Mark as Printed For ISBN %1', false, Rec.ISBN) then begin
Rec."Printed Count" := 0;
rec.Printed := false;
Rec.Modify();
CurrPage.Update();
end;
end;
}
}
}
var
PrintCnt: Integer;
MarkPrinted: Boolean;
ScanISBN: code[50];
Title: text[100];
Avail: Decimal;
netprice: Decimal;
Retail: Decimal;
Category1: Text[30];
Category2: Text[30];
CSPK: Integer;
QtyonPO: Integer;
Emphasis: Boolean;
trigger OnOpenPage()
begin
Clearvalues();
PrintCnt := 1;
end;
local procedure setgreencolour()
begin
Style = Favorable;
StyleExpr = Emphasis;
end;
local procedure InitializeValues()
var
Item: Record Item;
begin
Item.CalcFields(Inventory, "Qty. on Sales Order", "Qty. on Purch. Order");
Avail := Item.Inventory - Item."Qty. on Sales Order";
QtyonPO := Item."Qty. on Purch. Order";
Title := Item.Description;
netprice := Item."Unit Price";
Retail := Item.Bks4Less_List;
CSPK := Item."PDG_Case Pack";
Category1 := Item.Category1;
Category2 := Item.Category2;
end;
local procedure Reprint()
var
SamplesLabelsPrint2: Record "Samples Labels Print";
SamplesLabelReport: Report "Samples Label Report";
lItemAvail: Record Item;
lsampleslaelsetup: Record "Samples Labels Setup";
lAvail: Decimal;
begin
//Min and Max Available Qty to Print START>>
IF SamplesLabelsPrint2.Get(Rec.ISBN) then begin
lAvail := 0;
lItemAvail.Get(Rec.ISBN);
lItemAvail.CalcFields(Inventory, "Qty. on Sales Order", "Qty. on Purch. Order");
lAvail := lItemAvail.Inventory - lItemAvail."Qty. on Sales Order";
IF (lAvail <= 0) then
Error('ISBN %1 is Not Available to Print', Rec.ISBN);
lsampleslaelsetup.Get();
IF (lAvail < lsampleslaelsetup."Min Avail Qty. To Print") then
Error('ISBN %1 is Not Available to Print', Rec.ISBN);
end;
//Min and Max Available Qty to Print END>>
SamplesLabelReport.Run();
end;
local procedure Scan_InitializeValues(lItem: Code[50])
var
SamplesLabelsPrint2: Record "Samples Labels Print";
SamplesLabelReport: Report "Samples Label Report";
i: Integer;
//Min and Max Available Qty to Print START>>
lItemAvail: Record Item;
lsampleslaelsetup: Record "Samples Labels Setup";
lAvail: Decimal;
//Min and Max Available Qty to Print END>>
begin
IF NOT SamplesLabelsPrint2.Get(lItem) then
Error('ISBN %1 was Not Found', lItem);
//Min and Max Available Qty to Print START>>
IF SamplesLabelsPrint2.Get(lItem) then begin
lAvail := 0;
lItemAvail.Get(lItem);
lItemAvail.CalcFields(Inventory, "Qty. on Sales Order", "Qty. on Purch. Order");
lAvail := lItemAvail.Inventory - lItemAvail."Qty. on Sales Order";
IF (lAvail <= 0) then
Error('ISBN %1 is Not Available to Print', lItem);
lsampleslaelsetup.Get();
IF (lAvail < lsampleslaelsetup."Min Avail Qty. To Print") then
Error('ISBN %1 is Not Available to Print', lItem);
end;
//Min and Max Available Qty to Print END>>
IF SamplesLabelsPrint2.Get(lItem) AND (SamplesLabelsPrint2.Printed) then
Error('ISBN %1 Already Printed\ You Can Directly Print By Selecting Grid.', lItem);
SamplesLabelReport.Run();
end;
local procedure Scan_InitializeValues2(lItem: Code[50])
var
SamplesLabelsPrint2: Record "Samples Labels Print";
SamplesLabelReport: Report "Samples Label Report";
i: Integer;
//Min and Max Available Qty to Print START>>
lItemAvail: Record Item;
lsampleslaelsetup: Record "Samples Labels Setup";
lAvail: Decimal;
//Min and Max Available Qty to Print END>>
begin
IF NOT SamplesLabelsPrint2.Get(lItem) then
Error('ISBN %1 was Not Found', lItem);
//Min and Max Available Qty to Print START>>
IF SamplesLabelsPrint2.Get(lItem) then begin
lAvail := 0;
lItemAvail.Get(lItem);
lItemAvail.CalcFields(Inventory, "Qty. on Sales Order", "Qty. on Purch. Order");
lAvail := lItemAvail.Inventory - lItemAvail."Qty. on Sales Order";
IF (lAvail <= 0) then
Error('ISBN %1 is Not Available to Print', lItem);
lsampleslaelsetup.Get();
IF (lAvail < lsampleslaelsetup."Min Avail Qty. To Print") then
Error('ISBN %1 is Not Available to Print', lItem);
end;
//Min and Max Available Qty to Print END>>
IF SamplesLabelsPrint2.Get(lItem) AND (SamplesLabelsPrint2.Printed) then
Error('ISBN %1 Already Printed\ You Can Directly Print By Selecting Grid.', lItem);
Rec.TestField(Printed, false);
// IF Confirm('Do you want to Mark as Printed For ISBN %1 ', false, Rec.ISBN) then begin
Rec."Printed Count" := Rec."Printed Count" + 1;
rec.Printed := true;
Rec.Modify();
CurrPage.Update();
// end;
end;
local procedure Clearvalues()
begin
Avail := 0;
QtyonPO := 0;
Title := '';
netprice := 0;
Retail := 0;
CSPK := 0;
Category1 := '';
Category2 := '';
end;
local procedure CheckLabelPrinted()
begin
IF rec.Printed then
emphasis := true
else
emphasis := false;
end;
}
Showroom Sample Manager for Business Central
And here’s the code for the report definition…
report 90311 Samples Label
Showroom Sample Manager for Business Central
And here’s the code for the SQL Report…SamplesLabels.rdlc
Showroom Sample Manager for Microsoft Dynamics 365 Business Central
In Summary:
A custom AL (Application Language) Extension for Business Central was written to manage Showroom Samples for a large International bookseller.
Sample books are pulled from purchase receipts, stored in a special section in the warehouse until needed by sales, and then retrieved to be sent to a showroom or trade show location as required by the sales team.
A custom label printing extension in AL was needed with remote printing capabilities for a label printer anywhere in the world.
Comments