Company Layout...General
These items are a mix of settings and merge items:
!DELETEAFTER! | All text in the layout after this flag (including this text) will be removed. This is typically placed on the bottom of the layout, allowing you to input additional settings below this line, and the space that is replaced for these lines will never result in empty lines.
Suppose you do NOT use the !DELETEAFTER! text above a large # of settings at the bottom of your document, then you will notice that the vertical scrollbar for the document (if needed) will be unnecessarily tall.
| !PRESSLISTALL! | This is simply a setting: replaced with empty space upon use - turns on functionality for auto. pressing the 'List All' button in the Advanced Company Search dialog.!SQL=ENTERSQLHERE! | Replaced with the single-field results of the SQL command. Remember to use the '^COMPANY^' alias in the SQL to represent the selected company. So if you used this text in the layout:
!SQL=SELECT COUNT(*) FROM EVENTS WHERE COMPANY = '^COMPANY^'!
Then this text would be replaced with a count of all events in the system related to the currently selected company in the Advanced Company Search dialog.!SQL1=SQLHERE!
!SQL2=SQLHERE!
!SQL3=SQLHERE!
!SQL4=SQLHERE!
!SQL5=SQLHERE!
!SQL6=SQLHERE!
!SQL7=SQLHERE!
!SQL8=SQLHERE!
!SQL9=SQLHERE!
!SQL10=SQLHERE! | These are ten optional settings that will populate merge items !SQL1! - !SQL10! with the results of the matching SQL.
Here is an example - if you put the following text in your layout (typically, this is done after !DELETEAFTER! not to clutter the layout - but the text is always replaced with empty text either way):
!SQL2=SELECT COUNT(*) FROM REPAIRPARTSEVENTS WHERE EVENT_NUM = (SELECT TOP 1 EVENT_NUM FROM EVENTS WHERE COMPANY = '^COMPANY^' AND GAGE_SN = '^GAGE_SN^' AND EVENT_TYPE = 'ORDER PARTS' ORDER BY EVENT_NUM DESC)!
Then, when the layout is drawn, this SQL2 variable would be populated with a count of the # of parts ordered for the current asset in the most recent ORDER PARTS event. Then elsewhere in the layout, you could use the merged text below to display the value:
Awaiting # of Parts = !SQL2!
You can use this concept for up to 10 custom SQL commands per layout.!SQL1!
!SQL2!
!SQL3!
!SQL4!
!SQL5!
!SQL6!
!SQL7!
!SQL8!
!SQL9!
!SQL10! | These are merge-text items. See the description of !SQL1=SQLHERE! - !SQL10=SQLHERE! above.!IMAGENAMEFROMSQL=ENTERSQLHERE! | After the = the user must input SQL that returns a single text field/text. This text is used to look up a Global Variable from System-Wide Options (last tab) - IndySoft allows for images to be stored in this grid. If the variable is of image type, then the image is returned, and the image is drawn into the layout at the position of the merged text (overwriting the merged text).
An example of usage would be a company custom field with an image name for a common logo (that is used across many companies). So, the syntax in the Layout could be (at the point where you want the image to display):
!IMAGENAMEFROMSQL=SELECT CUSTOM1 FROM COMPANY WHERE COMPANY_NAME = '^COMPANY^'!
Where 'CUSTOM1' is the Company custom field where you are currently storing the name of the System-Wide Options Variable (that is an image). The text above is replaced with the image. | |