Hi all,
I want to add an “ADD” button beside the “Photo” entity (screenshot-1) which will be able to take 1 to 7 (multiple) pictures and the pictures will view in the one after another like a Grid view.
How can I do this? Kindly help. (Details in the screenshot)
Thanks
Solved! Go to Solution.
Regarding the community members, here is the solution:
STEP-1 :: READ-ONLY SLICE
A slice is created with READ_ONLY attribute from the Photos Table. Nothing special, no conditional rules, all columns selected. The slice is named as slice_Photos.
STEP-2 :: PRODUCT REVERSE-REF COLUMN
[Product] ref column in Photos table is set as isPartOf to show this column as a reverse reference in Product_Form
STEP-3 :: VIRTUAL REF COLUMN
In Product table a ref type Virtual Column is created with below expression. This column is named as Limited Photos.
REF_ROWS("slice_Photos", "Product")
STEP-4 :: SHOW_IF CONDITION
[Related Photos]
COUNT([Related Photos])<7
[Limited Photos]
COUNT([Related Photos])=7
STEP-5 :: INLINE VIEW
System generated Photos_Inline UX view has been copied, renamed as slice_Photos_Inline and Data set to slice_Photos
STEP-6 :: PHOTOS FORM
Photos_Form is set to Auto Save and Auto Re-Open
STEP-7 :: PHOTO VALIDATION*
A Valid_If condition is set for Photos Table, [Photo] column along with a custom error message to prevent addition of more than 7 photos.:
Valid_If
COUNT([Product].[Related Photos])<7
Invalid Value Error
"Max. 7 photos can be added!"
FINAL RESULT
Add button is disabled/removed when there’s 7 child records for the parent table
User | Count |
---|---|
15 | |
9 | |
9 | |
7 | |
3 |