Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
11 subscribers
Views
2099 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
I am using one to one mapping in my cdt's following the example mentioned in
himanshug
over 10 years ago
I am using one to one mapping in my cdt's following the example mentioned in
forum.appian.com/.../Defining_a_Custom_Data_Type
. While making records for the same if i individually just print access code column in my EMPLOYEE i am getting an error access code column doesnt exist.I want just the access code field in my EMPLOYEE records.Hoe can i get that. Can anybody please help me with this as i am new to this tool .
Thanks in advance...
OriginalPostID-78279
OriginalPostID-78279
Discussion posts and replies are publicly visible
0
GouthamKrishna
over 10 years ago
Hi Himanshu, if you let me know the outline of the structure of your CDT, I could help you out.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
himanshug
over 10 years ago
i have two cdt's ; one is EMPLOYEE which contains fields id,name and security , Security is of the type of other cdt which is ACCESS. In ACCESS cdt i have fields that are id,access card,date of issue
Now i want to show the record of EMPLOYEE with name and just access card column of the other cdt .
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 10 years ago
Hi Himan,
<xsd:complexType name="EMPLOYEE">
<xsd:sequence>
<xsd:element name="id" type="xsd:int">
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="securityCard" type="ACCESS">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@OneToOne(cascade=ALL, optional=false)
@JoinColumn(name="card_id", nullable=false, unique=true)
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ACCESS">
<xsd:sequence>
<xsd:element name="id" type="xsd:int">
-----------
</xsd:element>
<xsd:element name="accessCode" type="xsd:string" />
<xsd:element name="expirationDate" type="xsd:dateTime" />
</xsd:sequence>
</xsd:complexType>
If you want to access 'id' in EMPLOYEE access as --> rf!id
If you want to access 'accessCode' in 'ACCESS' then access it as --> rf!securityCard.accessCode (Here securityCard is the name of the 'ACCESS' entity that is referredOYEE). So here you need to use dot notation when you are traversing inside the CDT. Hope this answers your questions. If not or if you have any follow-up questions, please let me know.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 10 years ago
sorry for the typo- (Here securityCard is the name of the 'ACCESS' entity that is referred in EMPLOYEE).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
himanshug
over 10 years ago
Hi sikhivahans , i already have created the cdt's but while displaying them in records i am using the following code :
='type!{
www.appian.com/.../2009}ColumnArrayLayout'(
columns: {
'type!{
www.appian.com/.../2009}ColumnLayout'(
contents: {
'type!{
www.appian.com/.../2009}TextField'(
label: "First Name",
readOnly: true,
value: rf!firstName
),
'type!{
www.appian.com/.../2009}TextField'(
label: "Last Name",
readOnly: true,
value: rf!lastName
),
'type!{
www.appian.com/.../2009}TextField'(
label: "Security",
readOnly: true,
value: rf!security
)
}
)
}
)
In the record that is displayed , i am getting all the fields of the other cdt . I just want the accessCode field. How can i go about that ?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 10 years ago
Try this and let me know if you still have problem:
'type!{
www.appian.com/.../2009}TextField'(
label: "Security",
readOnly: true,
value: rf!security.accessCode
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
himanshug
over 10 years ago
yes it worked .Thank you :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel