DSP Truncate

Hi, I have 2 questions:

1)how can I truncate a string in DSP or template?

2)I have 5 elements in the document. I want to check if document type is null or not in DSP. I used %ifvar documentName -isnull% or %ifvar documentName -notempty% but in some cases, it is giving the result
and in some cases, giving opposite result.

Thanks

Truncating via javascript works for me in DSP’s:
StringA = StringB(Start_Pos, End_pos);

Field presence checking that i have used:
%ifvar operation exists%

Truncating via javascript works for me in DSP’s:
StringA = StringB.substring(Start_Pos, End_pos);

Field presence checking that i have used:
%ifvar operation exists%

On the truncation issue: you could also just write a wrapper service around the service you were wishing to invoke which performed the truncation.

There’s also the (messy) option to invoke a service in your DSP for each thing you want to truncate, though that would get very messy, very quickly.

My option would be to create a wrapper service that was just for the UI invocation of your service. Should simplify your DSP too.

Nath

Improve the quality of your services with WmUnit
Unit testing solution for webMethods
[url=“http://www.customware.net/wmunit”]http://www.customware.net/wmunit[/url]