how to create custom formatters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2019 08:10 PM
Hi,
I've a table X which has 4 columns as- "case_id", "my_col1", "my_col2", "my_col3". "case_id" is a reference to incident table. I want to have a formatter on incident table such that it populates rows from table X corresponding to the incident.
What I've done so far: -
- I've created a UI Macro script which brings the rows of table X filtered on a hardcoded incident. I've previewed it and results coming are as expected.
- I've created a UI Formatter corresponding to the UI Macro above.
- I've configured the formatter to incident in form design.
Problems I'm facing: -
- I'm not seeing the results of formatter on incident table like we see for activity formatter.
- Once I start seeing the results for the current setup, I don't know how to pass the incident details dynamically to the Macro instead of hardcoding.
Regards,
-Rakshit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2019 08:16 PM
Hi AnswerIQ,
Please share screenshot of your UI Macro. But a few questions in mind, does the macro needs to be cached or not? this will translate to whether or not we need to run scripts in phase 2. You can access the current object in phase 2 like this $[current.sys_id]. What is the purpose of the macro? is it going to be a form user can fill out? or just to display data? etc..
Thanks,
Phuong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2019 03:41 AM
Hi Phuong,
Thank you very much for a prompt response.
Caching the macro is not an immediate necessity. I'm fine going ahead using whichever method is convenient.
I'll try $[current.sys_id] if that solves the purpose once I'm able to see the formatter results on incident table.
Purpose of the macro currently is display only.
I'll clean up the business logic and attach a screenshot of a simplistic macro.
Thanks,
-Rakshit