Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== Tips and Tricks ====== <accordion id="howto" collapsed="true"> <panel type="primary" title="How to search for multiple objects"> Sometimes you may need to search for instances of different business object based on the values of attributes common to all of them. For example, let us assume you have defined ''SavingAccount'' and ''CreditAccount'' objects. Both objects contain different attributes and yet both of them have the Balance attribute defined. Suppose you want to find all accounts (saving and credit) with the balance greater than 1000 dollars. The solution is to add both objects to a business group (called ''Account'', for example) – see the “[[docs:2500_config_apps:1000_add_edit_bogs|Adding/Editing Business Object Groups]]” section – and define a query that will look for the business object group rather than an individual business object (see the “[[docs:2500_config_apps:1100_add_edit_queries|Adding/Editing Queries]]” section). </panel> <panel type="primary" title="What to do if an object can be related to multiple objects"> Sometimes when you define relationships between business objects you may want to establish a relationship with different business object through the same reference attribute. For example, let us assume that you are defining an ''Account'' object and you want to establish a relationship between the account and its transactions by defining the ''MyTransactions'' reference attribute. However, you have several business objects that represent transactions – ''WithdrawalTransaction'' and ''DepositTransaction''. These transactions have some different attributes and some common attributes (for example ''Amount''). The solution is to add different objects representing transactions into a business object group (called ''Transaction'', for example) - see the “[[docs:2500_config_apps:1000_add_edit_bogs|Adding/Editing Business Object Groups]]” section – and get the reference attribute to refer to a business object group rather than the individual business object (see the “[[docs:2500_config_apps:0700_add_edit_attributes:0500_ref_attrib|Setting Properties of Reference Attributes]]” section). </panel> <panel type="primary" title="How to display currency symbol"> If some attribute of a business object represents currency, then you may want to display the value of the attribute with the currency symbol in front of the value – for example, $400. To do this define the attribute to be of the Number type and add the currency symbol to the format of the number – for example, “$#” - see “[[docs:2500_config_apps:0700_add_edit_attributes:0300_number_attributes|Attributes of Number Type]]”, [[docs:8000_appendices:0300_number_format_java|Appendix C]]. The value of the attribute will be displayed with the currency symbol on all forms. If you want to display the currency symbol only in certain reports or presentations, you should not change the format of the attribute, but instead include the currency symbol inside the tags of the reports or presentations, for example: <code aim><<Account.Balance, $#.00>> </code> </panel> <panel type="primary" title="How to generate unique ID for the attribute"> In many cases it is necessary to have a number uniquely identifying business elements, such as customer number, order number, account number, etc. If you have no particular requirements on the numbering of your objects you can simply use the ID attribute. If you need to control the numbering of your business objects you will need to configure the attribute for this purpose of the Number type and mark it as “auto-incremented” </panel> <panel type="primary" title="How to compare strings ignoring case"> Use ''[[a_f:f:af:to_lower_case|TO_LOWER_CASE]]'' or ''[[a_f:f:af:to_upper_case|TO_UPPER_CASE]]'' functions to convert both strings to upper or lower case and then compare them. See also the “[[a_f:f:60_txt|Text Functions]]” section. </panel> </accordion> Log In