Generate Materials Cards
This window generates many material cards at once by combining all the field values you choose. You pick a model material whose card data is copied, then fields such as size and color, and values for each field. The program generates a card for every possible combination and builds its name and code from the values. For the practical steps see Generate many material cards at once.
Opening the window
- From the ribbon: Materials > Tools > Tools > Generate Materials Cards.
- The command needs warehouses in your licence and the generate material cards feature, and it does not show when the file is in multiple-files mode.
- The user needs the permission to run the Generate Materials Cards report in Users Management.
Window fields
| Field | Description | Required | Values and rules |
|---|---|---|---|
| According to Material | The model material. The program copies from it to every new card the units, prices, limits, currency, price policy, gifts, expiry and serial number options, tax, picture, branch and the text fields. | Yes | When you choose it the program fills the group from the material's group. If you leave it empty the message "Please select material" appears. |
| Group | The group that receives the generated cards. | Yes | The cards go to this group even when it differs from the model's group. If you leave it empty the message "Please select group" appears. |
| Fields | A list of ten fields: Size, Source, Location, Manufacturer, Group, Color, Provenance, Type, Model and Name. | — | Tick a field to use it. The order of the fields in the list is the order their values appear in the card name and code. The program saves the order after generating. |
| Order arrows (beside the list) | Move the selected field up or down the list. | — | — |
| Fields Values | The values of the field selected in the Fields list: tick the values you want, and you can select several. | — | The list shows when the field has stored values (see Customize). |
| Search box above Fields Values | Type the beginning of a value to select the matching value in the list. | — | — |
Enter Code and Enter Name and the > button | They replace the values list when the field has no stored values. Type the value's code and name, then click > to add one value. | — | Only one value per field can be added this way, otherwise the message "Can't give more than one value to this type, you have to customize values" appears. A value without code or name is refused ("Code is Missing" and "Name is Missing"). |
| Summary | The selected values of every field together. | — | This is what the cards are generated from. |
| Generate Materials According to Name Only | Makes the card name the value of the Name field alone. | No | It enables only if the file allows repeated material names and the Name field is ticked with a selected value. |
| Generate Barcode | Uses the generated material code as its barcode. | No | — |
| Model Name | Text that every card name starts with. | No | See How the program builds the name and code. |
| Model Number | The start of every card code, followed by a running number. | No | If you fill it, the program generates sequential codes instead of combining the value codes. |
| Generate Bill | Saves a bill that holds the generated materials after generating them. | No | Works with Bill type. |
| Bill type | The type of the bill to generate. | Yes when Generate Bill is ticked | A list of the bill types in the file. |
| Code | The shape of the generated card code. Read-only. | — | — |
| Cards Count | The number of cards that will be generated: the product of the number of selected values in every field. Read-only. | — | — |
| Code Fields | The names of the fields that make up the code, between < and >. Read-only. | — | — |
Window buttons
| Button | What it does |
|---|---|
| Generate | Generates the cards. See Generating. |
| Delete | Deletes the materials that match the selected values. See Deleting. |
| Close | Closes the window. |
| Material Card | Opens the card of the material chosen in According to Material. |
| Customize | Opens the Customize window of the selected field. |
| Branches... | Opens a list of branches so you can choose the branches where the generated cards appear. The button shows when branches are on in the licence and in the file options, and the file has at least two branches. If you close the list without Ok the program cancels the choice, and the cards take the branches of the model material. |
How the program builds the name and code
The program goes through the ticked fields in list order, and for every combination of values it builds:
- The name: the Model Name text if any, then the name of each value, separated by spaces. There is one exception: if the file allows repeated material names and you typed a Model Name, the name of every card is the Model Name alone. If you tick Generate Materials According to Name Only, the card name is the value of the Name field alone.
- The Latin name: the Latin names of the values one after another, for values that have a Latin name.
- The code: the code of each value one after another in list order. If you typed a Model Number, the code is the model number followed by a running number with leading zeros, which starts from the highest number the program finds in material codes that begin with the same model number.
If the program finds that the name of a combination (when names must not repeat) or its code belongs to another material, it shows "Duplicate Name" with the name or "Code is duplicated" with the code, skips this combination and goes on with the rest.
Example. Model Name is Shirt, the fields are Size (values: Small S, Medium M, Large L) and Color (Red R, Blue B), there is no model number, and the file does not allow repeated names. Cards Count is 6 (3 × 2). The cards are generated in this order:
| Code | Name |
|---|---|
SR | Shirt Small Red |
SB | Shirt Small Blue |
MR | Shirt Medium Red |
MB | Shirt Medium Blue |
LR | Shirt Large Red |
LB | Shirt Large Blue |
Generating
When you click Generate the program checks, in order: the model material, then the group, and then asks: "Are you sure that you want to generate the materials' cards" (Yes/No). After Yes you must have selected values for at least one field, otherwise the message "Please specify material fields" appears.
For every combination the program generates a card that copies the model material's data, then writes over it the name, the code and the values you chose for size, source, location, manufacturer, type, color, provenance and model, and writes the barcode if you ticked Generate Barcode. Then it copies the model material's accounts to each new card.
After generating:
- If at least one card was generated the message "Generating materials card is completed successfully" appears, then the Generate Materials Cards report with a Material Name column (shown as
code-name) and the command View Material Card... to open a card. - If no card was generated the message "No card was generated" appears.
- The program saves the order of the fields for next time.
- If you ticked Generate Bill, the program saves a bill of the chosen type. Its warehouse is the bill type's default warehouse (otherwise the first warehouse in the file), its account is the default account (otherwise the first account), and it holds each generated material with quantity
1in the first unit. Then it opens the bill.
Deleting
The Delete button deletes every material in the file that matches the selected values, not only the materials this window generated.
The program builds a condition from the selected values: within one field any of its values is enough, and across fields all must hold. For the Name field the program matches any name that contains the value. If you selected no values the message "Please select material" appears. Then it asks: "Are you sure to delete the materials?" (Yes/No). After Yes the program shows "Material is used in bill. You can't delete it" with the name of each matching material that has movement in bills, and deletes the rest. On success the message "Materials have been deleted successfully" appears, and on failure "Error in deleting materials".
The Customize window
This window stores the values you choose from in Fields Values. It opens with the Customize button after you tick the field in the list (otherwise the message "Please choose an item from the list before clicking Customize button" appears). It does not work with the Group field. The group box is titled Field Options followed by the field name.
| Item | Description | Required | Values and rules |
|---|---|---|---|
| Values grid | Four columns: Code, Name, Latin Name and Notes, with up to 5000 rows. | — | Every row needs a code and a name, codes and names must not repeat, and all codes must have the same number of characters. Press F4 while in the Code column to copy the code to the next row, with one added to its last numeric part. |
| Button | What it does |
|---|---|
| Save | Saves the values in place of the values stored earlier for this field. |
| Close | Closes the window, and asks first if there are unsaved changes. |
| Import from Mat. Card | Adds to the end of the grid the values that already exist in material cards for this field and are not stored yet (in the Name column, so you must type their codes). It does not show for the Name field. |
| Import Files | Opens Read Materials from File and fills the grid from it, replacing the current content. |
Save checks the following and otherwise shows a message:
| Message | Reason |
|---|---|
| "Empty Table" | The grid has no rows. |
| "Code or name must not be repeated." with "Duplication in Line No" and the two line numbers | Two rows have the same code or the same name. |
| "Code Must Not Be Empty" | A row has an empty code. The program skips it. |
| "It's not allowed to repeat code or name" with the name and the code | A repeated value. |
| "Can't Save! Count of digits must match code" | The codes of the rows have different lengths. |
The program skips a row with an empty name without a message.
The Read Materials from File window
It opens from the Import Files button of the Customize window.
| Item | Description | Required | Values and rules |
|---|---|---|---|
| File | The path of a text file. | Yes | Example: D:\data\sizes.txt. The browse button next to the box opens a file picker. The program remembers the last file. |
| File Fields | A list of four columns: Code, Name, Latin Name and Notes. | Yes | Tick the columns your file has, in the same order. |
| Options | Opens the options of the text file (separator, quotation marks and character encoding). | — | The same options that other text imports use. |
| Ok | Checks and then reads the file. | — | Messages: "File Name Missing", "The file not found" and "Must select an item". |
| Cancel | Closes the window without reading. | — | — |
The program reads the file line by line, places the fields of each line in the grid columns according to the ticked columns and their order, and stops reading a line at the first empty field. It empties the grid first. If the file is empty the message "File Is Empty" appears.
Messages
| Message | Why it appears | What to do |
|---|---|---|
| "Please select material" | You clicked Generate with no model material. It also appears for Delete with no values. | Choose the material. |
| "Please select group" | You clicked Generate with no group. | Choose the group. |
| "Are you sure that you want to generate the materials' cards" | You clicked Generate. | Choose Yes. |
| "Please specify material fields" | You selected no values for any field. | Select values or add one. |
| "Duplicate Name" followed by the name | The name of the combination belongs to another material and the file does not allow repeated names. | Change the values or the model name. |
| "Code is duplicated" followed by the code | The code of the combination belongs to another material. | Change the codes or the model number. |
| "Generating materials card is completed successfully" | At least one card was generated. | Review the report. |
| "No card was generated" | The program skipped every combination. | Read the name and code messages. |
| "Please enter the group" | You clicked > for the Group field and the Group box is empty. | Choose the group. |
| "Can't give more than one value to this type, you have to customize values" | You tried to add a second value with the > button. | Use Customize. |
| "Please choose an item from the list before clicking Customize button" | You clicked Customize and the field is not ticked. | Tick the field first. |
| "Are you sure to delete the materials?" | You clicked Delete. | Choose Yes or No. |
| "Material is used in bill. You can't delete it" | A matching material has movement. | Nothing; the program keeps it. |
| "Materials have been deleted successfully" and "Error in deleting materials" | The result of the deletion. | — |
Related
This page applies to alameen ERP 10, version 10.1.79.764.