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
10 replies
Subscribers
11 subscribers
Views
2727 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
Hi , i have two cdts namely 'A' and 'B' wherein 'A' has
himanshug
over 10 years ago
Hi , i have two cdts namely 'A' and 'B' wherein 'A' has one to many relation with 'B'.Now while showing the records of 'A' i also want to fetch the details of 'B' . How can i do that. For example if there is a field 'Name' in B and reference variable in 'A' for 'B' is 'Many' , so if i try to show 'B' by using 'Many.Name' it gives me an error saying that [Name] is a type of multiple data type . How do i show the records of B in A then ?
Thanks in advance....
OriginalPostID-83353
OriginalPostID-83353
Discussion posts and replies are publicly visible
0
Sathya Srinivasan
Appian Employee
over 10 years ago
If you have the relation defined in your CDT, a query rule to fetch A should fetch B automatically as it's child element. Are you saying this is not happening? If so, I suggest you raise a support ticket.
On the other hand, if you are not maintaining the relationship via JPA, an easier (and I personally prefer keeping tables decoupled) is to have one QR that fetches A and using the with() statement and an alias, you can get the corresponding ID and fetch the B's
Lastly, I've seen this issue when fetching nested CDT's. If I remember correctly, the work-around was to have a QR that fetches the B's for a given A
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike Schmitt
Certified Lead Developer
over 10 years ago
How are you trying to show [Name]? It sounds like you need to treat it like an array (since it is being returned as one).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
himanshug
over 10 years ago
i am trying to show name as Many.Name which gave me an error and then i tried to show it like Many.Name[1] and then again it showed me an error .Could you please help me .
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
himanshug
over 10 years ago
@Sathya: I have a requirement to show data on RECORD for entity bach records using one to many relationship on tables. When fetching data from the reference table called B from A (A to B-one to many relationship) is giving me an error. Could you please provide any solution for the same.
Secondly can we used QueryRule in the Record expression.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 10 years ago
You will be using a QR to fetch B in the Record for A. Use the With() statement to run a query rule and work with the result to build the UI for B.
For e.g. In the A record, you can have something like
with (cc:fetchValueForBqueryrule(a.id),
{define your SAIL definition for displaying value of B using cc as alias.}
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
himanshug
over 10 years ago
@Sathya : Sorry to bother again , but i am still not able to do this . This is what i have done
=with (cc:rule!fetchValueForBqueryrule(rf!Number),{'type!{http://www.appian.com/ae/types/2009}ColumnLayout'(
contents: {
'type!{http://www.appian.com/ae/types/2009}TextField'(
label: "Customer",
readOnly: true,
value: cc.Title )
}
)})
And pasted the above code in the UI dasboard expression but it still gives me error saying "Could not retrieve record dashboard"
Could you please help me this is on high priority
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 10 years ago
try cc.data.title.
Execute your with() rule in expression editor to understand what it returns. This will help you extract the different contents easily.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 10 years ago
Oh! I forgot to mention - If your QR returns multiple record, then you need to dynamically create multiple TextField contents to display each of the name OR use a grid.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
himanshug
over 10 years ago
Thanks sathya for the reply. My QR is fetching single value from the Database. Moreover its working fine while testing through QR or expression editor. But while using the same SAIL component over the tempo in Records. Its giving JAX error.
"com.appiancorp.co
mmon.xml.JaxbConversionException: JAXB failure trying to convert typed value Typ
edValue[it=744,v={{{TypedValue[it=3,v=_cId]=TypedValue[it=3,v=0]},<null>},{{{htt
p://10.100.11.18:8080/suite/rest/a/record/latest/dcmCases/kEBzj3pNGR7_2c-xOprEV9
g3YcFPC8ycgpMvpwaKiMS37Y-DKNENR9eAPKXSdb1HsL9K-9XAAQp3f2reL1kDjWW4g,update,,<nul
l>,<null>}}},TypedValue[it=593,v={{<null>,{TypedValue[it=1016,v={{{TypedValue[it
=3,v=_cId]=TypedValue[it=3,v=1__testingqueryruleinrecord_6]},<null>},Customer,,<
null>,1,<null>,Queue Manager,<null>,<null>}]}}}],<null>,<null>,<null>}] to java
class com.appiancorp.uidesigner.conf.CanonicalUiConfig"
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
himanshug
over 10 years ago
@sathya: is there a way to go about that ?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel