- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-14-2023 12:44 AM
Hello,
Please provide answers of below questions.
1.Will 'current' can be used in after BR?If no,what is the alternative?
2.What happens if we use g_form in BR
3.Using query BR and ACL we can restrict data which way you would prefer?why?
4.Can we use after BR instead of async BR
5.Advantages and Disadvantages of Business rules.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-14-2023 12:49 AM
Hi @Shaik22,
-
Will 'current' can be used after BR? If not, what is the alternative?
--Yes, you can use 'current' in Business Rules (BR). 'current' is a GlideRecord object that represents the current record being processed. It allows you to read and manipulate fields on the current record. If you're facing issues using 'current' in BR, it might be related to syntax or context. Using 'current' correctly can help you perform various actions on the current record. -
What happens if we use g_form in BR?
--'g_form' is typically used in client-side scripts (like Client Scripts or UI Policies) and not directly in Business Rules (which run on the server side). If you attempt to use 'g_form' in a Business Rule, it may not work as expected or may cause errors, because 'g_form' is meant to interact with the form on the client side. -
Using query BR and ACL, we can restrict data. Which way would you prefer and why?
--Both Query Business Rules and Access Control Lists (ACLs) serve different purposes. Query BRs are used to restrict the data that is queried from the database, whereas ACLs control access to records after they've been retrieved. If your primary concern is data security and ensuring users can only access the appropriate records, ACLs are a stronger choice. They're enforced at the platform level and apply to all access points (API, UI, etc.), providing a comprehensive security layer. Query BRs might be used to fine-tune queries, but they don't provide the same level of robust access control as ACLs. -
Can we use after BR instead of async BR?
--Yes, you can use an "after" Business Rule (BR) instead of an asynchronous (async) BR, but it's important to understand the implications. An "after" BR runs synchronously and can potentially impact the performance of the system if it performs resource-intensive operations. On the other hand, an async BR runs asynchronously in the background, minimizing immediate impact on the user experience. The choice depends on the specific use case and whether you need the action triggered by the BR to happen immediately or if it can be delayed without affecting user interaction. -
Advantages and Disadvantages of Business Rules: Advantages:
- Ease of Use: Business Rules are easy to create and manage, requiring minimal coding.
- Rapid Development: They allow for quick customization without significant development effort.
- No Compilation: Changes in Business Rules are immediately reflected without needing to compile or restart.
- Decoupled Logic: Business Rules help separate business logic from script includes and server-side scripts.
Disadvantages:
- Limited Complexity: For complex logic, Business Rules might be insufficient, and more advanced scripting might be needed.
- Performance Impact: Poorly designed Business Rules can impact system performance due to synchronous execution.
- Lack of Reusability: Unlike script includes, Business Rules are less reusable across multiple applications.
- Limited Error Handling: Business Rules have limited error-handling capabilities compared to scripts.
I hope this helps!
Regards,
Hemant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-14-2023 12:49 AM
Hi @Shaik22,
-
Will 'current' can be used after BR? If not, what is the alternative?
--Yes, you can use 'current' in Business Rules (BR). 'current' is a GlideRecord object that represents the current record being processed. It allows you to read and manipulate fields on the current record. If you're facing issues using 'current' in BR, it might be related to syntax or context. Using 'current' correctly can help you perform various actions on the current record. -
What happens if we use g_form in BR?
--'g_form' is typically used in client-side scripts (like Client Scripts or UI Policies) and not directly in Business Rules (which run on the server side). If you attempt to use 'g_form' in a Business Rule, it may not work as expected or may cause errors, because 'g_form' is meant to interact with the form on the client side. -
Using query BR and ACL, we can restrict data. Which way would you prefer and why?
--Both Query Business Rules and Access Control Lists (ACLs) serve different purposes. Query BRs are used to restrict the data that is queried from the database, whereas ACLs control access to records after they've been retrieved. If your primary concern is data security and ensuring users can only access the appropriate records, ACLs are a stronger choice. They're enforced at the platform level and apply to all access points (API, UI, etc.), providing a comprehensive security layer. Query BRs might be used to fine-tune queries, but they don't provide the same level of robust access control as ACLs. -
Can we use after BR instead of async BR?
--Yes, you can use an "after" Business Rule (BR) instead of an asynchronous (async) BR, but it's important to understand the implications. An "after" BR runs synchronously and can potentially impact the performance of the system if it performs resource-intensive operations. On the other hand, an async BR runs asynchronously in the background, minimizing immediate impact on the user experience. The choice depends on the specific use case and whether you need the action triggered by the BR to happen immediately or if it can be delayed without affecting user interaction. -
Advantages and Disadvantages of Business Rules: Advantages:
- Ease of Use: Business Rules are easy to create and manage, requiring minimal coding.
- Rapid Development: They allow for quick customization without significant development effort.
- No Compilation: Changes in Business Rules are immediately reflected without needing to compile or restart.
- Decoupled Logic: Business Rules help separate business logic from script includes and server-side scripts.
Disadvantages:
- Limited Complexity: For complex logic, Business Rules might be insufficient, and more advanced scripting might be needed.
- Performance Impact: Poorly designed Business Rules can impact system performance due to synchronous execution.
- Lack of Reusability: Unlike script includes, Business Rules are less reusable across multiple applications.
- Limited Error Handling: Business Rules have limited error-handling capabilities compared to scripts.
I hope this helps!
Regards,
Hemant

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-14-2023 01:16 AM
1. current object is available in after business rule. In fact current and previous both the objects are available on before and after business rules. However, only current object is available in case of an async business rule.
2. g_form is a client side object, you will get a run time error.
3. Though query BR can be used to filter the data for the logged in user, however prefer ACLs due to the performance reasons. Role based ACLs are executed much faster as compare to a query based BR. Also, the instance caches role based ACLs hence their performance is significantly better than a Query BR. Also, debugging an ACL is much easier than a query BR.
4. After BR can be used in place of async BR however, incase of a lengthy operation the user experience may get hampered in case of an after BR as the entire operation runs synchronously, whereas in case of the async BR the entire execution become asynchronous and hence the UI thread is not blocked.
5. There are many advantages of BRs as they allow various actions to be performed before/after inserting, updating, querying or deleting a record.
Disadvantage: To many BRs on a table can significantly slow the instance and may result in poor user experience.