Hi, has anyone been able to create a row action that opens a popup window that allows the user to add a Note to the corresponding row?
Shouldn’t be that hard, just create a model on the Note object, create a row action of type popup, and configure the popup to hold the note model. Set the condition as the row in context, and that should add it to the row that the user is working on. You’ll have to do a drop of trickery with the action framework to close the popup automatically, but this should be enough to get started.
Moshe is right, it shoudln’t be that hard. But it merits a more detailed explanation:
1. Create a model for capturing the new note.
- In Advanced Tab of model properties turn off both “create default row” and “Load Model data” properties.
- Fields should include Id, Title, Body
- Create a condition one field “ParentId” It should have no value, and be in state “Filterable Default Off”
**2. Add a Row Action on the table. **
- Action should be of type “Run Mutliple Actions”. The actions should be:
- Cancel Models (to remove unsaved notes that are in the page, most likely from situations where you started a note but decided to cancel with the popup “X”.
- Activate & Set value of Model Condition. Find the condition you created in 1 and pass it the “ID” field in the Value property.
- Create new row in Model - for the Notes model
- Show Popup.
**3. Configure your popup. **
- Add field editor on the notes model. You probably want the field editor in edit mode. Add the Title and Body fields.
- Look at the Context conditions. Add a condition where Id of record is the Id of the row in context.
A note about context conditions. Right now we automatically choose the last context that was created and establish this evnironment as what you are merging against. We are continuing to improve our context tools over time so that you can more specifically designate what context you want your condition to be evaluated against. In our case we started with the underlying table, but then we created a new row in the Notes model. This is now our context.
**4. Configure Save. **
Add a page title to the popup and give it a button. This button should be of type “Run Multiple Actions” The actions should be:
- Save Model - Save the Notes model
- Optional: Query Model. If the addition of your note will make a change to the underlying table, (like in a notes count rollup summary field) you can query the model for that underlying table so its view is refreshed.
- Close Popup.
And that should work…
Thanks Moshe and Rob, that works perfectly. I am going to replicate this for Adding Chatter and other items now as well !