 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Help with Lotus Notes 8 code</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/help-with-setfield/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/help-with-setfield/</link>
	<description></description>
	<lastBuildDate>Sun, 19 May 2013 00:45:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: rvogan</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/help-with-setfield/#comment-94234</link>
		<dc:creator>rvogan</dc:creator>
		<pubDate>Thu, 14 Jul 2011 16:22:40 +0000</pubDate>
		<guid isPermaLink="false">#comment-94234</guid>
		<description><![CDATA[Thanks again.  That&#039;s what I was trying to do with the rtf.  I didn&#039;t know a plain text field would act differently.  When I do the setfield, the rtf is not updated and the refresh doesn&#039;t work for me.  I was trying
@setfield...
@Command( [RefreshWindow] )...

I had a death in the family and won&#039;t be able to play with it until next week.  

Thanks for your help]]></description>
		<content:encoded><![CDATA[<p>Thanks again.  That&#8217;s what I was trying to do with the rtf.  I didn&#8217;t know a plain text field would act differently.  When I do the setfield, the rtf is not updated and the refresh doesn&#8217;t work for me.  I was trying<br />
@setfield&#8230;<br />
@Command( [RefreshWindow] )&#8230;</p>
<p>I had a death in the family and won&#8217;t be able to play with it until next week.  </p>
<p>Thanks for your help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brooklynegg</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/help-with-setfield/#comment-94229</link>
		<dc:creator>brooklynegg</dc:creator>
		<pubDate>Thu, 14 Jul 2011 15:00:18 +0000</pubDate>
		<guid isPermaLink="false">#comment-94229</guid>
		<description><![CDATA[Well, if you have a hammer...

Does this information have to go in a rich text field? Do you have a text field you can use instead (or add one)? If so, you could simply assign the field the final value.

Also, you should create the full value of the field in a variable before assigning it. For instance, you could improve the look of the information by including the question, add line breaks, etc.. Then, if you change the button later, the question answered would display in the response. 

This also uses the common name component of @name to get the user&#039;s name, instead of parsing it out. I think that makes more sense as well.

FinalValue := Q1T + &quot;: &quot; + Q1A + @newline + Q2T + &quot;: &quot; + Q2A + @newline + ... + @name([cn]; @username);
@setfield(&quot;hckrptTXT&quot;; FinalValue)]]></description>
		<content:encoded><![CDATA[<p>Well, if you have a hammer&#8230;</p>
<p>Does this information have to go in a rich text field? Do you have a text field you can use instead (or add one)? If so, you could simply assign the field the final value.</p>
<p>Also, you should create the full value of the field in a variable before assigning it. For instance, you could improve the look of the information by including the question, add line breaks, etc.. Then, if you change the button later, the question answered would display in the response. </p>
<p>This also uses the common name component of @name to get the user&#8217;s name, instead of parsing it out. I think that makes more sense as well.</p>
<p>FinalValue := Q1T + &#8220;: &#8221; + Q1A + @newline + Q2T + &#8220;: &#8221; + Q2A + @newline + &#8230; + @name([cn]; @username);<br />
@setfield(&#8220;hckrptTXT&#8221;; FinalValue)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rvogan</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/help-with-setfield/#comment-94182</link>
		<dc:creator>rvogan</dc:creator>
		<pubDate>Wed, 13 Jul 2011 14:39:22 +0000</pubDate>
		<guid isPermaLink="false">#comment-94182</guid>
		<description><![CDATA[thanks Brooklynegg.  I&#039;m not a Notes pgmr (no formal training) so I understand it at a high level but haven&#039;t done much actual coding.

My team has a db we use for storing audit documentation.  We want collect data from another team and store it in the db.  The other team only has write access to some fields in the doc we intended to use.  I tried to do a quick solution by putting a button in the doc with the following code to collect the data.  Initially this was going to generate an email that would be sent back to a team mailbox.  Then I tried to code the button to just update the field in the form directly.  

&lt;pre&gt;
Sub := &quot;Log Survey &#124; &quot;;

REM {------------------------------------------Text for questions---------------------------------------------};

Q1T := &quot;Q1 text?&quot;;
Q2T := &quot;Q2 text?&quot;;
Q3T := &quot;Q3 text?&quot;;

REM {------------------------------------------Y/N questions---------------------------------------------------};

Q4T := &quot;Q4 text?&quot;;
Q5T := &quot;Q5 text?&quot;;

REM {-------------------------------------------Prompts-------------------------------------------------------};

account := @Prompt([OkCancelEdit];&quot;Account&quot;;&quot;Enter the Account(s):&quot;;accountdef);

Q1A := @Prompt([OkCancelEdit]; &quot;Q1&quot;; +Q1T; &quot;&quot;);
Q2A := @Prompt([OkCancelEditCombo]; &quot;Q2&quot;; +Q2T; &quot;Daily&quot; ; &quot;Daily&quot; : &quot;Weekly&quot; : &quot;Monthly&quot;);
Q3A := @Prompt([OkCancelEdit]; &quot;Q3&quot;; +Q3T; &quot;&quot;);

Q4A := @Prompt([OkCancelList] : [NoSort]; &quot;Q4&quot;; +Q4T; &quot;Yes&quot;; &quot;Yes&quot; :&quot;No&quot;);
Q5A := @Prompt([OkCancelList] : [NoSort]; &quot;Q5&quot;; +Q5T; &quot;Yes&quot;; &quot;Yes&quot; :&quot;No&quot;);

REM {--------------------------------------------Generate email------------------------------------------------------------------};

atf := @Right(@Left(@UserName; &quot;/&quot;);&quot;=&quot;);
firstname :=@Word(atf;&quot; &quot;;1);

Subject := +Sub+account +&quot; &#124; &quot; +Q1A+ &quot; &#124; &quot; +Q2A +&quot; &#124; &quot; +Q3A+&quot; &#124; &quot; +Q4A+ &quot; &#124; &quot;+Q5A+&quot; &#124; &quot;+Q6A+&quot; &#124; &quot;+Q7A+&quot; &#124; &quot;+Q8A+&quot; &#124; &quot;+Q9A+&quot; &#124; &quot;+Q10A ;

@SetField(&quot;hckrpt&quot;; +subject;

(etc)

I think what you are saying is to create a new doc in the db which makes sense to me, but I haven&#039;t done that for a couple of years and would have to relearn it.  Also although I have the authorities to create docs I&#039;m a little afraid of screwing something else up.

In summary, I&#039;m where I am because of my ignorance.  I have a hammer (familiar with the button and limited formula language) so everything looks like a nail.&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>thanks Brooklynegg.  I&#8217;m not a Notes pgmr (no formal training) so I understand it at a high level but haven&#8217;t done much actual coding.</p>
<p>My team has a db we use for storing audit documentation.  We want collect data from another team and store it in the db.  The other team only has write access to some fields in the doc we intended to use.  I tried to do a quick solution by putting a button in the doc with the following code to collect the data.  Initially this was going to generate an email that would be sent back to a team mailbox.  Then I tried to code the button to just update the field in the form directly.  </p>
<pre>
Sub := "Log Survey | ";

REM {------------------------------------------Text for questions---------------------------------------------};

Q1T := "Q1 text?";
Q2T := "Q2 text?";
Q3T := "Q3 text?";

REM {------------------------------------------Y/N questions---------------------------------------------------};

Q4T := "Q4 text?";
Q5T := "Q5 text?";

REM {-------------------------------------------Prompts-------------------------------------------------------};

account := @Prompt([OkCancelEdit];"Account";"Enter the Account(s):";accountdef);

Q1A := @Prompt([OkCancelEdit]; "Q1"; +Q1T; "");
Q2A := @Prompt([OkCancelEditCombo]; "Q2"; +Q2T; "Daily" ; "Daily" : "Weekly" : "Monthly");
Q3A := @Prompt([OkCancelEdit]; "Q3"; +Q3T; "");

Q4A := @Prompt([OkCancelList] : [NoSort]; "Q4"; +Q4T; "Yes"; "Yes" :"No");
Q5A := @Prompt([OkCancelList] : [NoSort]; "Q5"; +Q5T; "Yes"; "Yes" :"No");

REM {--------------------------------------------Generate email------------------------------------------------------------------};

atf := @Right(@Left(@UserName; "/");"=");
firstname :=@Word(atf;" ";1);

Subject := +Sub+account +" | " +Q1A+ " | " +Q2A +" | " +Q3A+" | " +Q4A+ " | "+Q5A+" | "+Q6A+" | "+Q7A+" | "+Q8A+" | "+Q9A+" | "+Q10A ;

@SetField("hckrpt"; +subject;

(etc)

I think what you are saying is to create a new doc in the db which makes sense to me, but I haven't done that for a couple of years and would have to relearn it.  Also although I have the authorities to create docs I'm a little afraid of screwing something else up.

In summary, I'm where I am because of my ignorance.  I have a hammer (familiar with the button and limited formula language) so everything looks like a nail.</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: brooklynegg</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/help-with-setfield/#comment-94180</link>
		<dc:creator>brooklynegg</dc:creator>
		<pubDate>Wed, 13 Jul 2011 13:58:19 +0000</pubDate>
		<guid isPermaLink="false">#comment-94180</guid>
		<description><![CDATA[Some thoughts. 

I&#039;m kind of confused by the requirement. Why would you have someone respond to a survey, then push the data to a rich text field? Why not have the data save to the survey document and save the information there? If the end result is a requirement to show the survey answers on some other form, then display the survey results document in summary in an embedded view and use an embedded form to display the full survey document in the main form. This is all simple Notes stuff with no scripting required.]]></description>
		<content:encoded><![CDATA[<p>Some thoughts. </p>
<p>I&#8217;m kind of confused by the requirement. Why would you have someone respond to a survey, then push the data to a rich text field? Why not have the data save to the survey document and save the information there? If the end result is a requirement to show the survey answers on some other form, then display the survey results document in summary in an embedded view and use an embedded form to display the full survey document in the main form. This is all simple Notes stuff with no scripting required.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rvogan</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/help-with-setfield/#comment-94151</link>
		<dc:creator>rvogan</dc:creator>
		<pubDate>Tue, 12 Jul 2011 14:33:54 +0000</pubDate>
		<guid isPermaLink="false">#comment-94151</guid>
		<description><![CDATA[I haven&#039;t learned LotusScript and it kinda frightens me.  Maybe I should bite the bullet, but I&#039;m under a time constraint.  This is over my head and I think I&#039;m going to have to abandon the project for now.  Thanks Stiletto and Brooklynegg.]]></description>
		<content:encoded><![CDATA[<p>I haven&#8217;t learned LotusScript and it kinda frightens me.  Maybe I should bite the bullet, but I&#8217;m under a time constraint.  This is over my head and I think I&#8217;m going to have to abandon the project for now.  Thanks Stiletto and Brooklynegg.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brooklynegg</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/help-with-setfield/#comment-94150</link>
		<dc:creator>brooklynegg</dc:creator>
		<pubDate>Tue, 12 Jul 2011 13:51:24 +0000</pubDate>
		<guid isPermaLink="false">#comment-94150</guid>
		<description><![CDATA[Refreshing a rich text field in a form UI takes special care. 

I have to agree with Stiletto. LotusScript is the answer. However, I would create a new richtextitem object, set it to your rich text field, populate the field, then Call an Update.

set RTITEM = New Notesrichtextitem(doc, &quot;dspsupportingevidence&quot;)

&#039;populate the richtext item.
&#039;YOUR CODE HERE
&#039;then update RTITEM.

Call RTITEM.Update]]></description>
		<content:encoded><![CDATA[<p>Refreshing a rich text field in a form UI takes special care. </p>
<p>I have to agree with Stiletto. LotusScript is the answer. However, I would create a new richtextitem object, set it to your rich text field, populate the field, then Call an Update.</p>
<p>set RTITEM = New Notesrichtextitem(doc, &#8220;dspsupportingevidence&#8221;)</p>
<p>&#8216;populate the richtext item.<br />
&#8216;YOUR CODE HERE<br />
&#8216;then update RTITEM.</p>
<p>Call RTITEM.Update</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.033 seconds using memcached
Object Caching 337/343 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-19 01:10:20 -->