NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: CaseyR on March 17, 2020, 01:22:12 PM

Title: API field override
Post by: CaseyR on March 17, 2020, 01:22:12 PM
Hi, Bruce

In the API WebService Method template, there is a function to override a field in the view return.  How does this work?  I see you can select a field but where do you put the override value?  Thanks
Title: Re: API field override
Post by: Wolfgang Orth on March 22, 2020, 07:19:09 AM
Casey,

I am not in my office righr now, so I have to guess a little.

Do I understand you correct, that you have a table and you want to return this as a view, but this view ought not to ave all fields of the original table, just a limited subset?

Ic ghis is the case, then have a look at the template dialogue, where you arm the VIEW. in my poor memory there is a tab, where you fan pick fields. If none is selected (default), then all fields will be sent. Select /deselect here for a try.

hth
Wolfgang
Title: Re: API field override
Post by: CaseyR on March 23, 2020, 12:40:18 PM
Thanks, Wolfgang, but no.

What I am trying to is replace the contents of a field in the table with something that will be meaningful to the programmer/user.  If necessary, I could simply load the table into a queue and add a queue field for the new content, but I thought the field override function might take care of the problem. Thanks again,
Title: Re: API field override
Post by: Bruce on March 24, 2020, 09:58:29 PM
content as in "format picture" or actual generated value?

cheers
Bruce
Title: Re: API field override
Post by: CaseyR on March 25, 2020, 12:26:09 PM
The content itself.  In this case, there are several fields in the table that need to be combined and manipulated to create a human readable value.

Thanks.
Title: Re: API field override
Post by: Bruce on April 06, 2020, 02:28:06 AM
That overrides tab is there for backward compatibility - the current way to list the fields is on the fields tab. So it's not the solution for what you want Casey.

Rather you can override the contents of the output in the
xml.SaveCurrentFieldToXML
and
json.FormatValue
methods.

cheers
Bruce