05-17-2013 07:47 AM
I'm trying to add a GoTo step in a sequence file using the API commands and am having trouble. I have the unique ID from the step I'm trying to goto, but when I run my code, it always throws an error message "Unknown Variable or Property Name" plus the unique ID of the step I want to goto. The code I'm using to generate the step I want to goto is :
stepTemp.AsPropertyObject().SetValString(strTempData[2], 0, strTempData[2]);
Is there something wrong with my assignment? Also when I was debugging, I notice when I get the unique ID, it always starts with "ID#:" followed by the ID. Do I need to strip this off before assigning?
Thanks.
05-20-2013 09:36 AM - edited 05-20-2013 09:39 AM
You can change settings with lower level PropertyObject API calls, but something more like the following would be better:
step.CustomActionExpression = "True";
step.CustomTrueAction = PostActionValues.PostAction_GotoStep;
step.CustomTrueActionTargetByExpr = "\"" + idString + "\"";
If your step is a Goto step only the last line is needed. If your step is some other kind of step you can add goto behavior to it by using all 3 lines.
-Doug