Help creating table rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 10:42 AM
I want to create some fields in a table but I can't understand its rule with certain date fields, example: I created a table and incorporated the Task table, which already comes with the State, Opened and Closed fields and these fields already have a rule between them, if the state is open, the Opened field marks the date and time when it was made, same thing in Closed when the state is closed.
But how do I make this rule from scratch? If I create a table from scratch it will only have the standard fields, how would I put this rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 11:05 AM - edited 04-16-2024 11:30 PM
Hi @Arthur Sanchez ,
- Whenever you create a new table, six fields are automatically generated: sys_id, created, created by, updated by etc
- If you extend an existing table (like the task table with fields like state, assigned to, and priority), all these fields will be inherited by the new table.
- To modify the behavior of inherited fields, you can use a dictionary override.
- For other customizations, ServiceNow offers various components:
- Business rules
- Client scripts
- Flows
- If you're not extending an existing table, only the six system-generated fields will be present. Any additional fields and flows must be configured manually.
References:
- Table extension and classes: https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/table-admini...
- Extending tables: https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/table-admini... (This link seems to cover the same topic as the previous one. You might want to pick just one.)
- Dictionary overrides: https://docs.servicenow.com/bundle/washingtondc-application-development/page/administer/data-diction...
- Default fields: https://docs.servicenow.com/bundle/washingtondc-customer-service-management/page/product/customer-se... (This link talks about default values, not creating new fields. You might consider removing it.)
- Business rules: https://developer.servicenow.com/dev.do#!/learn/courses/utah/app_store_learnv2_scripting_utah_script...
- Client scripts: https://docs.servicenow.com/bundle/washingtondc-application-development/page/script/client-scripts/c...
- Flow designer: https://docs.servicenow.com/bundle/washingtondc-build-workflows/page/administer/flow-designer/concep...
If my reply helped with your issue please mark helpful 👍 and correct ✔️ if your issue is resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 07:16 PM
Hi @Arthur Sanchez ,
If my reply helped with your issue please mark helpful 👍 and correct ✔️ if your issue is resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 10:34 AM
But my question is more about the logic and definition of dates If you view the task table, the State fields will be automatically connected with the opened, opened by and closed, closed by fields, both are date fields linked with the State
My question is how I could make this same ZERO relationship with new fields created by hand Example, I create a table without changing the task table, and create the fields:
STATUS, Close, Open
How would I list the choices made in the states field to place the Date and time in the Close and Open fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 12:17 AM - edited 04-18-2024 12:47 AM
Hi ,
These functionality works with business rule -
For closed and closed by -When closing an open task, both Business rules named 'mark_resolved' and 'mark_closed' are being executed. As a result the 'Resolved' and 'Resolved by' fields + the 'Closed' and 'Closed by' fields are being updated respectively if they are empty.
While the business rules for "mark_resolved" and "mark_closed" are documented and clearly update the "Resolved" and "Closed by" fields respectively, I haven't found any documentation for similar functionality regarding "opened" and "opened by" fields. However, I assume they are likely updated in the same way.
If my reply helped with your issue please mark helpful 👍 and correct ✔️ if your issue is resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik