Batch Insert - Syntax for field (Before insert, remove records that meet the following conditions)
I'm trying to figure out the syntax for the conditional removal field in Batch Insert (for SQL Database) - the "Before insert, remove records that meet the following conditions".
I want to remove all records from a given Business Unit that the user selects on the form (and I save out to a variable). I tried variable = SQL field (${/pd:AP/pd:processFields/pd:var_BU_Filter} = Business_Unit), but no activity happens in the table (no insert, edit, delete) when I run the process. So, I'm assuming I'm doing something wrong. If I leave it blank, it functions as i would expect, so the only thing messing up is this condition statement.
Thanks!

-
Gwen,
I think the left side of the condition should be a table column name for comparison.
Here it seems like you have both values
(${/pd:AP/pd:processFields/pd:var_BU_Filter} = Business_Unit) .Help document: https://documentation.agilepoint.com/00/appbuilder/cloudenvShapeBatchInsert.html

Thanks
AgilePoint NX Support
-
I too have the same/similar issue. I would like to use "BATCH INSERT" to delete the old records with a matching "WORKFLOW_NO" before inserting the updated data. However, I too do not know the syntax for the "Remove All Old Records" input box. The doc link provided by "AgilePoint NX Support" is not helpful, as it does not have an example of the syntax.
Experimenting I found that [ WORKFLOW_NO = '123456' ] works, but only for deleting records with WORKFLOW_NO set to '123456'. When I try to use [ WORKFLOW_NO = '${/pd:AP/pd:processFields/pd:WorkflowNo}' ] to read the workflow number from the "parent form", the deletes do not happen. I am guessing that this input does not do the replacement of '${/pd:AP/pd:processFields/pd:WorkflowNo}' with the field value. Rather, the text is taken literally, and since there are no records with WORKFLOW_NO set to literal '${/pd:AP/pd:processFields/pd:WorkflowNo}', nothing is deleted before the insert.
Is what I am trying to do not possible with "BATCH INSERT"?
-
To work around this, I ended up using a "DELETE RECORD" activity just before the "BATCH INSERT" activity. The "DELETE RECORD" activity does support using [ WORKFLOW_NO = '${/pd:AP/ ... /pd:WORKFLOW_NO}' ] to delete only the records with the same WORKFLOW_NO as the "parent table".
I would still like to know if this is possible, using only a "BATCH INSERT" activity.
请先登录再写评论。
评论
3 条评论