- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 01:11 AM - edited 07-25-2023 12:45 PM
Hi,
I need help with getting the "parent" data/values (aka Form data controller) from within a page collection.
So this is for a shared "tab" between experiences that needs to get the data from the parent it's coming from.
Already tried: data.gform.nowRecordformBlob.table / sys_id, but this only seems to work within viewports and not within page collections.
Also tried adding URL parameters (after) I created it in the sys_ux_app_route, which crashed the page funny enough.
Does anybody have an idea on this?
@Brad Tilton You mentioned already you knew a solution for this 🙂
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 12:43 PM - edited 07-26-2023 07:33 AM
Alright managed to find it, not sure why it didn't work before.
Let me also make a short tutorial for it for other people!
Step 1
Make sure you are using the latest "record" default template.
You can tell by going to the Data Sources and check the form controller:
Old ID is called "gform", new ID is called "record"
Old:
New:
If you still have the old one, add a new page variant and select it from template (select the latest one).
*I know both standard record and CSM default record has the new controller
Step 2
Create your page collection
Goto your newly created record page, select the "Tab sidebar"
+ Add a new tab
Select "Add a page collection", and click "Next"
And click "Create collection"
This will send you to the backend specifically "sys_ux_extension_point" table.
Click "New"
Name: Up to you
Component: Tabs
App shell: UXR Base Experience Shell (Default)
Controller: Form
Go ahead and just click "Submit"
*Just leave the page open we will change the icon in a later state.
Step 3
Go back to the UI Builder, "Refresh list"
And go ahead select your create Page collection and press "Continue"
Step 4
Let's add a tab page to actually show up within the tab.
Click on your "Page collection", and select the button "Edit Content"
This will now open a new UI Builder Tab.
Within the "Page collection" add a new page. "Create new Page"
The name is also used for the "Tab" name itself.
Step 5
Access the form controller data
Within the Data resources you will now see the "Inherited data resource instances" > Form
It's called "controller", for my example I've simply just used a "stylized text" to show the parent sys_id.
Simply just call them by @Data.controller.sysId and @Data.controller.table
On the page collection the "Test values" are the parent values given as an example in the controller.
Click "Save"
Step 6
Add an icon to the tab!
First go back to the tab you left open, or open the sys_ux_extension_point table.
Click your page collection open, now in the bottom you have a related list called "UX App Routes"
There is a column called "Icon", fill in the icon you want for your tab.
These can easily be found by using the "icon" component, and simply doing everything lowercase with "-"
In my case it going to be "ai-sparkle-fill"
AND voilà
Bonus step
Setting up Context props
Usually what I'd like to do is actually setting this up with the @context.props
Goto the Body on your content tree, and select "config" on the configuration pane
Click "Edit"
Click "+ Add" next to properties
Fill in Property name: parentTable (or whatever you like to name it)
Click "Add"
Click once more on "+ Add"
Property name: parentSysId
Click "Add"
Then "Save"
Now within the properties fill in the @Data.controller, for me it didn't auto fill. But you can simply add them.
After this you can now simply call them with @context.props.parentSysId and @context.props.parentTable
Hope this helps anybody that came across this!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 12:28 AM
Did you add the latest record page first ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 01:23 PM
@Wybren1,
Yes, we verified that we were using the latest record default template as per step 1 in your guide. Still stuck even after trying David's suggestion below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 04:06 AM
Just as ideas - have you cleared cache (via cache.do) - also worth closing your browser tab and reloading. I have found certain UX Experience features do not work on initial creation and a clear down often gets things to "spring into life".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 04:44 AM
@Johnny32 hi
I'm banging my head on the same wall, but have just managed to get parent properties showing in my Page Collection Page.
My suspicion is that there may be a version issue here and suspect the "Standard Record Page" (SRP) has changed between SN version - and with it the Data Resources (types/names) embedded in it.
In the example app I am looking at (an SN App installed in my instance), this has two Data Resources "Record (record)" and "UI Controller Record Page (rpCtrl)"
Whereas the SRP I created (in Utah) has an "Agent Assist Search Prefetch 1" and a "Form Controller (record).
For my environment I had to set the "Controller" field on the "UX Extension Point" to "Form" - as this is the parent controller we need to propagate.
With that in place the Page with the Page Controller is now - because the "Form" Data Resource in there is called "controller" - able to reference "@data.controller.table".
So I think you may need to check the Data Resources in the SRP you created - select the appropriate "Controller" - as "Form" OR "UI Controller Record Page" - on the Page Collection Extension Point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 01:48 PM
Thanks for your response. When you say you had to set the "Controller" field on the "UX Extension Point" to "Form", did you mean you update the UX Extension Point that you created on step 2 of Wybren1's guide, or did you update a different UX Extension point record?
After following Wybren1's guide, the 'Controller' field was already set to 'Form' on my UX Extension Point.