TCA.vtssearchrow not returning data

trying to change the current TC.vtssearchrow to TCA.vtssearchrow.

original code

vtscolumns=TC.vtcSearchRow("p_UserNum","152666",",","068_VTS")

new code

vtscolumns=TCA.vtcSearchRow("p_UserNum","152666",",","068_VTS").then(function(vtscolumns){
 TCA.done(vtscolumns);
}).catch(function(error) {
 TCA.doneWithError(error);
});

the new command is returning [object Object] , the same as the original code

with the original code, I used this command to get the data into a string I can parse

vtsf = JSON.stringify(vtscolumns);

old code returns a string like 

{"p_Password":"12345","p_UserFirstName":"APerf","p_UserID":"APerfTester00001@xxx.com","p_UserLastName":"Tester00001","p_UserNum":"152666"}

the new TCA code returns {} ... which assume means the TCA.vtssearchrow is not returning a value.

How can I check the value in the TCA.done variable or the error variable.   they are not showing any values in the Inspector Panel when in Script Developer.

Thanks.

Tags:

Parents
  • 0

    the is the way I understand the documentation.   it says Returns the whole row values if the value of columns exist. For example: {col1:"a", col2:"b",col3:"c"}. Otherwise, it returns an empty value.

    then it goes further and says

    When using asynchronous APIs in places where a return value from evaluating JavaScript is needed, for example, in step argument fields, the return value must be returned by calling TCA.done(result) with the return value as the result argument.

    My assumption is the returned value would be the variable that is used in the TCA.done() statement which goes with the function() statement.  I am not seeing any value being passed in that variable.   Which is why I am asking for help.

  • 0   in reply to 

    You are right about the general statement in respect to the TCA functions, but the function documentation for the the function in question is different so it might be an exception...

    How to ask questions

    Reward contributions via likes or 'verified answers'

  • 0 in reply to   

    I did put a vtscolumns= in front of the statement and I am getting an object returned to this variable.   The problem is it appears to be empty as the json.stringify returns {}

  • 0   in reply to 

    According documentation you should use:

    vtscolumns=TCA.vtcSearchRow("p_UserNum","152666",",","068_VTS");

    because TCA.vtcSearchRow does not return a Promise....

    How to ask questions

    Reward contributions via likes or 'verified answers'

  • 0 in reply to   

    interesting.   so you only use the function part if you want a promise returned.

    I am 99% sure using the statement you recommended will work.   My VTS has been destroyed for the night, so I will test it again tomorrow and let you know the result.

    Thanks for all your help.

  • 0 in reply to 

    the vtscolumns=TCA.vtcSearchRow("p_UserNum","152666",",","068_VTS");  doesn't work

    Error:  Evaluate the JavaScript code timeout.  A timeout can occur if the TCA.done/TCA.doneWithError function is not called, an exception is thrown, or if code evaluation does not finish in time.  You can modify the timeout value using the EvalJavaScriptTimeout option in the default.cfg file.

    so it appears we do have to use the TCA.done statement

Reply
  • 0 in reply to 

    the vtscolumns=TCA.vtcSearchRow("p_UserNum","152666",",","068_VTS");  doesn't work

    Error:  Evaluate the JavaScript code timeout.  A timeout can occur if the TCA.done/TCA.doneWithError function is not called, an exception is thrown, or if code evaluation does not finish in time.  You can modify the timeout value using the EvalJavaScriptTimeout option in the default.cfg file.

    so it appears we do have to use the TCA.done statement

Children
  • 0   in reply to 

    Hi , That is a valid conclusion. I would raise an incident at LRP support and give also feed back on the documentation web site about the not correct description of the return value of the function.

    At which version of TC are you? I had once an issue with VTS and DevWeb and because the API was programmed in JS, I could solve it myself for the time being. You might have a look and identify the JS that is used with TC and have a closer look yourself.

    How to ask questions

    Reward contributions via likes or 'verified answers'