Closed gisborne closed 8 years ago
Based on the error message, value is too short in element NM103
, it looks like you did provide a single-character value "1"
. The element type is E66
, which is declared to require 2-3 characters. However the list of allowed values clearly has values with a single character, so I agree this looks like an error. I don't think we have the official documentation for 4010, but further evidence is that the length is declared 1-2 in the 5010 version of E66
.
@irobayna if you have time, could you check for documentation on that element? I think you made the commit to declare it, so maybe there was a reason it was declared length 2-3 (but it does look like a simple mistake). If you find that it should be 1-2, or can't find any documentation, we should probably change it to 1-2 for the other versions too, since it looks like those were copy-pasted from 4010.
You didn't include the error message about NM104
being required, but the error is because of the relationship between the two elements (the error message could probably be clearer). This line declares a relationship between NM103
and NM104
of type P
, which means if one of the two are present, then both are required. You could leave them both blank or fill them both in, but providing only one value is not allowed.
@gisborne Out of curiosity, did the error about NM104
state elements NM104 must be present when elements NM103 are present
? If not, please paste the error you saw... I'll want to correct that if it wasn't the case.
I'm doing:
builder.N1 "SH", sender
and being told:
Stupidedi::Exceptions::ParseError: required element N103 is blank
@kputnam Yes, it was a mistake
It appears the Min/Max
declaration should have been 1/2
BTW, you are also correct on the syntax rules. These are defined as follows for N1
Syntax Rules:
1. R0203 - At least one of N102 or N103 is required.
2. P0304 - If either N103 or N104 is present, then the other is required.
@kputnam I have committed change to master
Thanks Isi!
Please update lib/stupidedi/version.rb with a new version number so bundler notices the change and I can update.
@gisborne new version available
I'm trying to create a 214 (Carrier Shipment Status Notification). I'm trying to create the N1 element,
b.N1 "SH", "SILVERADO VINEYARDS C/O DFS", "1"
but I'm being told that N103 and N104 elements are required.
Stupidedi::Exceptions::ParseError: value is too short in element N103
This would appear to be in functional_groups/004010/segment_defs/N1.rb.
I'm a little new to this EDI business, but from specifications I read (eg http://www.ryder.com/supply-chain/~/media/Ryder/Files/SupplyChain/EDIspecs/carrier_214.ashx) that these elements should not be marked as required.
I believe the correct code would be:
Many thanks for this project, and for your help.