For data from a non business view table to GC fields in a headerless detail form.
Code should be written in "Get Custom Grid Row" Event of the grid.
And insert Grid buffer row system function should be used and buffer row must be inserted.
Example code is as below:
Do the necessary changes to it as required
CONTROL: GRID Grid
EVENT: Get Custom Grid Row
-----------------------------------------------------------------------
OPT: Using Defaults
0001 //
0002 VA frm_GetGridNumber_MATH01 = "0"
0003 If FC Project_V is not equal to <Null> And FC Phase_V is not equal to <Null>
0004 F44H201.Select
FC Project_V = TK Community
FC Phase_V = TK Phase
0005 Else
0006 If FC Project_V is not equal to <Null> And FC Block_V is not equal to <Null>
0007 F44H201.Select
FC Project_V = TK Community
FC Block_V = TK Homebuilder Block
0008 Else
0009 If FC Project_V is not equal to <Null> And FC From Level_V is not equal to <Null>
0010 F44H201.Select
FC Project_V = TK Community
FC From Level_V <= TK User Defined Amount 01
0011 Else
0012 If FC Project_V is not equal to <Null> And FC From Unit_V is not equal to <Null>
0013 F44H201.Select
FC Project_V = TK Community
FC From Unit_V <= TK Unit
0014 Else
0015 If FC Project_V is not equal to <Null> And FC Block_V is not equal to <Null> And FC Phase_V is not equal to <Null> And FC From Level_V is not equal to <Null> And FC From Unit_V is not equal to <Null>
0016 F44H201.Select
FC Project_V = TK Community
FC Phase_V = TK Phase
FC Block_V = TK Homebuilder Block
FC From Unit_V <= TK Unit
FC From Level_V <= TK User Defined Amount 01
0017 Else
0018 F44H201.Select
FC Project_V = TK Community
0019 End If
0020 End If
0021 End If
0022 End If
0023 End If
0024 //
0025 F44H201.Fetch Next
GB Project <- TK Community
GB Lot <- TK Lot Number
GB Phase <- TK Phase
GB Plan <- TK Plan Number
GB Elev <- TK Elevation
GB Block <- TK Homebuilder Block
GB Unit <- TK Unit
GB Amount 1 <- TK User Defined Amount 01
0026 While SV File_IO_Status is equal to CO SUCCESS
0027 VA frm_GetGridNumber_MATH01 = [VA frm_GetGridNumber_MATH01]+1
0028 //
0029 If FC From Unit_V is not equal to <Null> And FC To Unit_V is not equal to <Null>
0030 If GB Unit is greater than or equal to FC From Unit_V And GB Unit is less than or equal to FC To Unit_V
0031 //
0032 VA frm_Phase_CPHASE = " "
0033 F59H5202.Select
GB Project = TK Community
GB Unit = TK Unit
0034 F59H5202.Fetch Next
VA frm_Phase_CPHASE <- TK Phase
0035 //
0036 If VA frm_Phase_CPHASE is greater than <Blank>
0037 Delete Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0038 Else
0039 Insert Grid Buffer Row(FC Grid, VA frm_GetGridNumber_MATH01, <Yes>, <No>, <Yes>, <Yes>, <Yes>)
0040 End If
0041 //
0042 If FC From Level_V is not equal to <Null> And FC To Level_V is not equal to <Null>
0043 If GB Amount 1 is greater than or equal to FC From Level_V And GB Amount 1 is less than or equal to FC To Level_V
0044 Show Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0045 End If
0046 End If
0047 //
0048 Else
0049 Delete Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0050 End If
0051 Else
0052 F59H5202.Select
GB Project = TK Community
GB Unit = TK Unit
0053 F59H5202.Fetch Next
VA frm_Phase_CPHASE <- TK Phase
0054 //
0055 If VA frm_Phase_CPHASE is greater than <Blank>
0056 Delete Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0057 Else
0058 Insert Grid Buffer Row(FC Grid, VA frm_GetGridNumber_MATH01, <Yes>, <No>, <Yes>, <Yes>, <Yes>)
0059 End If
0060 End If
0061 //
0062 If FC From Level_V is not equal to <Null> And FC To Level_V is not equal to <Null> And FC From Unit_V is equal to <Null> And FC To Unit_V is equal to <Null>
0063 If GB Amount 1 is greater than or equal to FC From Level_V And GB Amount 1 is less than or equal to FC To Level_V
0064 Show Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0065 Else
0066 Hide Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0067 End If
0068 End If
0069 //
0070 F44H201.Fetch Next
GB Project <- TK Community
GB Lot <- TK Lot Number
GB Phase <- TK Phase
GB Plan <- TK Plan Number
GB Elev <- TK Elevation
GB Block <- TK Homebuilder Block
GB Unit <- TK Unit
GB Amount 1 <- TK User Defined Amount 01
0071 End While
0072 //
Code should be written in "Get Custom Grid Row" Event of the grid.
And insert Grid buffer row system function should be used and buffer row must be inserted.
Example code is as below:
Do the necessary changes to it as required
CONTROL: GRID Grid
EVENT: Get Custom Grid Row
-----------------------------------------------------------------------
OPT: Using Defaults
0001 //
0002 VA frm_GetGridNumber_MATH01 = "0"
0003 If FC Project_V is not equal to <Null> And FC Phase_V is not equal to <Null>
0004 F44H201.Select
FC Project_V = TK Community
FC Phase_V = TK Phase
0005 Else
0006 If FC Project_V is not equal to <Null> And FC Block_V is not equal to <Null>
0007 F44H201.Select
FC Project_V = TK Community
FC Block_V = TK Homebuilder Block
0008 Else
0009 If FC Project_V is not equal to <Null> And FC From Level_V is not equal to <Null>
0010 F44H201.Select
FC Project_V = TK Community
FC From Level_V <= TK User Defined Amount 01
0011 Else
0012 If FC Project_V is not equal to <Null> And FC From Unit_V is not equal to <Null>
0013 F44H201.Select
FC Project_V = TK Community
FC From Unit_V <= TK Unit
0014 Else
0015 If FC Project_V is not equal to <Null> And FC Block_V is not equal to <Null> And FC Phase_V is not equal to <Null> And FC From Level_V is not equal to <Null> And FC From Unit_V is not equal to <Null>
0016 F44H201.Select
FC Project_V = TK Community
FC Phase_V = TK Phase
FC Block_V = TK Homebuilder Block
FC From Unit_V <= TK Unit
FC From Level_V <= TK User Defined Amount 01
0017 Else
0018 F44H201.Select
FC Project_V = TK Community
0019 End If
0020 End If
0021 End If
0022 End If
0023 End If
0024 //
0025 F44H201.Fetch Next
GB Project <- TK Community
GB Lot <- TK Lot Number
GB Phase <- TK Phase
GB Plan <- TK Plan Number
GB Elev <- TK Elevation
GB Block <- TK Homebuilder Block
GB Unit <- TK Unit
GB Amount 1 <- TK User Defined Amount 01
0026 While SV File_IO_Status is equal to CO SUCCESS
0027 VA frm_GetGridNumber_MATH01 = [VA frm_GetGridNumber_MATH01]+1
0028 //
0029 If FC From Unit_V is not equal to <Null> And FC To Unit_V is not equal to <Null>
0030 If GB Unit is greater than or equal to FC From Unit_V And GB Unit is less than or equal to FC To Unit_V
0031 //
0032 VA frm_Phase_CPHASE = " "
0033 F59H5202.Select
GB Project = TK Community
GB Unit = TK Unit
0034 F59H5202.Fetch Next
VA frm_Phase_CPHASE <- TK Phase
0035 //
0036 If VA frm_Phase_CPHASE is greater than <Blank>
0037 Delete Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0038 Else
0039 Insert Grid Buffer Row(FC Grid, VA frm_GetGridNumber_MATH01, <Yes>, <No>, <Yes>, <Yes>, <Yes>)
0040 End If
0041 //
0042 If FC From Level_V is not equal to <Null> And FC To Level_V is not equal to <Null>
0043 If GB Amount 1 is greater than or equal to FC From Level_V And GB Amount 1 is less than or equal to FC To Level_V
0044 Show Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0045 End If
0046 End If
0047 //
0048 Else
0049 Delete Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0050 End If
0051 Else
0052 F59H5202.Select
GB Project = TK Community
GB Unit = TK Unit
0053 F59H5202.Fetch Next
VA frm_Phase_CPHASE <- TK Phase
0054 //
0055 If VA frm_Phase_CPHASE is greater than <Blank>
0056 Delete Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0057 Else
0058 Insert Grid Buffer Row(FC Grid, VA frm_GetGridNumber_MATH01, <Yes>, <No>, <Yes>, <Yes>, <Yes>)
0059 End If
0060 End If
0061 //
0062 If FC From Level_V is not equal to <Null> And FC To Level_V is not equal to <Null> And FC From Unit_V is equal to <Null> And FC To Unit_V is equal to <Null>
0063 If GB Amount 1 is greater than or equal to FC From Level_V And GB Amount 1 is less than or equal to FC To Level_V
0064 Show Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0065 Else
0066 Hide Grid Row(FC Grid, VA frm_GetGridNumber_MATH01)
0067 End If
0068 End If
0069 //
0070 F44H201.Fetch Next
GB Project <- TK Community
GB Lot <- TK Lot Number
GB Phase <- TK Phase
GB Plan <- TK Plan Number
GB Elev <- TK Elevation
GB Block <- TK Homebuilder Block
GB Unit <- TK Unit
GB Amount 1 <- TK User Defined Amount 01
0071 End While
0072 //
No comments:
Post a Comment