Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

@Doc children and column colors in a view

Status
Not open for further replies.

mj99

Programmer
Sep 30, 2005
2
US
I am trying to color code certain rows depending upon the number of children the main document has. I am trying-

red := 255:0:0 : 1 : 1 : 1;
apricot := 255:155:133 : 1 : 1 : 1;

number := @DocChildren ;
@If(@TextToNumber(number) >=3;red;"");

I understand that @docChildren returns "special text" which cannot be converted to a number. Is there any other way to compare a value to the # of children in a view??

Thank you for your time.
 
View coding is best done for simple things. Your request is simple enough, unfortunately Lotus has made things difficult by preventing the result from being turned into a number.
There is another way of doing what you want, that implies some coding in LotusScript.
You need to ensure that response docs retrieve the UNID of their parent doc. A field with @InheritedDocumentUniqueID will do the trick.
In the PostOpen event of the response form, check if the document is new. If so, set a global boolean (a flag) to true. On QuerySave, set another global flag to true to know that the document has been saved. Finally, in the QueryClose event, if both flags are true, get the parent document UNID from the field, retrieve the parent document and set a field in the parent document with the UNID of the current document. This implies that the creators of child docs have author access on the parent doc.
Once you have done all that, you have the UNID of every child doc written into a field on the parent doc. In the view, all you then need to do is use @elements on the field to know how many children there are.

It's a lot less simple, I agree, but it will work.

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top