...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Create a Card View
- In the right portion of the Businesses dashboard create a new Form called: BusinessNotes
- Enter the Settings:
- Tick Auto Size
- Direction: Column
- Justify: Flex Start
- Align: Stretch
- Remove all other Position Settings
- Tick Prevent Dragging
- Open the configuration form for the stream BusinessNotes, and bring the new dashboard back to the front
- Drag the stream icon from the configuration form onto the BusinessNotes form, this automatically creates a Card View.
- Locate the Card View in the repository
- Set the Name to Notes
- Tick Use Custom Default Filter
- Next to the Default Filter click +
- Name: ByBusinessUID
- Filter Details
- BusinessUID equals Businesses.UID
- Click abc to let PhixFlow know this is a formula.
- Note that default filters can be removed by the user. If you use the Background Filter Rule this will be applied and not be accessible to the end user. The latter is available via the Background Filter Rule section, where a filter Rule can be added.
- Create Default Sort Order
- Tick Auto Size
- Remove all the Position Settings
- Tick Prevent Dragging
- Locate the Card in the repository, enter the settings:
- Untick Auto Size
- Direction: Column
- Justify: Flex Start
- Align: Stretch
- CSS Properties:
- maxHeight = 300px
- minHeight = 50px
- Remove all Position Settings
Configure the Card View Layout
- Drag an Area onto the Card (using shift to embed the area)
- Set the following for the Area:
- Name: NoteHolder
- Untick Auto Size
- CSS Properties:
- padding-left = 5px
- padding-right = 5px
- padding-bottom = 5px
- padding-top = 5px
- Remove all Position Settings
Top Portion of the Note
- Drag an Area ono the NoteHolder area and set the following:
- Name: NoteContent
- Untick Auto Size
- CSS Properties:
- border-bottom = 1px solid #9b9b9b
- Remove all Position Settings except Order and Tab Index
- Drag a Dynamic Text area onto NoteContent, with the following settings:
- Name: Note
- Untick Auto Size
- CSS Properties:
- padding-bottom = 5px
- Width: 100%
- Remove all other Position Settings except Order and Tab Index
Lower Portion of the Note
- Drag an Area ono the NoteHolder area and set the following:
- Name: NoteAudit
- Untick Auto Size
- Direction: Row
- Justify: Space Between
- Align: Center
- Remove all Position Settings except Order and Tab Index
- Drag a Dynamic Text field onto the area and set the following:
- Name: NoteByUser
- Drag a DateTime field onto the area and set the following:
- Name: NoteDate
- Type: Datetime
- Remove all Position Settings except Height, Order and Tab Index
Setup a Note Editing Dashboard
- Create a new Dashboard called BusinessNotesEditor
- Tick Always On Top
- Create a new Form called AddNoteForm
- Open the configuration form for the stream BusinessNotes, and bring the new dashboard back to the front
- Drag the attribute Note onto the dashboard and set the following:
- Tick Multi-Line
- Width: 100%
- Top: 0px
- Bottom: 45px
- Drag the attributes UID onto the dashboard and hide the field
- Drag the attribute BusinessUID onto the dashboard and hide the field
- This field will be used to associate the note to a specific business
- Drag an Area onto to the dashboard with the following settings:
- Name: AddNoteFooter
- Background-Colour: #9b9b9b
- Direction: Row
- Justify: Flex End
- Align: Center
- Width: 100%
- Height: 45px
- Bottom: 0px
- Tick Prevent Dragging
Setting Up Custom Actions
- Add a button, and set the following:
- Name: InsertNote
- Action Type: Insert
- Open the stream configuration for Notes
- Go to the Actions section
- Press + to add a new action
- In the action configuration form, enter the following settings:
- Name: AddNoteCustomAction
- Display Name: Add Note
- Context Parameters
- Tick Include Previous Context Parameters
- In the Stream Action Rule Items section use the following settings:
- Add Stream Action Rule using the + button
- Add a Stream Action using the + button
- Name: AddNoteAction
- Stream Item Action: Update
- Filter Type: Selected Items
- Tick Copy Values By Name
- Attributes to Update:
- NoteDate = now()
- Automatically sets the time to now.
- NoteByUser = _user.name
- Sets the note author to the current user.
- BusinessUID = _context.BusinessUID
- Sets the UID of the Business this note will be associated to. We will set this up later.
- Save Your changes
- NoteDate = now()
- Save your changes
- In the Action Completion: Tick Close Parent Dashboard
Copy Values by Name updates the underlying stream with values types into a form if the names of the fields match. All standard actions will do this. When you add a custom action to update or insert, it is important that you tick this, otherwise the form will not continue to work as it currently does, and you will not be able to easily as new fields as you have done so far.
- Update the button Label to Insert
- Drag the action from the stream configuration onto the button Add in your edit form
- Save the changes.
- Open the stream configuration for BusinessNotes
- Go to the Actions section
- Press + to add a new action
- In the action configuration form, enter the following settings:
- Name: OpenAddNote
- Display Name: +
- Context Parameters
- Click the + button
- Name: BusinessUID
- Expression: Businesses.UID
- This is constructed using the name of the element holding the information and the attribute name
- i.e. <<element>>.<<attribute name>>
- To find the element name, right click Show Element Details to obtain the name of an element.
- Save the changes
- Action Completion
- Tick Open Post Dashboard
- Select BusinessNotes
- Save the changes.
Building Note Actions
- Drag an Area onto the BusinessNotes Form and apply the following settings:
- Name NotesFooter
- Enter the Style Settings:
- Background-Colour: #9b9b9b
- Untick Auto Size
- Direction: Row
- Justify: Flex End
- Align: Center
- Height: 45px
- Remove all the other Position Settings
- Drag a Button onto the new area and apply the following settings:
- Name: OpenAddNote
- Action Type: General
- Action: OpenAddNote
- Width: 35px
- Set the Label value to +
Go into App Mode to see the effect of this change. When deleting a note use the tick box on the note to select the note to be deleted. Anchor _GoBack _GoBack