TCC – T-XML Subquery

So I’ve got a T-XML export from the requisition entity that needs to have the posting date on it. So I just created everything from the export to the SourcingRequest entity and all is good. Well not really, the destination folks that receive the file didn’t want to recode it on their side. So to make a long story short, here is how you pull the most recent open date in this situation from the requisition entity.

<quer:projection alias="LatestPostingDate" projectedValueType="string" projectedField="RuntimeString:LatestPostingDate" xmlns:quer="http://www.taleo.com/ws/integration/query">
	<quer:query projectedClass="SourcingRequest" alias="sqPostingDate" preventDuplicates="true" pagingsize="1">
		<quer:projections>
			<quer:projection alias="PostDate">
				<quer:maximum>
					<quer:customFunction name="TO_CHAR">
						<quer:field path="OpenDate"/>
						<quer:string>yyyy-MM-dd</quer:string>
					</quer:customFunction>
				</quer:maximum>
			</quer:projection>
		</quer:projections>
		<quer:filterings>
			<quer:filtering>
				<quer:equal>
					<quer:field path="Requisition,Number"/>
					<quer:field ownerQuery="PhenomExport" path="Number"/>
				</quer:equal>
			</quer:filtering>
		</quer:filterings>
	</quer:query>
</quer:projection>