NetTalk Central

Author Topic: Computed field in NetWebServiceMethod  (Read 3396 times)

jlavera

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Computed field in NetWebServiceMethod
« on: October 08, 2019, 01:30:24 AM »
I have a NetWebServiceMethod that delivers json packets.  In the "Return" tab, i have a View that includes several fields of a file. I need for one of those fields to have a calculated value, in the form "IF thisfield = '' THEN  thisfield = thisOtherfield.".
I cannot find where to put the calculation! No matter where I do this, the final value delivered is not changed.
I tried changing the queue value, for example
        IF q:App_CliDocs.CDoc_DocDescription = '' THEN
          q:App_CliDocs.CDoc_DocDescription = q:App_CliDocs.CDoc_DocOriginalName
        END
        PUT(q:App_CliDocs)
But it also doesn't work.
Is there a specific procedure, routine or embed where this SHOULD be like this, for it to work? Sounds like i'm missing something.

Kind regards,

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Computed field in NetWebServiceMethod
« Reply #1 on: October 09, 2019, 03:02:10 AM »
Hi Jorge,

If you are returning a View, then you can't have computed fields directly in the View, because that's not how Views work.

It sounds to me like you need to create a Queue, and put the data you want to return into the Queue, then set the Return field to be that Queue.

It's possible that in the future I could add functionality to jFiles and xFiles so there's an embed point for injecting nodes into the View export, but that's not on the immediate horizon.

>> I tried changing the queue value

that queue is not used for Returns. It's used for incoming Table Parameters. You will need to make your own output queue.

cheers
Bruce




jlavera

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Computed field in NetWebServiceMethod
« Reply #2 on: October 09, 2019, 07:25:23 AM »
Ok, thank you Bruce.