Create a web App to produce labels with Barcode

Hi Guys,

At the moment we have the challenge that our customers send us products without a clear identifier. I would like to help out with a short app creating an identifier with a running number and than creating Labels (.jpeg) with this identifier. The client shall have the opportunity to chose its destination and the count of Labels to create. 

I have the following Entities in mind:

  1. User (with ClientName and ClientNameShortcut)
  2. Destination (with DestinationName and Destination ShortCut) 
  3. Label (with UserID and DestinationID)

The Identifier shall look like this: 

ClientShortcut + DestinationShortCut + RunningNumber 

So in the process the client logs in (system knows its client shortcut) chooses its destination and the count of products he wants to label. Then the System creates the amount of labels and sends it (in best case directly to a printer).

Cound you give me a hind how to develop this the easiest way? I struggle with running number and label creation at the moment...

Thanks! 

Tobias

Hi Tobias,

First, don't call an Entity "User". "User" is already a System Entity, and it would be very, very confusing if there was a User that isn't the System's User. Calling it "Client" would be a good solution.

Secondly, don't prefix Attribute names with the Entity name, unless it's a foreign key. So if you have a "Destination" Entity, name the Attributes "Name" and "ShortCut" (but UserId and DestinationId in Label is good!).

Thirdly, use "Id" (with a lower case "d") instead of "ID". This is the way that the Platform names Identifier Attributes, and it's good practice to follow that.

Ok, that said onto your questions. As for the "running number", there are several ways to solve it. If it's really just any unique number as long as the second has a higher number than the first, you could just use the Id of the Label Entity. If you need some more specific rules (e.g. the numbers must ne sequential, or within a specific range, and so on), I would create a SequenceNumber Entity that holds the last number used (if you need more than one, independent, sequence number series, you could create multiple records distinghuised by some identification, otherwise it holds only a single record). Use the "GetXxxForUpdate" Entity Action to prevent simultaneous access by multiple users/processes, add the number you need to it, and save that, so the next user/process can get a new range.

As for label creation, that depends of course on what you want. If you want the label to have a barcode, you'll need some barcode component (there may be some in the forge). If you need a JPEG as output, you'll need some image library (there are for sure some in the forge), and so on. Printing is possible, but you'll need some JavaScript to do so, and you'll probably want to tweak your CSS so it's printer friendly.