public IOptionObject2015 Execute()
        {
            logger.Debug("Executing SetFieldValueCommand");
            string fieldNumber = _parameter.GetString(1);

            if (_optionObject.IsFieldPresent(fieldNumber))
            {
                _optionObject.SetFieldValue(fieldNumber, "Set by ScriptLink API.");
            }
            return(_optionObject.ToOptionObject2015());
        }
Exemplo n.º 2
0
        public IOptionObject2015 Execute()
        {
            string fieldNumber = _parameter.Count() >= 2 ? _parameter.ToList()[1] : "";

            if (_optionObject.IsFieldPresent(fieldNumber))
            {
                string fieldValue = _optionObject.GetFieldValue(fieldNumber);
                if (string.IsNullOrEmpty(fieldValue))
                {
                    fieldValue = "I have set the FieldValue.";
                }
                else
                {
                    fieldValue += " (I have appended the FieldValue.)";
                }
                _optionObject.SetFieldValue(fieldNumber, fieldValue);
            }
            return(_optionObject.ToReturnOptionObject(ErrorCode.Success, "If FieldNumber '" + fieldNumber + "' is found in OptionObject, then it should be the only FieldObject returned. Otherwise, no Forms should be returned."));
        }