Heres the script i wrote to do my monthly imports from the import table to the usecost table. This is also imcuded in a text flie in the zip file with the 2 tables in question.
'Date Created: 25-Jun-2004 05:15:19 PM
'Last Updated: 25-Jun-2004 05:15:19 PM
'Created By : Administrator
'Updated By : Administrator
dim quotefield as c
dim usagefield as c
dim costfield as c
dim master as p
on error goto Error_Handler
monthselect="Aug"
IF monthselect="Jan" THEN
quotefield="Jan_Cost"
usagefield="Jan_Usage"
Costfield="Jan_Cost"
ELSE
IF monthselect="Feb" THEN
quotefield="Feb_Cost"
usagefield="Feb_Usage"
Costfield="Feb_Cost"
ELSE
IF monthselect="Mar" THEN
quotefield="Mar_Cost"
usagefield="Mar_Usage"
Costfield="Mar_Cost"
ELSE
IF monthselect="Apr" THEN
quotefield="Apr_Cost"
usagefield="Apr_Usage"
Costfield="Apr_Cost"
ELSE
IF monthselect="May" THEN
quotefield="May_Cost"
usagefield="May_Usage"
Costfield="May_Cost"
ELSE
IF monthselect="Jun" THEN
quotefield="Jun_Cost"
usagefield="Jun_Usage"
Costfield="Jun_Cost"
ELSE
IF monthselect="July" THEN
quotefield="July_Cost"
usagefield="July_Usage"
Costfield="July_Cost"
ELSE
IF monthselect="Aug" THEN
quotefield="Aug__Cost"
usagefield="Aug__Usage"
Costfield="Aug__Cost"
ELSE
IF monthselect="Sept" THEN
quotefield="Sept_Cost"
usagefield="Sept_Usage"
Costfield="Sept_Cost"
ELSE
IF monthselect="Oct" THEN
quotefield="Oct_Cost"
usagefield="Oct_Usage"
Costfield="Oct_Cost"
ELSE
IF monthselect="Nov" THEN
quotefield="Nov_Cost"
usagefield="Nov_Usage"
Costfield="Nov_Cost"
ELSE
IF monthselect="Dec" THEN
quotefield="Dec_Cost"
usagefield="Dec_Usage"
Costfield="Dec_Cost"
ELSE
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
master=table.open("usecost")
post.t_db = "import"
post.m_key = "CUSTOMER_ID-DISTRIBUTED_ITEM_CODE-DISTRIBUTOR"
post.t_key = "str(CUSTOMER_N,10,0)-ITEMNUMBER-DISTRIBUTO"
post.m_filter = ""
post.t_filter = ""
post.m_count = 3
post.m_field1 = quotefield
post.m_exp1 = "@Import-"Month_Quote"
post.m_field2 = usagefield
post.m_exp2 = "@Import-"Month_Use"
post.m_field3 = costfield
post.m_exp3 = "@Import-"Month_Cost"
post.t_count = 0
master.post()
master.close()'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
error_handler:
ui_msg_box("Error","The following error occured. " + crlf(1)+error_text_get(error_code_get())+crlf() \
+ "On Line: "+error_line_number_get())
master.close()
stop
i get the blue bars at the bottom like it's working... the number 250 comes up down there and then i start to get my errors. Take a look please and see what i missed.. i know it's something dumb on my side... just need a fresh set of eyes and maybe a brain transplant!
Thanks in advance
'Date Created: 25-Jun-2004 05:15:19 PM
'Last Updated: 25-Jun-2004 05:15:19 PM
'Created By : Administrator
'Updated By : Administrator
dim quotefield as c
dim usagefield as c
dim costfield as c
dim master as p
on error goto Error_Handler
monthselect="Aug"
IF monthselect="Jan" THEN
quotefield="Jan_Cost"
usagefield="Jan_Usage"
Costfield="Jan_Cost"
ELSE
IF monthselect="Feb" THEN
quotefield="Feb_Cost"
usagefield="Feb_Usage"
Costfield="Feb_Cost"
ELSE
IF monthselect="Mar" THEN
quotefield="Mar_Cost"
usagefield="Mar_Usage"
Costfield="Mar_Cost"
ELSE
IF monthselect="Apr" THEN
quotefield="Apr_Cost"
usagefield="Apr_Usage"
Costfield="Apr_Cost"
ELSE
IF monthselect="May" THEN
quotefield="May_Cost"
usagefield="May_Usage"
Costfield="May_Cost"
ELSE
IF monthselect="Jun" THEN
quotefield="Jun_Cost"
usagefield="Jun_Usage"
Costfield="Jun_Cost"
ELSE
IF monthselect="July" THEN
quotefield="July_Cost"
usagefield="July_Usage"
Costfield="July_Cost"
ELSE
IF monthselect="Aug" THEN
quotefield="Aug__Cost"
usagefield="Aug__Usage"
Costfield="Aug__Cost"
ELSE
IF monthselect="Sept" THEN
quotefield="Sept_Cost"
usagefield="Sept_Usage"
Costfield="Sept_Cost"
ELSE
IF monthselect="Oct" THEN
quotefield="Oct_Cost"
usagefield="Oct_Usage"
Costfield="Oct_Cost"
ELSE
IF monthselect="Nov" THEN
quotefield="Nov_Cost"
usagefield="Nov_Usage"
Costfield="Nov_Cost"
ELSE
IF monthselect="Dec" THEN
quotefield="Dec_Cost"
usagefield="Dec_Usage"
Costfield="Dec_Cost"
ELSE
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
master=table.open("usecost")
post.t_db = "import"
post.m_key = "CUSTOMER_ID-DISTRIBUTED_ITEM_CODE-DISTRIBUTOR"
post.t_key = "str(CUSTOMER_N,10,0)-ITEMNUMBER-DISTRIBUTO"
post.m_filter = ""
post.t_filter = ""
post.m_count = 3
post.m_field1 = quotefield
post.m_exp1 = "@Import-"Month_Quote"
post.m_field2 = usagefield
post.m_exp2 = "@Import-"Month_Use"
post.m_field3 = costfield
post.m_exp3 = "@Import-"Month_Cost"
post.t_count = 0
master.post()
master.close()'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
error_handler:
ui_msg_box("Error","The following error occured. " + crlf(1)+error_text_get(error_code_get())+crlf() \
+ "On Line: "+error_line_number_get())
master.close()
stop
i get the blue bars at the bottom like it's working... the number 250 comes up down there and then i start to get my errors. Take a look please and see what i missed.. i know it's something dumb on my side... just need a fresh set of eyes and maybe a brain transplant!
Thanks in advance
Comment