Hello,
I added a custom column following items 1-4 in this link - http://www-304.ibm.com/support/docview.wss?uid=swg21500306 . The custom column shows up in the job monitor.
I can see the custom column populate while the task 'PageID' is running, but when this task is finished and goes to 'Profiler', the value in custom column is clear.
Any ideas?
I use Datacap 8.1 with FP1.
Answer by MoizQ (2966) | Aug 19, 2014 at 04:24 PM
I wouldn't advise using the direct database execution method that is listed there. Maybe there are a few scenarios where it may be applicable, but in general there's risk that the client executing the actions may overwrite your changes ultimately anyway because of the pilot state properties being written out. Use the XtraBatchFieldValue property available from the PilotCtrl object; in a standard RRX (VBScript) based action the 'Pilot' object is predefined for you; in case of C# there may be more work required to create & initialize a class instance for consumption (I haven't done it in a while / don't have an example but some older forum topic probably has details or it may be obvious within the general actions template).
Answer by FernandoVeloso (0) | Aug 19, 2014 at 05:48 PM
Thanks MoizQ.
I created a custom action with XtraBatchFieldValue property and custom column remains filled when datacap changes the task.
Below follows my custom action:
public bool SetCustomColumnValue(string StrColumnName, string StrColumnValue) { int l_iValidationFailedStatus = 1; int l_iValidationPassedStatus = 0;
object CurrentObj = CurrentDCO;
string smartParamValue = "";
SmartObj.DatacapRRDCO = DCO;
SmartObj.DatacapRRLog = RRLog;
SmartObj.SetRRCurrentDCO(CurrentObj);
SmartObj.DatacapRRBatchPilot = this.BatchPilot;
SmartObj.DatacapRRState = RRState;
smartParamValue = SmartObj.MetaWord(StrColumnValue);
try
{
if (smartParamValue.Trim().Length > 0)
{
DatacapRRBatchPilot.set_XtraBatchFieldValue(StrColumnName, smartParamValue);
WriteLog("StrColumnName=" + StrColumnName);
WriteLog("smartParamValue=" + smartParamValue);
WriteLog("Task success!");
CurrentDCO.Status = l_iValidationPassedStatus;
return true;
}
else
{
WriteLog("Task failed: value cannot be empty.");
CurrentDCO.Status = l_iValidationFailedStatus;
return false;
}
}
catch (Exception e)
{
WriteLog("Exception encountered: " + e.Message);
CurrentDCO.Status = l_iValidationFailedStatus;
return false;
}
}