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
8 replies
Subscribers
7 subscribers
Views
2680 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Hi, We're using legacy forms in one of our applications. Th
skumar
over 9 years ago
Hi,
We're using legacy forms in one of our applications. This form has a paging grid that allows user to select a record to edit.
The data that we're displaying has following fields:
Person
- aid (Primary Key)
- First Name
- Last Name
- Email (Unique Key)
- Company
Whenever we select a record, it returns the row number of selected record instead of returning "aid" which is the primary key of our CDT.
How can we achieve this ?
Thanks,
Sandeep
OriginalPostID-159498
OriginalPostID-159498
Discussion posts and replies are publicly visible
0
skumar
over 9 years ago
UPDATE:
We're using todatasubset() method to display data into paging grid
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@skumar So far I remember, in the paging grid component, todatasubset() retrieves the index whereas a query rule retrieves the primary key. I would like to suggest to make use of a query rule and check the results.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
skumar
over 9 years ago
@sikhivahans
I agree with your point. To be more specific with our business logic, we're performing a filter kind of thing on the fields. Below is the sample code of what we're trying to do:
if(or(isnull(ri!search_text), len(trim(ri!search_text)) = 0), rule!get_all_persons(a!pagingInfo(1, 10)), todatasubset(union(rule!get_persons_by_first_name(ri!search_text), rule!get_persons_by_last_name(ri!search_text), rule!get_persons_by_company_name(ri!search_text), rule!get_persons_by_email(ri!search_text)), a!pagingInfo(1, 10)))
if search_text is given, the resulting datasubset has identifiers range from 1 to 10 instead of the primary key values of the query data.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@skumar May I please know the version you are working on?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
skumar
over 9 years ago
7.9
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@skumar Probably you may try something as follows, not sure how it behaves as I didn't test:
if(
\tor(isnull(ri!search_text), len(trim(ri!search_text)) = 0),
\trule!get_all_persons(a!pagingInfo(1, 10)),
\twith(
\ tlocal!inititalResults:union(rule!get_persons_by_first_name(ri!search_text), rule!get_persons_by_last_name(ri!search_text), rule!get_persons_by_company_name(ri!search_text), rule!get_persons_by_email(ri!search_text)),\t
\ trule!get_persons_by_aid(local!inititalResults.aid,a!pagingInfo(1, 10))
\t)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
skumar
over 9 years ago
@sikhivahans Thanks a lot for the suggestion. It works
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
You can also define the datasubset entirely manually using a!dataSubset() - this gives you the opportunity to define your own identifiers.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel