|
|
|
|
| New 4D Tech Note Posted |
 |
| This week's Technical Note that discusses the API calls and classes allowing for easy CSS manipulation is now available to 4D Partners.
Yesterday |
|
| Weekly Tech Tips Posted |
| The weekly tech tips for the week of May 5th have been posted to the 4D, Inc. Web site. Some of the subjects this week include "Caps Lock indicator displayed during activation," "Obtaining element references in JavaScript," and "How to make Fields searchable in a Data Grid."
Yesterday |
|
|
Submit Future News Archive  |
|
|
 |
|
|
| Sort Selection on a Field from a Related Table |
Submitted by Milan Adamov, YU Epicentar
The method below sorts the selection of the Many table based on a field from the One table. Method assumes that there is automatic many to one relation between two tables. If you have manual relation between them, you can activate automatic relations at the beginning of the method and turn them off at the end. For example, if you have a Longint field that links from [Invoices] to [Customers] and you want to sort the selection of [Invoices] by name of the customer you call this method as follows:
SORT_SortOnExternalTableField(->[Invoices]; ->[Customers]CustomerName)
` Method SORT_SortOnExternalTableField(Pointer;Pointer)
C_POINTER($1;$SortBaseTable_ptr;$2;$SortColumnField_ptr) C_LONGINT($3;$Direction_l;$FieldType_l) C_BOOLEAN($MakeSelection_b)
ARRAY LONGINT($RecNums_al;0) ARRAY TEXT($ToSort_at;0) ARRAY LONGINT($ToSort_al;0) ARRAY INTEGER($ToSort_ai;0) ARRAY REAL($ToSort_ar;0) ARRAY DATE($ToSort_ad;0) ARRAY BOOLEAN($ToSort_ab;0)
$SortBaseTable_ptr:=$1 $SortColumnField_ptr:=$2 If (Count parameters>2) $Direction_l:=$3 Else $Direction_l:=0 End if
$FieldType_l:=Type($SortColumnField_ptr->) $MakeSelection_b:=True
Case of : ($FieldType_l=Is Integer ) SELECTION TO ARRAY($SortBaseTable_ptr-> ;$RecNums_al;$SortColumnField_ptr-> ;$ToSort_ai) If ($Direction_l=0) SORT ARRAY($ToSort_ai;$RecNums_al;>) Else SORT ARRAY($ToSort_ai;$RecNums_al;<) End if : ($FieldType_l=Is LongInt ) | ($FieldType_l=Is Time ) SELECTION TO ARRAY($SortBaseTable_ptr-> ;$RecNums_al;$SortColumnField_ptr-> ;$ToSort_al) If ($Direction_l=0) SORT ARRAY($ToSort_al;$RecNums_al;>) Else SORT ARRAY($ToSort_al;$RecNums_al;<) End if : ($FieldType_l=Is Alpha Field ) | ($FieldType_l=Is Text ) SELECTION TO ARRAY($SortBaseTable_ptr-> ;$RecNums_al;$SortColumnField_ptr-> ;$ToSort_at) If ($Direction_l=0) SORT ARRAY($ToSort_at;$RecNums_al;>) Else SORT ARRAY($ToSort_at;$RecNums_al;<) End if : ($FieldType_l=Is Real ) SELECTION TO ARRAY($SortBaseTable_ptr-> ;$RecNums_al;$SortColumnField_ptr-> ;$ToSort_ar) If ($Direction_l=0) SORT ARRAY($ToSort_ar;$RecNums_al;>) Else SORT ARRAY($ToSort_ar;$RecNums_al;<) End if : ($FieldType_l=Is Date ) SELECTION TO ARRAY($SortBaseTable_ptr-> ;$RecNums_al;$SortColumnField_ptr-> ;$ToSort_ad) If ($Direction_l=0) SORT ARRAY($ToSort_ad;$RecNums_al;>) Else SORT ARRAY($ToSort_ad;$RecNums_al;<) End if : ($FieldType_l=Is Boolean ) SELECTION TO ARRAY($SortBaseTable_ptr-> ;$RecNums_al;$SortColumnField_ptr-> ;$ToSort_ab) If ($Direction_l=0) SORT ARRAY($ToSort_ab;$RecNums_al;>) Else SORT ARRAY($ToSort_ab;$RecNums_al;<) End if Else $MakeSelection_b:=False End case
If ($MakeSelection_b) CREATE SELECTION FROM ARRAY($SortBaseTable_ptr-> ;$RecNums_al) End if |
|
Submit a Tip Archive  |
|
|
 |
|
|
|
| eFax |
eFax is an online fax service that eliminates the need for a fax machine, an extra fax line and all the associated expenses (paper, ink cartridges etc.). Get a real fax number that's tied to your email. Send and receive faxes as email attachments. It's all the reliability and security of faxing with the ease and convenience of email. |
|
Suggest a Spotlight
|
|
|
 |
|