Do not send tag if no data

If you have a new question you’d like our support staff to post a response to, please visit our customer community, GoAnywhere Insiders, to pose the question in our Discussion Boards. We have a thread “Ask Our Tech Experts” that our support team monitors on a regular basis, or you can start a new discussion where other GoAnywhere users and support staff can weigh in. Log in or create your new account at https://insiders.goanywhere.com.

If you need an immediate response, please create a support ticket or contact our support team by email at [email protected].
2 posts Page 1 of 1

dhascup

Posts: 5
Joined: Mon Mar 24, 2014 9:11 am

Post by dhascup » Thu Oct 01, 2015 1:47 pm
Sending XML invoice to customer

if 1%60 net 61, we send the following:
<PaymentTerm payInNumberOfDays="60">
<Discount>
<DiscountPercent percent="1.000"/>
</Discount>
</PaymentTerm>
<PaymentTerm payInNumberOfDays="61"/>


if net 60, we currently send:
<PaymentTerm payInNumberOfDays="">
<Discount>
<DiscountPercent percent=""/>
</Discount>
</PaymentTerm>
<PaymentTerm payInNumberOfDays="60"/>


They are rejecting this and they want us to send:
<PaymentTerm payInNumberOfDays="60"/>


I tried using the SkipIfEmpty = true but receiving an error.

Linoma support told me : "you cannot use the Skip If Empty function with child elements and/or elements."

Thanks in advance for the help
David

Support_Rick

Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Thu Oct 01, 2015 2:26 pm
David,

What you were told by Support is correct ... if the element contains sub-elements or attributes, then the value for "skipIfEmpty" is ignored or not allowed.

In your code, you have:
Code: Select all
<element name="PaymentTerm">
	<attribute name="payInNumberOfDays" value="${dataHeader[41]}" />
	<element name="Discount">
		<element name="DiscountPercent">
			<attribute name="percent" value="${dataHeader[42]}" trim="both" />
		</element>
	</element>
</element>
"payInNumberOfDays" is an attribute of the element "PaymentTerm" that has sub-elements and attributes, which isn't allowed in that scenario by definition.

Your post also contains the following statement:
They are rejecting this and they want us to send:
<PaymentTerm payInNumberOfDays="60"/>
Which corresponds to this:
Code: Select all
<element name="PaymentTerm">
	<attribute name="payInNumberOfDays" value="${dataHeader[43]}" />
</element>
Which could utilize the option of ${system.emptyString} as the null substitute for the value so that it represents a "blank" if nothing is presented.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1