Quick summary of what I am trying to do:
I have two fields in my database (Script_Num and Script_Name). They are type numeric and character, respectively.
The database has a lookup set to Script_Num that changes the value of Script_Name depending on what numeric value is stored in Script_Num. For example, if Script_Num = 1, then Script_Name is changed via lookup to be a certain character value.
That has worked fine until I wrote a script that changed Script_Num from one value to another in batch (that's the code below). It seems that the update expression does to initiate the lookup to change the value of Script_Name based off the new value of Script_Num.
So in other words, the Script_Num lookup does not run on Script_Name if I batch change the values of Script_Num via update.
Is this just not how Alpha works or am I missing something here?
I have two fields in my database (Script_Num and Script_Name). They are type numeric and character, respectively.
The database has a lookup set to Script_Num that changes the value of Script_Name depending on what numeric value is stored in Script_Num. For example, if Script_Num = 1, then Script_Name is changed via lookup to be a certain character value.
That has worked fine until I wrote a script that changed Script_Num from one value to another in batch (that's the code below). It seems that the update expression does to initiate the lookup to change the value of Script_Name based off the new value of Script_Num.
So in other words, the Script_Num lookup does not run on Script_Name if I batch change the values of Script_Num via update.
Is this just not how Alpha works or am I missing something here?
Code:
this.Disable() dim s_num as C s_num=topparent:FIELD1.value tbl=table.open("pricelist") Query.filter="C_Price>0 .and. Script_num=0" Query.order="" Query.options="M" qry = tbl.query_create() nrecs = qry.records_get() IF (nrecs > 0) then update.fields = 1 update.field1 = "Script_num" update.expr1 = s_num 'update.expr1 = "'"+reason+"'" tbl.update() end if qry.drop() tbl.close() ui_msg_box("Warning",str(nrecs)+" records have been updated!",UI_OK) topparent.Close() Query.filter="" Query.order="" Query.options="" this.Enable()
Comment