Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to omit unpopulated segment? #242

Closed
MikeCrutchfield opened this issue Feb 6, 2023 · 2 comments
Closed

How to omit unpopulated segment? #242

MikeCrutchfield opened this issue Feb 6, 2023 · 2 comments
Labels

Comments

@MikeCrutchfield
Copy link

MikeCrutchfield commented Feb 6, 2023

I am trying to omit the 'N2' segment from being written out to an 855 Document file. There is no data for the segment but it writes the line anyway.

DTM*068*20230207~
N1*BT*Bill To Name~
N2*~
N3*Bill To Address~
N4*Bill City***US~
N1*ST*Jane Doe~
N2*~
N3*33 South Sixth Street~
N4*Minneapolis*MN*55402*US~
PO1*1*1*EA*32.92**VN*717NV2IC8A~

I have set the Mandatory attribute flag to false and not declared it at all without success.

		[EdiValue(Path = "N2/0", Description = "N201 - Name", Mandatory = false)]
		public string AdditionalName { get; set; }

		[EdiValue(Path = "N2/0", Description = "N201 - Name")]
		public string AdditionalName { get; set; }

Thanks for any help.

@cleftheris
Copy link
Contributor

Hi,

In order to omit the segment from your transmission you have to wrap it in a segment decorated class. After that if the property that holds the N1Segment is set to null the serializer will skip it completely.

C.

@MikeCrutchfield
Copy link
Author

MikeCrutchfield commented Feb 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants