notes学习中自己总结.docx_第1页
notes学习中自己总结.docx_第2页
notes学习中自己总结.docx_第3页
notes学习中自己总结.docx_第4页
notes学习中自己总结.docx_第5页
已阅读5页,还剩17页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

实例:NOTES弹出各种输入框,选择框Sub Click(Source As Navigator)Dim session As New NotesSessionDim uiws As New NotesUiWorkSpaceDim uidoc As NotesUiDocumentDim SourceDoc As NotesDocumentDim SourceView As NotesViewDim Setupview As NotesViewDim SetupDoc As NotesDocumentDim SourceDB As NotesDatabaseSet SourceDB=Session.CurrentDatabase Dim PersonDB As New NotesDatabase(SourceDB.Server, APSYSSYS0001.NSF)Dim PersonView As NotesViewDim CardView As NotesViewDim CardDoc As NotesDocumentDim PersonDoc As NotesDocumentDim PersonView1 As NotesViewDim PersonDoc1 As NotesDocumentSet CardView = PersonDB.GetView(CardidView)Set SetupView = SourceDB.GetView(View-SystemSetup)Set SetupDoc = SetupView.GetDocumentByKey(Form-SystemSetup)If SetupDoc Is Nothing ThenMessagebox (Error : Cant find system doc , please try again or call MIS Dept!)Exit SubEnd IfDim DataDB As New NotesDatabase(SourceDB.Server, APOFFICEAP077A.NSF)Dim DataView As NotesViewDim DataDocCol As NotesDocumentCollectionDim DataDoc As NotesDocumentDim EmpNo As StringDim IDNo As StringDim LotNo As StringDim V1 As NotesItemDim V2 As NotesItemDim V3 As VariantDim V4 As NotesItemDim V5 As NotesItemDim V6 As NotesItemDim V7 As NotesItemDim V8 As NotesItemDim Remain As StringDim sss As StringDim should As String- 2011/11/07 NICK增加,要求進行選擇領料或者退料.並修改流程Dim Select1 As VariantDim Chose(2) As VariantChose(0) = 1.領料單Chose(1) = 2.退料單Select1 = uiws.Prompt (PROMPT_OkCancelList, Selection , Select a Form type., Chose(2), Chose)If Select1 = 1.領料單 ThenEmpNo = Inputbox$(Please input your EmpNo!,請輸入員工編號)If EmpNo = ThenExit SubEnd IfIf SetupDoc.InputType(0) = B ThenIf Len(EmpNo) 12 ThenMessagebox (錯誤:請用讀卡機刷識別證!)Exit SubElsesss = Left(EmpNo,7)If Left(sss,3) 019 ThenMessagebox (錯誤:本系統僅供南茂員工使用!)Exit SubElseshould = S + Right(sss,4)End IfEnd IfElseif (SetupDoc.InputType(0) = C )ThenrAns = uiws.Prompt(PROMPT_PASSWORD, Please Input your EmpNo!,Please Use Sense Machine)If Isempty(rAns) ThenExit SubEnd IfEmpNo = Cstr(rAns)If Len(EmpNo) )Set SourceDoc = New NotesDocument( SourceDB ) SourceDoc.Form = Form-OutSourceDoc.EmpNo = PersonDoc.EmpNo(0)SourceDoc.EmpCName = PersonDoc.CName(0)SourceDoc.EmpEName = PersonDoc.tFullName(0)SourceDoc.DeptCode = PersonDoc.Dept_No(0)SourceDoc.Department = PersonDoc.Divison(0)If PersonDoc1 Is Nothing Thenmstr = Error : 部門 + SourceDoc.DeptCode(0) + 於SystemSetup1中沒有設定,請於SystemSetup中新增資料Messagebox mstr, 16, Input Validation ErrorCall uidoc.GotoField(DeptCode)Exit SubElseSourceDoc.EmpNo2 = PersonDoc1.EmpNoSourceDoc.EmpName2 = PersonDoc1.EmpNameSourceDoc.EmpEName2 = PersonDoc1.EmpENameEnd IfSourceDoc.Datecomposed = Date + TimeSourceDoc.SerialNo = Format(Date,mm/dd/yyyy) + PersonDoc.Dept_No(0)SourceDoc.IDNo = SourceDoc.Quality = SourceDoc.BTime = SourceDoc.Desc = SourceDoc.Remain = SourceDoc.House=SourceDoc.Cabinet=SourceDoc.LotNo=Set V1 = SourceDoc.GetFirstItem(IDNo)Set V2 = SourceDoc.GetFirstItem(Quality)Set V3 = SourceDoc.GetFirstItem(BTime) Set V4 = SourceDoc.GetFirstItem(Desc)Set V5 = SourceDoc.GetFirstItem(Remain)Set V6 = SourceDoc.GetFirstItem(House)Set V7= SourceDoc.GetFirstItem(Cabinet)Set V8 = SourceDoc.GetFirstItem(LotNo)tDate = Cstr(Format(Date,mm/dd/yyyy)tTime = Str(Time)DoIDNo = Inputbox$ (Please input PartNo , 請輸入料號!)If IDNo = Then Exit DoSet DataView = DataDB.GetView(DataView1)增加批號輸入,因為存在相同的PartNo有不同的LotNoSet DataDocCol=DataView.GetAllDocumentsByKey(IDNo)If DataDocCol.Count1 ThenLotNo = Inputbox$ (Please input the LotNo. , 請輸入批號!)Set DataDoc=DataDocCol.GetFirstDocumentDo While Not DataDoc Is NothingIf DataDoc.LotNo(0)=LotNo Then Exit DoSet DataDoc=DataDocCol.GetNextDocument(DataDoc)LoopElseSet DataDoc = DataView.GetDocumentByKey(IDNo)End IfIf DataDoc Is Nothing ThenMessagebox (Error:資料庫中無此筆資料! 請與MIS部門聯絡!)Elsetpartno = DataDoc.PartNo(0)tcount = DataDoc.Count(0)value = Inputbox$ (Please input the amount. , 請輸入數量!)If Int(value) Int(tcount) ThenMessagebox (Error:庫存不足! 請Check庫存量和領出量!)ElseRemain = Str(Int(tcount)-Int(value)Call DataDoc.ReplaceItemValue(Count,Remain)DataDoc.Count=RemainCall V1.AppendToTextList(tpartno)Call V2.AppendToTextList(value)Call V3.AppendToTextList( tDate + + tTime )Call V4.AppendToTextList(DataDoc.Desc(0)Call V5.AppendToTextList(Remain)Call V6.AppendToTextList(DataDoc.House(0)Call V7.AppendToTextList(DataDoc.Cabinet(0)If DataDoc.LotNo(0)= ThenCall V8.AppendToTextList(NA)ElseCall V8.AppendToTextList(DataDoc.LotNo(0)End IfEnd If End IfDim Select2 As VariantDim Chose1(2) As VariantChose1(0) = 1.直接上机Chose1(1) = 2.进维修间Select2 = uiws.Prompt (PROMPT_OkCancelList, Selection , 請選擇, Chose1(2), Chose1)If Select2 = 1.直接上机 ThenDim Select3 As VariantDim Chose2(6) As VariantChose2(0) = 1.DAChose2(1) = 2.WBChose2(2) = 3.MDChose2(3) = 4.MKTFChose2(4) = 5.SP Select3 = uiws.Prompt (PROMPT_OkCancelList, Selection , 請選擇用料站別, Chose2(6), Chose2)Messagebox (!完成出庫手續!)Call SourceDoc.Save(True,True)Call DataDoc.save(True,True)ElseEnd IfLoopCall uiws.EditDocument(True,SourceDoc)Elseif Select1 = 2.退料單 Then退料單部分EmpNo = Inputbox$(Please input your EmpNo!,請輸入員工編號)If EmpNo = ThenExit SubEnd IfIf SetupDoc.InputType(0) = B ThenIf Len(EmpNo) 12 ThenMessagebox (錯誤:請用讀卡機刷識別證!)Exit SubElsesss = Left(EmpNo,7)If Left(sss,3) 019 ThenMessagebox (錯誤:本系統僅供南茂員工使用!)Exit SubElseshould = S + Right(sss,4)End IfEnd IfElseif (SetupDoc.InputType(0) = C )ThenrAns = uiws.Prompt(PROMPT_PASSWORD, Please Input your EmpNo!,Please Use Sense Machine)If Isempty(rAns) ThenExit SubEnd IfEmpNo = Cstr(rAns)If Len(EmpNo) )Set SourceDoc = New NotesDocument( SourceDB ) SourceDoc.Form = Form-InSourceDoc.EmpNo = PersonDoc.EmpNo(0)SourceDoc.EmpCName = PersonDoc.CName(0)SourceDoc.EmpEName = PersonDoc.tFullName(0)SourceDoc.DeptCode = PersonDoc.Dept_No(0)SourceDoc.Department = PersonDoc.Divison(0)If PersonDoc1 Is Nothing Thenmstr = Error : 部門 + SourceDoc.DeptCode(0) + 於SystemSetup1中沒有設定,請於SystemSetup中新增資料Messagebox mstr, 16, Input Validation ErrorCall uidoc.GotoField(DeptCode)Exit SubElseSourceDoc.EmpNo2 = PersonDoc1.EmpNoSourceDoc.EmpName2 = PersonDoc1.EmpNameSourceDoc.EmpEName2 = PersonDoc1.EmpENameEnd IfSourceDoc.Datecomposed = Date + TimeSourceDoc.SerialNo = Format(Date,mm/dd/yyyy) + PersonDoc.Dept_No(0)SourceDoc.IDNo = SourceDoc.Quality = SourceDoc.BTime = SourceDoc.Desc = SourceDoc.Remain = SourceDoc.House=SourceDoc.Cabinet=SourceDoc.LotNo=Set V1 = SourceDoc.GetFirstItem(IDNo)Set V2 = SourceDoc.GetFirstItem(Quality)Set V3 = SourceDoc.GetFirstItem(BTime) Set V4 = SourceDoc.GetFirstItem(Desc)Set V5 = SourceDoc.GetFirstItem(Remain)Set V6 = SourceDoc.GetFirstItem(House)Set V7= SourceDoc.GetFirstItem(Cabinet)Set V8 = SourceDoc.GetFirstItem(LotNo)tDate = Cstr(Format(Date,mm/dd/yyyy)tTime = Str(Time)DoIDNo = Inputbox$ (Please input PartNo , 請輸入料號!)If IDNo = Then Exit DoSet DataView = DataDB.GetView(DataView1)增加批號輸入,因為存在相同的PartNo有不同的LotNoSet DataDocCol=DataView.GetAllDocumentsByKey(IDNo)If DataDocCol.Count1 ThenLotNo = Inputbox$ (Please input the LotNo. , 請輸入批號!)Set DataDoc=DataDocCol.GetFirstDocumentDo While Not DataDoc Is NothingIf DataDoc.LotNo(0)=LotNo Then Exit DoSet DataDoc=DataDocCol.GetNextDocument(DataDoc)LoopElseSet DataDoc = DataView.GetDocumentByKey(IDNo)End IfIf DataDoc Is Nothing ThenMessagebox (Error:資料庫中無此筆資料! 請與MIS部門聯絡!)Elsetpartno = DataDoc.PartNo(0)tcount = DataDoc.Count(0)value = Inputbox$ (Please input the amount. , 請輸入數量!)End IfStation = Inputbox$ (Please input Station , 請輸入儲位!)Remain = Str(Int(tcount)+Int(value)Call DataDoc.ReplaceItemValue(Count,Remain)DataDoc.Count=RemainSourceDoc.Station=StationCall V1.AppendToTextList(tpartno)Call V2.AppendToTextList(value)Call V3.AppendToTextList( tDate + + tTime )Call V4.AppendToTextList(DataDoc.Desc(0)Call V5.AppendToTextList(Remain)Call V6.AppendToTextList(DataDoc.House(0)Call V7.AppendToTextList(DataDoc.Cabinet(0)If DataDoc.LotNo(0)= ThenCall V8.AppendToTextList(NA)ElseCall V8.AppendToTextList(DataDoc.LotNo(0)End IfMessagebox (!完成退庫手續!)Call SourceDoc.Save(True,True)Call DataDoc.save(True,True)LoopCall uiws.EditDocument(True,SourceDoc)End IfEnd SubNO1(0) NO2(0)NO3(0)NO4(0)NOi(0)这种循环For i = 0 To Ubound(SourceDoc.CounterSign)SignerNo(i)=SetupDoc.GetItemValue(No & Cstr(i+1)(0)AA=SetupDoc.GetItemValue(No & Cstr(i+1)(0)Set PersonDB = New NotesDatabase(SourceDB.Server, APSYSSYS0001.NSF)Set PersonView = PersonDB.GetView(Empnoview)Set PersonDoc = PersonView.GetDocumentByKey(AA)SignerName(i)=PersonDoc.Cname(0)NowSigner(i)=PersonDoc.tFullName(0)Next更改點將錄設計模板(sys0001.ntf) SOP:1.用sh05根目錄下的sys0001.ntf,取代sh01/sys/sys0001.nsf的設計。注意取消“隱藏公式及LotusScript”。2.在sh01/sys/sys0001.nsf上進行修改,并測試。3.將修改的內容同樣在sh05/sys0001.ntf進行修改。4.用sh05/sys0001.ntf取代sh05/sys/sys0001.nsf的設計和sh01/sys/sys0001.nsf的設計。注意選擇“隱藏公式及LotusScript”。Dim rtItem As NotesRichTextItemSet rtItem = SourceDoc.GetFirstItem(Treat)FieldValue = SourceDoc.GetItemValue(Treat)(0)If rtItem.Type = RICHTEXT ThenForall o In rtItem.EmbeddedObjectsIf o Is Nothing ThenIf FieldValue = ThenMessagebox Error:You must input 後續處理及防止再發生對策.,16,Input Validation ErrorCall uidoc.GotoField(Treat)CheckFieldStatus = FalseExit FunctionEnd IfEnd IfEnd ForallEnd Ifload amgr 开启agantres s 重启show server 查看服务器信息show task 查看任务show user 查看用户show config ports 查看通信端口stop . 停止某个端口load http 载入http服务tell http q 停止http服务tell router update config 重载路由表tell adminp process all 快速执行adminpdrop username(all) 踢出某人(所有人)broadcast 语句 广播 状态栏中 broadcast (!)hello 广播 对话框load fixup 修复数据库 load updall 修复视图或索引load compact 压缩资料库怎样判断某一天所在周的最后一天 If(tdate != ; Adjust(tdate; 0; 0; Modulo(8 - Weekday(tdate); 7); 0; 0; 0); tdate) 怎样计算两个日期域间有几周? diffDays := (EndDate - StartDate) / 86400 + 1;strtDay := Modulo(Weekday(StartDate); 7);endDay := Modulo(Weekday(EndDate); 7);result := (diffDays - endDay + strtDay - 8) * 5 / 7 - Max(-2; -strtDay) - Min(1; endDay) + 5 - strtDay + endDay 怎样在公式里用Dos命令 Command(Execute; C:COMMAND.COM; /C DEL C:TEST.TXT) 怎样截取dblookup的错误信息 TempVar := DbLookup();If(IsError(TempVar); perform desired error response; perform desiredaction on TempVar) 怎样做到当文档有答复时,用邮件通知该文档的作者 1.在主文档,答复文档,答复的答复文档创建一个域:form,缺省值:Name(CN;Usernam2.在答复表单创建一个域:parentform,缺省值(用继承)form3.在答复的答复表单,创建一个域:parentform缺省值(用继承)ParentFrom:from4.在答复和答复的答复表单增加一个隐藏,显示时计算的announce域,公式是:If(IsDocBeingSaved;Success;Return(0);List := Trim(Replace(ParentFrom;From;);If(Elements(List) 0; Success;Return(0);SendList := Prompt(OKCANCELLIST; Mail Notify?; Send mail notification about your reply to ;List);If(Elements(SendList) 0; Success;Return(0);MailSend(SendList; ; ; Ref: + OriginalSubject; ; My reply: ; IncludeDoclink) 怎样在notes.ini里将环境变量删除 ENVIRONMENT environmental variable := ; 或者 SetEnvironment(environmental variable;). 在答复文档里如何修改主文档的值 SetDocField($Ref;Field on Parent Doc;Value) 怎样得到一个群组里有哪些成员 Name(CN;DbLookup(;Subset(MailDbName;1) : Names.nsf;Groups;YourGroupName;Members)propercase(string) 将字符串中的单词转换成字首大写的形式:每个单词的头一个字母大写,后面的其他字母小写。以下的样例将返回 Every Child Loves Toys. ProperCase(every CHILD LOves toys) trim(strin) 从文本字符串中(或文本列表的每一个元素中)删除位于开头和结尾的空格,同时还删除多余的空格。以下的样例将返回 ROBERT SMITH。Trim(UpperCase(Robert Smith) length(string) 返回文本字符串中字符的个数.该样例返回 45。Length(The boy crossed the wide, but gentle, stream.) newline 在文本字符串中插入一个新行(回车)。下面公式返回 Hi There Hi+NewLine+There matches(string;pattern) 用一个样本字符串去匹配一个字符串。因为样本字符串可以包含一定数量的通配符和逻辑符号,所以可以用较复杂的模式去匹配字符串。该样例返回 0。 Matches(A big test;a?test) left 从左到右搜索字符串,并返回字符串中最左边的几个字符。 该样例返回Len。 Left(Lennard Wallace;3) 逻辑操作 if if(condition1;action1;condition2;action2;else-action) 如果满足条件1,则做action1,如果满足条件2,则做action2,否则做else-action.注意: 1.该函数必须有奇数个参数。2.总共可以加99个条件3.可以嵌套 日期操作 created 返回创建此文档时的时间-日期值。 adjust(time-date; year;month;day;hour; month;day;hour;minute ;second) 按照指定的年、月、日、小时、分钟、秒来调整指定的时间-日期值。调整的值可正可负。以下的样例将返回 09/2/97。 adjust(06/30/95;2;2;2;0;0;0) today 返回当天的日期。 month(time-date) 从指定的时间-日期中提取月份值 该样例返回 1。 Month(1/15/88) Weekday(time-date) 算出一周中的某一天,返回一个表示这一天的数字。下面样例返回 5(实际是星期六)。 Weekday(9/29/88) tomorrow 返回明天日期的时间-日期值。 算术操作Max(number;number) 给出两个数字,返回较大的那个数字。下面样例返回 99;6;7;8 Max(99:2:3;5:6:7:8) Min(number;number) 给定两个数字,返回较小的那一个。以下的样例将返回 5;2;3;3 Min(99:2:3;5:6:7:8) Round(number) 将指定的数字归整,结果为最接近它的一个数该样例返回 1 Round(1.499) Round(number;factor) 如果还指定了另外一个数字,就用它作为规整因子如果称做 NumberOfEmployees 的域值是12338,则该样例返回12340Round(NumberOfEmployees;10) Sum(num;num;) 在一组数字或数字列表中进行加法运算。以下的样例将返回 3Sum( 1 : 2 ) 列表操作 Elements(list) 计算列表中文本、数字、时间-日期

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论