Hi community! I’m trying to build a formula that generates a Pre-Processing Lot ID for each seed movement record. The logic depends on whether the movement is linked to a contract or not.
1. When the seed movement is linked to a contract
The Lot ID should concatenate:
- {Final Initials (from Farmers)}
- {Program (from Contracts)}
- {Seed Variety (from Contracts)}
- The last two digits of {Crop Year (from Contracts)}
- {Contracts} (the contract number)
- The final Bin code (from {To Bin}) following these rules:
- If the seed is moved to one of these bins — HK 01, HK 02, HK 03, HK 48, HK 49 — the lot number should display the full Bin code (alphanumeric).
- Any “Bin ” text prefix should be removed.
- If the seed is moved to HPB1, HPB2, or GP WHPB, or the movement goes to a Cleaner (detected in {To Location}), the lot should take the Bin code from {From Bin} instead.
- Otherwise, it uses the Bin code from {To Bin}.
Example (desired output):
MCO-OH-FINOLA-25-070-02
2. When there is no contract
The Lot ID should concatenate:
- {Final Initials (from Farmers)}
- {Program}
- {Seed Variety} (direct link to Seed Varieties)
- The last two digits of {Crop Year}
- The final Bin code (from {To Bin}), following the same rules:
- Full Bin code for HK 01, HK 02, HK 03, HK 48, HK 49
- Remove “Bin ” prefix
- Use {From Bin} if To Bin is HPB1, HPB2, GP WHPB, or a Cleaner
- Otherwise, use {To Bin}
Example output:
RVSF-CH-FINOLA-25-07
