Trying to write rules in InfoPath but get a error messages - InfoPath Dev
in

InfoPath Dev

Trying to write rules in InfoPath but get a error messages

Last post 12-20-2011 08:56 PM by yyc2001. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-19-2011 02:13 PM

    Trying to write rules in InfoPath but get a error messages

    In my InfoPath form I have a field name called: "Description". Now I added another field called: "SummaryDescription". Which is suppose to take the first 200 words from the Description field.

    The rules I wrote for "SummaryDescription" is (this rule will apply only if "SummaryDescription" is blank):

    If the length of the "Description" is less than or equal to 200 then it will pull out all the content in "Description" to "SummaryDescription" Else it will pull out only the first 201 words in "Description" to "SummaryDescription".

    This is my code for this:

    substring(../my:Description, 0, (((string-length(../my:Description)) | number(201))[(((string-length(../my:Description))) <= 200) + 1] ))

    But I keep getting this kind of error message:

    Expression must evaluate to a node-set.

    substring(../my:Description, 0, ((-->(string-length(../my:Description))

    I'm not too sure how to solve it. I'm I missing something in my code or this is completely wrong.

    I would appreciate if anyone can help me with this.

    Thank you very much for your help....
  • 12-20-2011 05:34 PM In reply to

    Re: Trying to write rules in InfoPath but get a error messages

    I'm not aware of an easy way of using rules to limit the number of words.  Have you considered using characters instead of word count?  The solution will look alot simplier.
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 12-20-2011 08:56 PM In reply to

    Re: Trying to write rules in InfoPath but get a error messages

    I kind of solve the problem.

    If I use this, I will get any errors.

    concat( substring((string-length(Description)), 1, ((string-length(Description))

    But now the rules will not even trigger. I try plug in a simple "abcd" in the field. It will not even display those to me.

    If SummaryDescription is blank Set field value . = "abcd"

    I tried to follow the solution posted in this forum. I'm still not able to display it. http://www.infopathdev.com/forums/p/11279/40078.aspx
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.