Spaces not recognized by JDE Business Function from XML

This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
Post Reply
NeisesJ
Posts: 1
Joined: October 28th, 2021, 9:56 am
Contact:

Spaces not recognized by JDE Business Function from XML

Unread post by NeisesJ »

Hello,

I'm seeing the spaces at the beginning of the parameter in the logs but if I copy and paste that value from the logs into the business function to test directly, it fails. The spaces appear to be there but they aren't being recognized by the business function. If I take out those copied spaces and use the spacebar to enter the same amount in the business function I get the expected result.

I used the   special character for my spaces so that may be the problem.

Does anyone have experience padding a value with spaces to the left and seeing success with the JDE business functions? I pasted the parameter with "8 SPACES HERE" where I was trying the special characters as well as just typing the spaces.

<param name="szBranchPlant"><xsl:text>8 SPACES HERE</xsl:text><xsl:value-of select="/WorkData/_ViewParameters/FromBranch"/></param>

Thanks!
word count: 152

Tags:
SteveCap
Posts: 327
Joined: August 26th, 2021, 9:18 am
Contact:

Re: Spaces not recognized by JDE Business Function from XML

Unread post by SteveCap »

There are a few different ways you can accomplish this.

1. Use PadLeft service

Code: Select all

<PadLeft>
	<Convert>
		<Data IsArray="True" Index="1">
			<Name>BranchPlant</Name>
			<Value>
				<xsl:value-of select="WorkData/_ViewParameters/FromBranch"/>
			</Value>
			<Length>8</Length>
			<Character>&#160;</Character>
		</Data>
	</Convert>
</PadLeft>
Use the output

Code: Select all

<xsl:value-of select="WorkData/PadLeft/Output/BranchPlant"/>
in the business function.

2. Use XSLT
There are a few ways to do this
a.
using pure vanilla xslt

Code: Select all

<xsl:value-of select="substring('            ',1,12-string-length(WorkData/_ViewParameters/FromBranch))"/><xsl:value-of select="WorkData/_ViewParameters/FromBranch"/>
b.
using EASYProcess Custom xslt function

Code: Select all

<xsl:value-of select="EASYProcess:PadLeft(WorkData/_ViewParameters/FromBranch,12,' ')"/>
word count: 120
Post Reply