[SalesForce] the data type for type=”tns:ID

Hi can i know what is the data type for this: type="tns:ID"

<element name="CreatedById" nillable="true" minOccurs="0" **type="tns:ID/>**
<element name="CreatedDate" nillable="true" minOccurs="0" type="xsd:dateTime"/>

Best Answer

tns stands for tns Namespace (short for Target Name Space) and if you will check any enterprise wsdl it is defined in the beginning

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:tns="urn:enterprise.soap.sforce.com" 
xmlns:fns="urn:fault.enterprise.soap.sforce.com" 
xmlns:ens="urn:sobject.enterprise.soap.sforce.com" 
targetNamespace="urn:enterprise.soap.sforce.com">

it is used as prefix to define CreatedById with ID type.

Same applies to other name space xsd which is defining dateTime type for CreatedDate.

This is very broad topic to explain so it is better if you read about XML and it's structure. Reference Document

Related Topic