首页 > 传奇攻略 K3Cloud+BOS+插件开发百问百答

K3Cloud+BOS+插件开发百问百答

K/3CloduBO插S开件发百百答问修记订录Vr.eoVN10.期日21054208制修编订晋博张校对振丁华批准碧云赖改修的节章号初始本版,共93个问题题和意见问果你对如文档有任意见何问题、或想法或,者的你问题在未此文档中到答找,案请通过子电件联系我们邮injobzhang_k@indge.eocm 录目/K3louCdBO插S件开百发百答问.................................................................................................1.1入门篇......................................................................................................................................4.1..1何如创建并用启类各插件.......................................................................................41.1..1何创建如并用动态表启单插件.......................................................................411.2..何如建创并用启据编单辑件.插......................................................................1.18.3.如创何并建用启础资基编料插辑件...............................................................911..4.如何创建启并列表插件用.............................................................................1101.5.如.何建并创用操启作件插.............................................................................11.116..如何建创启并账用表数取插件.....................................................................1511..7.如何创并建启用单转换插件据....................................................................1.1.188.如何.建并创用反写插件启.............................................................................118.2.为何插件起不作,如用何排....查.........................................................................202.进篇.阶....................................................................................................................................2121..插代码件如何自,调用行单据作操服务.............................................................122..11.如何加载(Lod)单a..据.....................................................................................1221...2如调用保何(存aSev操)作...............................................................................25.2.31如何调.用交(提Sumitb操).作..........................................................................282..1.如何调4审核/反用审(核Auitd/UAudnt)i作....操.............................................12.315..何如用禁调用Di(sbaeld)操作........................................................................342.16.如.何除(删elDtee)单据...................................................................................3.722..用单据操调后,作如何断结果,并判理处交提示互.........................................402.3.插 件给字段赋后值为什,不么执字行段”值更属性新”配置上表单的务服......4244.在.态表单动插件中如,修改界面数据何............................................................4.6.241..如新何单据体增行.........................................................................................462.4..2何如除删单体据行.........................................................................................42.483.如.何普通字段给赋值....................................................................................4.29.44.如何.给础基资字料赋值.段............................................................................5204...5如何态动置下设拉列字段表的可选项.........................................................522..5字段标识(Kye)字段、名F(eldNimae)属性名、Pr(oeptryaNem)的差别...............53.6.2在态动表单中,如何实现件下文.载....................................................................53.27.如何持支用户把本文件地上传服务到器.............................................................52.87以实.说例如明为何态动表单取数、填充.............................................................85.92.何如为预账置,添表字加段.................................................................................06.10.2如何获基取础资的料属值....性............................................................................6.2.01.1保前,存如何为建新的据数据单、包据体行,单写主键.填...........................61.2.21.在态表单动件插,中如显何指定界面示.............................................................62.132.何为收款单,往如单来位类,型加新添基础资料的.........................................642.4.1何创如、建调自定试执义行计划.........................................................................66.251.如何通过钮实现按F8择返选回效果...................................................................67216..如在操何作件插中,定义操自校作验并启用器.................................................6921..如何实7超链接现打开外部,UR地址..L..............................................................732.18.如何获取基资础料字段类的(F别omrI)..d............................................................74.3 高级篇......................................................................................................................................57.31如何给.据单体格表增,加自义过定行滤.............................................................75 1.入门篇11..何如创建启并用类各件插1.1..1如创何建启用动态表并插件单创插件建程工动态表单件插,运行K在3/lCuo的dWe服b务,需层建 要立一个立独的程管工理动态单表件类;插态表动插单工程件,议建名格式为[命开商]发.[3K[.业]领域]务[子系.].统Bsiunss.Pleugn;如IJD.K.3CSM.UR.PBsineussPlugI.n;创建程工程过V:sialStuudio→New→PojecrtVisalu#C→ClassibraLry→选择程文件工放位置存→OK 工程Rfeeenres右c,添加键工程引用所添加组,都来自件Cloud站网的ebwsitie路径n修改插件程工出输径路Cl为uod网站径we路bstiebin:选中插件工→右程→键rPopetyr属性)(→Buldi签页→utOputatP(输h路径出) 改当前类(C修lss1a)的继承对为A象sbtactrynDamicFromlPuIgn类文件用引类(基bAstactDynarmiFcomrPugInl)所在名空间命#uCsignKindge.BOeSC.re.DynoaimFcrm.PlogIn;uuingSsytes;musngSyiste.Collmcetois.Gennerci;usingysSem.Linq;tsiungyStem.Texs;tusignyStsmeT.hearidng.aTkss;nmespacaeMyyDanmcFormiluPIgn[Syste{m.ompoCentnMoed.Deslricptio("n区分前当类应在用个模哪上型)]"pbuiccllassClsa1s:AbsrtctDynaaicFormPlmuIn{g} 注}并启用册件插插编写件毕,编译工完程,输类库出.d*ll文件W到ebiteBiSn目录;打BOSI开ED定,到动位态单模型表整体属性配置,单插件属性表开点表插单件属,性注册编生译的插件成程工件组从,wesitbeibn径路找到下件插工程件,选择组插件工组程件下的插类,一件般在件类插上用微使软数元描据述在注册,件插区时不同分的类选择注,插册后,件注勾选“意启”用选框复 1..1.如2创建并何启用据编单插件辑创建据单辑编插件单据辑编插,运件行在/3KCloud的Wbe务层服,重用态表动单插工程;件建创插类件过程,的与创动建态单插表几件乎一,样唯一别区是单编据辑件继插的基类承是AstbrcatillPlBguIn插件类用基类所在命名引间空 #CuisngKnigde.eBSO.CoerB.lli.lPguI;unisngSsteymu;insgysteSmCo.lleciotn.sGneeir;cusigSnsytmeLinq;.sunigSystm.eeTx;utinsgSysemt.hTraeidngT.ska;snmeapsceaMDynaymcFirmPlougnI{Sys[tem.CmoonenptModelDe.scripiotn"(分区当类应用前哪个在型模"上)]uplbcciasslCalss:2AstbrcatBllilPugI{n//TOOD}}用启单编据插辑件与启用动态表单件插一样1..31.如何创建启并用础基资编辑插料件如何创基础建资编辑插件料基础料资编辑插,件行在运/K3Cloud的Web服务层重,动态用单插件工表;程创建单与据编辑件插样,唯一一别是基区础料资编插件继承辑基的类Abs是ractBastPlegIn,目前ubsArtatcBsePalugInA与bstartcBilPlulgnI完全一,样但论从不模分类型度或从角未来发展势趋,还看是请家严大遵守格插体系,即件从A:stbarcBateslPuIng承继#CsinguinKdeg.eOBSCo.er.asB.ePulIng;suignSystemusi;ngSysetm.CollcteonisG.eerni;cusngSisyet.mLi nq;uisngSsyet.meTtx;siungySstme.hreTdani.Tagks;snamspeacMyDynamicFormPleguIn{S[ytemsC.mopnenoMtodl.Desecripiton("分区前当类应用哪个在模上型"])upbliclacssClass3:AbtsratBcsaePluIng/{/ODTO} }如何启用础基料编辑插资件与用启态表单插动件一1.1.样4.如何创并建用列表启件如何创插建表列插件列插表,件运在行K3/loCd的uebW服务层重用动态,单插件表工程;与建表创单插一样,件一区别唯列表插件是从AstbacrListtPugIn继l出承来C#singuKingeed.OSB.oCerL.is.tPluIgn;suingSsyetm;siugSystenmColle.tcoin.Gsenreic;uisgnyStsmeLinq;.usinSgytesmT.xe;tuisgnSstyme.Trhedain.gaTss;knamsepceayMynamiDcFrmoPugIln{[Sytems.Cmpooenntodel.DMesrictponi(区分"当类前用在哪个应型上模)]"pubilclascCslas4s:bAsrtactiLtslugInP{//ODTO}}如何用列表插件启启与用动态单插表件样,唯一区一别是册列表注插的件置是模位型的列插表属性件1. .5.1如何创建并用操作插件启何创建如操插件作操作件,运插行K/3在Clou的dApp服务,需要层独创建一个工程单理管操作件类插;操作件工程插命,名规:范开发商[[.K]]3[.业领务]域[子.统].Ap系pSe.ricePlvgInu,如JD.3KS.CM.UR.Ppp.ASerivcPlueIng作插件工程操型类是也Casslilbarry编译输,的出径路同样是Webitesb ;操i插作件工类型程,因运行为层不次一,样动与态表插单工程件引的类用库*dll稍有不:同 #C新建操作插件类的过,程与创动态建表插件单似,区类在别操作插于继件的基承类是AbtracstOpertaionerSvicPelgIunsinugiKndge.BeOSC.re.DonymacFiomr.PlgInu;uingsSystme;sungiSstem.Coylleticon.Gsneeircu;sngiSystme.inq;LsinugSytes.Temt;xsuignSystmeTh.eadrignT.ass;kanmepacseMOpyearinServociePulIng{[ystSm.CempooentnMdol.Deecsipriont"(区分前类当用应在哪操作上个")]uplbicclasslCass1:AsbtracOtpreatonSirveicelPgIun{}}如何启操用插作件打开BOISE,D点模开操作型列表 例当如前作操插件是用在保存操作应,选上保择操存作,点辑编 其他制控签页,服插务件 1.1..如何6创并启用账建取表数件如何插创账表建取数件插账表取插数,运件行K/在3Cludo的App务服,层需单创独一个建程(工lCssalirabry);账取数插件工程,表名命范:[规开发]商[K.3[.]业务领][.子域系统].Ap.pRperoPtuglIn,如DJK3.S.C.PMR.Upp.RAeproPlutIng;插件程工引组件(包用括但不于此,也限可参操考插件作程工用引的件组:) 创建与动态表插件单类,似区在别于表帐务器插件服继自承SsRyeprtoaBseeSricev插类文件引用基类所件命名空间在C#usigKingdene.BSOCo.ntartc.Repsor;tusingSsytme;usingSytsem.ollCectoisnG.neeic;rsiungSytse.mLinqu;insgSystem.Txetusi;gnSytse.mhrTeaind.Tag sks;amnseapeceRorpPlutIgDneom{pblicucassllaCss1Sys:ReproBastSeerivec//{TDO}O}如何用启表服账务器件插进入BOSDIE,打账开模型,设置服务表插件属性器 注册编好的账译表服器插务件并,点击启用选框复 .117..如何建并启创单用转换据插件如创建单何转换据插件单转据插换件,行运在K/3Cludo的App务层服重用操,作插工程件;创插件类,建与建动态表单创插件类似类继,承类是基AbsrtcaCtnveotrlPgInu插类文件件用引类基所在命空名间C#uinsgKingde.eOS.CorB.eetMaatd.CaovnetrEemlnet.lPuIgn;siugnSytes;musngiysteSm.Colelticon.Gesnric;esungiSytemsLi.q;nsiugnystemS.Tex;utisngyStse.mThraedni.Tgakssnam;epsaecBsuneisFsolwlPgInu{publiclacsslass1C:bsArtctCaovertnlugIPn{/TOD/O}}如何启用单转换据件插打开BSIOE,D打开单据换转计设面,插界件策,略注册译生成编的据转单插换件,并用启11...8何创如并启建反用写插如何件建反创插件写反写件,运插行K/在3Cluod的pp服务层A重用操作,插工程;件建插件创与创类动建表单插态类似件,承基继A类sbrtacBustinessFlowervicSelPgIun插文件引用件基所在类命空名间C#sinuKgingde.eBS.COor.eBusienssFolwPl.gunI; usignystSm;esuignSysem.Cotllctioen.Genersc;isuinSygtse.Lminq;usingSstemy.exT;tuisngysSem.Thteraing.Tdsksa;namspaceeBuinesssFowPlulgInpu{lbccilsasClass2:AbsrtactusiBessnFowlSrevicePulIn{g//TOD}O}如启何反写用则插件规开打BOISD,打E开务业流的下游程单模型据(如采购申请下推采购订单单则反,写插挂在件采购单上订),选择单关据联置属性配反写插件注,编册译成的生反写插工程件件组应对的反类写并,启用 12.为.插件何不起作用如,排查何插件不作起用,按照如步骤检查:下件插工编译后,程是否出输Cl到odu站路网径wesbteii插件n是类注册到否当了表前单,并成上保功?注册插件存,要时找wesibetbin路径下的插工程件组件编生译成dll到指定站目网后,是否重录过启站的点II?S必须重启点I站I,新组S件才会启用;被调试码,附代w3加p.exwe序程后,插件代是否码够能命中如果不?能命中,说运明行 的中组件,代与不匹配码需要重,编译并重新启IS;I2.阶篇2进..插件1码,代如何行自调用单操作服据2务..1.1何加如载(Loda单据).211.1..行在运Web层的件,插何如加载据单?行运在Wb层e插的,包括动件态单表插、单件据辑插件、基础编料编资插件、辑表列插等,控制着件交互界面;实思现路调用Kindeg.eBSOS.revicHelpeerdl.lBu的sniesDsaatervSciHeeplr类提e供的Lado方法插件准备插件工程用引Kigdene.BO.SSevrcieHlepr.e dll组件类件引用文BuisnessDataerSvicHeelepr类所的在命名间空KigdneeBOS..eSvrieceHlperBusinessatDSarveicHeleer.Loapd法方介绍usiBnseDatsSareicvHeepelr提供了4个oLa方法,分d介绍如下别pbliustactciDnymicObaject[]LadoCon(ettxctxBus,nisseInfobusneisInfos,isLtSel<cteorIetmIno>fslectoer,OQFilLtrofeiltr).构建过e滤条件OQFiLtler检索某,字段片段些息(L信it<selSetocrIetInmf>)的o标目据数合集upbicslatitDyncmacObiecjt][oLd(Caonetxctt,xDyanmcObijctTepyteyep,QueryBiuldrPeaermeertqueyrPreaemtre)构建过滤条QueryB件uiderPalemertre,检索足满件条的目数标据合集pbliusctaitDynacicOmjectb]Dyn[maicbjOcetTpyetpy)eLoad(Conexttcxt,Oject[bp]Arkry,a指定目数标据di合根据集数据di集合,动态对象类,型检满足条索的目标数件集合据publcsitaictyDamnciOjbet[c]oLd(aoCnexttct,xtsingrfomrid,Lsti<SlectoretImenfI>oselecot,rOLQiltFrefiotlre)cxt定指单模型唯一据示,标感趣兴的段片段信息(字也是说,就只部取字段出来分,不会把这个型的所有字段数模据都出取来),建过滤条件构QLOFltier方参数介绍法类型ConetxButsneissnIof名称usibenssnIfo明说统上下文系息待检索信据数的模元型据信数息 slectoerfiltoretpeyqueyraPrmeetrepAkrrafoyridmListS<electorIetImfno>OQLFitlreDynamicbOecjTytepuQryBuielerPdremeaetrbjeOt[c]tring字段s片段息信快过滤条速对件象态动实体型类询查过滤象目对实标数体据di集合查待询模唯一型标示示例码代C#suinginKdegeB.S.OCor.DeynamciorF.PlmuIgn;usnigKingeed.OS.CBoer.yDamnciFro.PlmugInArg.;suisnKgindeegBO..CSreoM.eadatt;asinguingdKe.eOB.SCroe.SqBulilder;uinsgKigdneeB.OSO.r.mDatantiEy;tuinsgKingde.BOeSS.evireHcleer;upsignSyset;musniSysgem.CtollcteonsiG.eenric;usignystSemL.niq;uinsgSystem.Txe;tusnigyStsm.ehreaTding.aTkss;nmaesacepyDMynmiacFormlugIPn{ubpilcclasCslsa7s:AbstrctaynaDicFormPlmuIng{pbliucvoeridrevidoBttunoliCkcButt(onCilkcEevtAngsre){//加载di100为1的物0料据数//获物取料元数据orFmetMdaaatameriatletMaad=MtaeDtaSaervciHeelep.Lrao(dhtis.oCntxe,t"BD_ateMrai")alsFroMmeadttaa;//建构滤过件条QuerByildeuParermeterqueryParmater=neeQuerywuBidlrearPemteer();uqrePayraetmre.BsuiesnIsnof=amteriaMleata.dusBnesisnfI;queoryarPmatereF.iltreClauesihtWKye="FaMtrealIid1=0010";//构快捷过滤条件建OQLilterfilFtre=newOQLFiltr(e);ifter.Ald(dnewOQFilLerteHaEndityIttme)(Fil{etSrtirng=FM"taeiraldI=10001")};//建关构的心段片段信字息ist<LeSeclotIrtmenfIo>slSteletorcteImnIosf=neLisw<SetlceotIretmnfIo();>//料属性物 slSteeclotIremItfon.sAdd(ewSelnecortItmenfIo("FEprlsCI"d);)//用组织使ltSseletcoIrtemIfnosAd.dn(eweSlcetoIretmInof("FsUeOrgI"));d/方/法:1DyanmciObjce[t]objs=BusnisseDatSaevirecHeplerLo.d(ahts.Coinetx,tmaertiaMleadatBu.si nssnIfo.GetDnyamcOibjetTycp()e;/)/法方3o:bjs=viewSrvicee.oaLd(hts.ioCtenxt,maertalMeitdaaB.suiensIsnofls,tSeletocItreInmos,filtfe);r/方法/:4bojsvie=SwrveceiL.aod(hts.Coitnxte"BD,M_taeril"a,lstSelcetoIrtmInfes,filotr);e}}2}.12..如何调用存保(Sva)e作操2.1.2..1Web层插件,如调用保何(存Svea操)实作现思路用调BusiessDnaaSetriveHeclerp类供提的Sve方法插a件准备 插件程引用工Kingdee.BOS.SevriecHlperedll.组类件文引用件BusiessDntaaSrveceHelpeir类在所命名的空间iKndgeeB.O.SSevireHcleerpBsiunesDastSaerviecHlpee.ravSe法介方绍uBsinessaDatSreiceHelpver供提4个avS方法,e上去看不多差,实其质本区别,有可以将4个这方法区分2为类方法接调直用Omr把数据保存到据数库pulibctstaciDnayimOcjebtcSva(eonCexttct,DyxnamiOcjebtcadtOabecjt)pbuilcsatictynDmacObjict[]Saeev(ContetxtcxD,nayicmObejct][atdObjact)e模保拟操存作服务完端过整程调用填,充键主、生成据编号单执行,验校器调用,服端服务务与服务插端,最件调用后rO把m据数存到保据库pu数bilctstacDinamycOibejct[]Sae(vonteCxctxt,BsunessIniofubinsesIsfon,yDanmiOcbjetc[]dtaOajbetc,stirgonpeariotnNumer)bublipstctaiIOcperatinResuotlsritngpoertiaoNnmbeur=")"aSev(oCtextncxt,BsiuesnsnfIobuinessInfs,DoynaicOmjbcetdtaaObectj,OepareOttipnooption=nul,lSave方法参介数绍称名tcxadatbOejctbusinesIsnoopftionoepartinNuoberm类型ontextDCnymaicbjectBOsuienssIfonOepraeOtpiotntsrngi说明系统全信局,息这里要使用主局全信息中的数据连库信息待保存的数接据对待保存象数据象对的元数据息信自定义外参额数象,服对务端服务服和务端插都件能持有对此象当前操作的作码操例示代码#CsuignKigned.BeOS.CoerB.lilPlu.gn;IusngKiigdne.BeOSC.oe.DrynmacFori.PlugmI.nArgs;siugnKindge.eOSBS.revieHecperl;suignySstm;usengiysSte.moCleclitnos.Geernc;uisnigSytem.Lisn;usqniSgsteymTex.tu;snigSstem.Threydina.gTsas;knamepsacMyDyenamiFcomPlugInr{S[ytem.CsomonpenMotdelD.screpitin("o区当分前应类用哪个在模上型"])pubilccalsslassC2:bAtsrcatilBlPlugnI {pulbicvoerrievdoiduBtontCilkc(uBttnoliCckvEentrAsge){//直接调用Omr存保把数据,存保到数库Bu据sinssDaeatSevireHelcperS.va(eths.ioCntxt,etish.Viwe.Moel.daDaObtjec);t//执行保存务服服务和保存操作端服的务插件Bu端isesnsatDSareviceHleep.rSaevt(hsi.Cntoxt,teihsV.iwe.uBinsssIenoft,hi.Vies.Modew.laDatOjbcte;)}}}2..2.21.App插件层,何调用保存如(Sae)v作操实思现路通过iKgdee.BnO.SApp.dl组件l提供的eSriceveHlep类r,调用eGSetvrie泛型c方法,获取SavSeevrcei服,调务用aSevSevriec供的S提vae法插件方备准插件工程引用Kigden.BeO.SDtaaEtintydll.Kindege.O BS.pA.pld、lKindeegB.S.OCntrocat.dll、s文件类用引关相命名空间,详示见例码代ISavSerevci.eSav接口介绍eWe同层插件b介,分为两绍类方法详W见be插层、B件siuensDsaatervSceHeilerp.avSe绍介示代码C#例uinsgKinged.eOB.CSntrocastus;ingiKgdene.OS.CBore.yDnamcFoim.PlrugIn;sinuKgignde.eOBS.oCr.eDnaymcFiomr.lPgIun.Agsru;isgniKgnde.BOSeC.reoMe.tdaata;usignKingde.eBS.OOm.rataEntiDty;suingSsyet;umisgnSstym.eolClectons.Gineerci;usingSsteymL.ni;uqsingSstye.mexT;tuisgnysSte.Thmredani.Tgasks;anemsapecMyOpearioSnrviceelPuIgn [Sys{te.mompCoennMtdoe.Dlscreptiin("区o分当前类应用哪在操作上"个])pubilcclasCsalss:1AbtsacrOpteatronSireviePlcuIn{pubglicvoerrdevoidiBfoeerxecutEeOeratipoTnarsnactio(nBefreEoxeutecOpeariotnTrnasactoine){//例:保存如id为0001的物料1/获取元数/服务I据MeataDatSevirecmeadtaatServcei=Knigde.eOS.BAp.SpevircHeeple.rGteeSvrce<IiMtaeDtaaSrevie>()c;//取保存获服务IaveSeSvircseveSaerviec=KindegeB.O.SpAp.eSrvicHeelerpG.tSereivec<ISaveeSvirec(>;)//获加取数载据务服VIewSeivriecviwServeice=KnidgeeB.OS.Ap.SprvieeHclpere.eGStericveI<iVwSeerivec()>;//取获料元数物据ormFMetadatamtaeirlaeMatdtaa=mtedaaatSrviece.Load(thisC.ntoext,BD_"aMtreali")asForMetamada;t/获取/d为i10001的物料数据DynmaiOcbejt[]cbojs=ivewerSvci.eLaod(thisCon.tetx,nwobeejtc][{00011,}amtreilMetadaaa.tusiBessInfn.oGetDnymiaOcbjectyTe())p//;存保i为d1000的物1料asvSeevirc.eaSe(thisv.Cntoxet,obs);jsaveSrevce.iaSv(etis.hConext,tatermailMtedataa.BuinesssIfo,obnj)s};}}2..31.如何用调提交Sub(mi)操t2.1作3...1Wbe层插件如何,用调提(交Sumib)操作t实思路现调用Knidgee.BOS.ServicHeleper.ld组l件的BusinessDtaSaericeveHlpre类提供的uSbitm方法插件准备插件工程用引Kngide.BOeS.ervSciHelepr.dlel插件引类用BsinusseDatSaericveHeplre类所在命名的间空B suniesDstaSeavicereHplr.Submeti方法介绍BusinessaDatServceiHelepr提类供了1个Subim方法,t用调方法此模拟交操提的作服务端服全务程,过即修改单状态据执行、交服务提端服,执行提务服务交插件端,最执后行Omr保存据到数数据Sub库mti方法数参绍介型类CnteoxButsinesIsnfoojbcet][trsngOiprateeptiOnoctx称名明说系统下文全上局信息此处,要使主用数库链接据息待信行执交提服务的据元数数描据信述息待执行提交服务数据的键值数组主交操提编码作业务控制外额数参集,提合服交务服端务和服务端件插能持都此参数有bsinuesIsnoIdsfoerapiotnuNmerboption示代码例C#singuKigned.BeSO.oCreB.ase.PulgInus;ngKiingdeeB.SOC.oreDyn.maiFocr.mlPugnIA.gsr;usignKingee.dBO.SeSrvceHilepre;singuSytsem;usingSsytemC.loletconsiG.eerni;cuingsSystmeL.nq;uiingsSsteymT.xte;usngSiysemt.hreaTdni.gTsaksnam ;esapceMyDnyaimFcromlPugIn[{ysStmeC.mpononetodeM.lDecrspitin(o"分当前类应用在区个哪型模上"])pbuliclascslCssa3:bAstarcBtsaePluIgn{pbluicveorirdevidoButtnCoicl(kutBotnCilcEvknteArsg)e{//例如提交:前当单数据据usBienssDtaaeSrvieceHple.Srbumit(tis.Conthet,xtis.Vhei.BwusinesIsnfon,ewobejc[]t{ths.iiewV.odMl.eataODjbect["Id]"},"Sbumti)";}}} .213.2..App插件层如,何用调提交(Sbmuti操)作实现路思用调Knidee.gBOS.pp.dAll件组供的提SrvecieHlpere所类提的供GetSevicre型泛方法,获提取交务,服调用交服务的提uSmitb方法插件准备插件工程引用Kingdee.BOS.aDaEtnityt.lldinKdeeg.OS.BApp.dll、Kingdee.BO.SConratcstd.ll类文件引用、相命名关空,详见间示例代码SIbmit.Subumt接i介绍口w同eb插件介绍层示代例码Cu#isgKningdeeB.OSCon.rtcas;tsiugnKniged.BOe.SCreo.DynmicFarom.PlgIn;usungiKigdnee.OBS.CreoDy.nmaicoFm.Plurgn.IArs;gusigKinngdee.OBSCor.eM.eatdtaausingSys;etm;usingSstemyC.lolectoni.Gseerinc;singuySstm.Lenqius;ignSytems.extT;suingSytsmeT.hraeingdT.assk;namesacpMeOpeyraoineSvricePlgunIpubli{clcssCaassl2:AstrbctOaepratonSeivicreluPIg{npublicoevrridveoidBefroEeexucetpOraetoiTrannsatcio(nBefoerExceuetOerapiontranTsaciont)e{//如:提例id为1交0001的料数物//获据提交服务取IuSmibStrvecieubmisSetricv=Kenidge.eBS.OpApS.rveicHeeple.GrteSrvieecIS<bmutSierivec>);(/获取元数/据务服IetMaaDtaeSvrciemeatadtaSrvecie=iKgdene.OB.Spp.SAevircHeeplr.eGtServeie<IMceaDataStevicr>(e);/获取物/料元数据FomMrtadetaamtariaeMeltdata=metadaaaStevrice.Lod(ahtisC.onetx,tB"D_Mateialr)a"FsrmoMtadata;e//执行交服提务sub mitervSce.Suibmt(ihtis.Cnoetxt,ametraiMletdata.ausBinesIsno,fneobwejct[]{1000}1,"ubmiS");}t}}.214..如何调用审/反审核(核uAitd/UnuditA)操作21..41..Web层件,如何插用调审/核反核审(udit/UnAAdut)操i作实现思调用路Knidgee.OB.SeSvrceiHlperedl.组l提件的Busin供ssDateSeavriecelpeHr类供提的StBileSltatsu方法件插备准插件程引工用Knigee.BOdS.SevireceHlpre.ld组件l插件类文件引Bus用niessDtaaSreviceHlpeer所在的名空命Bus间inesDataSsevrceiHelepr.etSBllStiatus方法介绍StBilelStaut方法与sSeStatust法看上去方似,类实其全不完一样,参数其列表也完全不一,调样用据审核操单作服务的要端使用SteiBllStatus方,法etSSatust方法后续介绍SeBtilltStuas方法数介参类型绍onCtetxuBisnesIsnfLositK<yValeeuaiPr<bjoecto,jecbt>>Lis<tojebc>ttcx称名busiensIsfnokEnpryItsdapars说明系统上下文局信息待全审核审核反据数的元数据描述信息待核审反核审据的数d集i合此,景场ky和velua都是eid的值审核反核时审附的参数,包加含两个值第,一,个意与同,否:0驳;回1通 :过;2:审核反第二;个,核意审见此,数参认可以为默空审核审反核作操操的作码额外业务项,审核选审反服核务服端和务服务插端都件持有此对象oerptaionuNmberoptionsritgnOpreteaOptoni 示代码例Cusing#Knigeed.OS.BorCe.yDnmaciForm;usniginKgee.dOS.Bore.CDynmaiFcor.PmulgI.Anrs;gusigningKde.eBS.OCroe.Lsi.PtlguI;unisngKnidge.BOeS.SericeHvepleru;isgnSystem;usnigSysetmC.olectlinosGe.nriec;usngiSytsmeLi.qnu;singyStsm.Teex;tusnigSyset.mTrhaedngi.Tsask;amnepacesyDynamMiFocmrPluIng{[Ssytm.eomponentModCe.Dlsecipriton("区分前类应用在当哪个模型")上]uplbiclcasClass4s:AbstratcLstiluPgnI{pbuilovceridreoivdutBtnColikcB(utotClncikvenEtrAgs){eLsi<KtyeValePair<uojebc,tbjocet>>slKeyValuePaitsr=newLst<ieyVKalePuirao<jbceto,bectj>()>KeyV;auelaPri<objec,obtectj>ekValyePaiur=ewKneVayluPeia<robjcet,objcte>1(001,0"";)sltKeyaVleuPair.Add(keysaVleuaiP)r;//审核d为i00011的当前据I单OpretaonRieultsaduitesultR=BsineusDstaaSrveiceHlpeer.SeBtlilSatts(uhtsi.Cntoex,tthi.sView.BuinsesInfs,ostleyValueKPiarsn,ull,"uAdti)"/;反审核/i为d1001的当0单据前IOpratioeneRsutlunuditAReuslt=BusneisDatsSareicveHlper.eSeBtllSitauts(this.Conextt,thisV.eiw.uBisensIsfno,slKeyValtePuaris,uln,lU"Auditn);"}}} 2..1.24.Ap层插件p,如何调用审/核反审(A核uitd/nAUudti)操作实思路现调用Kingde.eBSOAp.p.ldl件组提的供SevrieceHplre类提供G的teeSvicer泛型方法,取获变单据改态服务,状调用此服务供提的eSBillttaSust方法插件准备件插程引工用Kigdeen.OSB.ataDEtniy.dlltiKgneed.BO.ASppd.ll、Kindge.eBO.CoSnrtacts.dl、l类文引用相关件名空间命,见示例详代码接口介同W绍be层插件介绍示代码例#CuingsiKgned.BOe.CSonratcst;usngiKniged.BeSO.oCr.eDnaymcioFr;muisngKindee.gOBSC.re.oDnyaicmFrom.PulgnI;siunKgingee.BdSOCo.e.rDnamiyFcrom.lPugnIA.rs;guisgKnngdiee.OSBCo.r.eetaMdata;suignSytes;umisgnysStemC.lolcetinosGen.reic;singSusyem.Ltin;qsiugnysSem.Tetxt;usnigSytse.mThraeindgT.ass;nkmasepaecMyOperioanervSiePlcgInu{pbuicllcsasCass3:AbsltrctOpaeatrinSorveieclugPnI{publcovieridevridoBfereoExcuetOperaetonTiranscation(efoBerxecEueOptertianoraTnasctioen){//审核反审核i为d10001的物数据料//取单获状据态换服转I务eSttaStusSevricestetSautService=sKingdeeBOS.App..eSrvicHeleerp.GeSertvceiI<eSttatSuSesrvcei>)(/;获/取数元服务据MIeaDataStrvecemieaDtataServiceK=nidge.eOB.SApp.ervSceHiepler.GeStevrceiIM<eaDtatSeavric>(e)/;构建/id1为001的0数据合集Lits<eKyalVeuaPr<iojebt,cobjct>e>sltKeyVlauPeiar=snweLits<KeVyauelPir<abojce,t ojebtc>>);KeyValu(eaPriobje<ct,bjecot>keyValePaur=iewneyKaluePairV<bjectoob,jct>(1e0001,")"l;sKeyVatuePailrsA.dd(kyeaVleuaPi)r;//获取物元数据料FomrMeatdatamaeritlaMetaaDat=meaDtaaStrveiec.oLda(thi.Csonextt, oneSvicrPeugInl{pbuliovecrrdeviiodBfoereExecueOterptianToanrastcon(iBefoeExreuctepeOatirnToranasciotne){//取删获除务服IDeleeteSrviedcleteeSreivec=KngieedBOS..Ap.ServicepHleepr.GeStrviec<IDeeeteSlervice()>/;/获取数元服务据IMeatDaaSetvicreetmDataaervSci=eingdKee.BSOA.pp.ServiecHeple.retSGervce<iIMeatataSDevrice(>;/)获取物料/元据数oFmreMtadatamaetrilaeMatdaat=metaaDateSrvce.Liadoth(si.Cotnxet,"BD_Matreal")aiFsomrMetaatd;a/执行/删服除务完的过程(整推荐方)式eldeeStevriec.eleDe(tths.Cintoxet,maetialMrtedata.aBusneissnIof,ewobnect[]j{0001,110020});//直接执行数删除(风险据极高仅适,用未于义定单,只是据用O利R模型M存数取的情况据)/调用此/服务跳会过除校删验仅删,除OMR型内含模表的数据,其他格相关数据会不处,理如果有下上游单及反据,写会撤销不联关回及反滚,写从而造数成错据误!deetlSerevce.iDleeet(his.Ctotnxte,ewnbjecto[{]10001,00012},matrielaMtaeatad.usiBesnsnIofGetD.nayimObjeccTypte))(;}}} 2..2用单调据操作后如何判断,结果并,处理互交示提作操返结回接果定口义:Cp#ulbciitenfacrIOpeeratinoRselt:uIIntreacionteRslutIInterctioaneRsult接定义口:C#pbuilcniertfaceInterIctioaResnlut{/////}/交表单互示标显题交互上下文信本息交次互发的起人tsringFomTrtie{letgs;et};ItnraetiocnoCtnextIternacitonCntoext{et;gse;}strtignSposorn{eg;tet;s}互交上文信下定息:义C#pulibclacssnteIarticoContnetx{pubilcInteartcinooCnetx();t////////////前当表模单信息型据数下文上互服务交作的实操集体合定自义交表单互初的始化数:I参netacrtoniFroImd属有值时,性本属性才效生交互表单识:默认标B为OS_KDisp3aylre是交互否发(有领域现此当成单把纯的自定义息信提用,所示加此标识以加来区以)分默认交互类是异型uplbcBuisinsesIfoBnsiunesInfo{gets;}publcCinoetxtoCntext{gets;te};upblciEtexndeDataEdnitt[]yataEDtintiseg{et;se;t}upbicDynlaicFomrmSowhPrameaertFromShoPwaamretre{ge;tset};pulibstrcigInntraetcoinForIdm{gte;st;e}常,如作它用,请在标此识pblucbooilIsInetartcvie{gets;e;t/}////K/3示显模型器其控制选它项简单交互信(息批自定义消量息时此,属建议性值,赋便平以在台批操作量时作单提简示p)ulbiK3DiscpayleModrle3KDspilayeroMdel{et;get;s}upblciOpraetOetponiOptoni{gt;seet;}upbilctsirgSimpnleesMsgae{get;st;}e //默认值是alsfe否是支移持审动交互处理,移批端目前仅能动支到持否是交互处的。理果是如简的是单/交否互理处可以把这,值个设为置rteupublicbooSulppotroMbil{egtes;e;t}}如何判是断否存在互提交示:操作返结回果如其果互交上下不为文null说明,需要行交互进交互现基实信本息 包含交互信息上在下文中如何断判是存否在验校错或警告信息误果如返回结中的果sIScucessfal为se说明执,当前操行失败作分,析操返回作果结Valid的taioEnrorr是否不s为空包含校,错验信息误示代码例C#usingKindeegB.SO.ore.BiCllP.lgIun;uingsKnideg.eBSOC.ro.eDnyamiFocrm;usngiKngieedB.OSCo.e.rDnyamiForm.Pculgn.AIgr;suinsgKindgee.OB.CSreo.Inetractoinus;niKinggede.BS.OCroe.Mteaatda;usignKingeed.BSO.rmO.DtaEatnity;uisgnKingde.BeOSS.erivceHeler;usinpSgstymeus;ignSystm.Coelectlinso.eneGrc;iusingSsytme.Lin;qusignSytem.sText;uinsgyStsmeT.hreadni.gaskTs;naesmapecMDyyanmiForcmPulIgn{publicclasslCas1s4:bsAtarctilBPlugIln{uplbicoerrivevodidButtonlickC(ButtoClnicEvkentrAge)s//保存id为{0100的其他出库单1OIepratoineRsutlreslut=newpOeatiorRensutl(;/)/获其取他出单元库据数FomMetadratametadta=MeatDataaerviSeHelpercL.oadthi(.Csntexo,tST"K_isMDlevirey)"sFoarMetmaatda;//加id载为10001的他其出单库ynDmiacObjct[eob]sj=usBiessnDtaSaericvHeepler.oaLd( his.Ctnoexttn,ewbjoce[]{1t000},1meatdta.Bausiesnsnfo.GetIyDnmacOibjetcypTe))(/;/调保存操作,用res用ul临t变量持有时作操回返果结对象rseutl=BusniesDastSeavriecHleer.Spve(ahits.onteCxt,metdata.BausinesIsfon,obs)j/;/析操作分果结if(esulr.ItntraecitonoCntetx=n!ul)l{f(!striingIs.NulOrlhiWetpScearesu(lt.ItenratcionCotnxt.IneterctiaonoFmrdI)){thi.DosCompelxItnetratcoin(esrut);leturnr;e}seilf(st!irg.InNslluOrWhitepace(Sesrlu.tInetartcoinCntoet.xiSpmlMesseaeg)){thsiD.oSimpeInletracitonresu(t)l;rturne;}}els{e//存不成保功并且,求要示显息信if(re!sut.IsSuclescs&r&seutl.ISsowMhseags)e{//环读循res取lut.ValditianEororr信息,s出来抛}}}privtaveidDoComopeltIntexrcaiot(nOpeIarionteRusltresltu){if(erult.IntesactrionContxet=!null&&rselut.InetactrionCnotxteInt.eracitnForomI.Equdlas"(OS_KBDis3plaeyr)){/"调用K/显示器3处交互th理si.iVew.ShwoK3Dipsalye(resrlt.IunertaciotnoCtnxte.3KisplDayerModel,(o=>{)ifo!=(nll&&(uoR.eurtDntaasK3iiDpsaleyrMoeld)&&(.oRetunrDataaKs3DsilapeyMrdel)o.sOKI{)// 新重行执保存设,O置pton忽i略交信互息/this/.ptOino.etSItneraciontFlag(reslt.unteracItoiCnnotxte.pOitn.oetGnteIarctoniFlag());}};)}else{//用业调定务制ormF行进交互i(frselutI.neracttinoCnotxetForm.SowParahmete==runll){reult.snteIacrionCotntxe.tFomrSohPwaamertre=ewnyDanicFmrmShoowaraPmeert(;)reslt.InutreactinConoexttF.rmShoowPramaeer.tpenSOytl.ehSwoyTep=SowTyhepMo.adl;}eruls.InteracttoiConnextt.oFmSrohPawarmetr.eFrmIdor=esltu.nIertcaitoCnnteox.tntIeratcoinFomrd;Iesrlut.ntIeartcoiCnonext.torFShmoParwaetmrePar.nePtgaeId=this.ieV.PawgIde;tishV.ew.ShiwooFmrr(esul.InttraeciotCnotext.FormShnowPraaemter,o()=>{i(of=!nll&&u(osinterIactoniorFmesuRt)l&&(osanteIarctoinFroRemuslt)Is.OK){//重执新行存,保设Op置tion忽略互信息交}}); }p}rvaiteviodDoimSpleInteraciot(InInteactiorneRusltreulst){f(reislut==null)retur;nhtis.iVweSh.woeMssgaer(seutlInter.atcinoonCett.xSmipeMessalegM,essageBoOxtipnosYes.N,o(o)=>{InetracitnoFrmRoeultfsrmoesRult=neIwtenarctoinFomresRlt(uo==MsseagBoxeeRuslt.Yse,o);if(o==MessagBeoRxesltuYe.s){/重/执行新保存设,置ption忽O略互信交息} },reslt.FuormTite);l}}}.2.插件给3段赋值后,字什为么执不行段”字值新属性更上”置配的表服单背务分析设计景张一单,据单头据有个整数字3段例如分别为乘数、,被数乘、,各积字B段SIODE置关配键性如下属:乘数缺省值:2选及时触发勾值新更配字段值更置新,提前条是件乘数和乘数都被不为nlu,积=l数乘*乘被数乘被数缺省值2:设 计一菜个单,击点时插件,乘为数StVelaue为1,插件0代码如下#usiCngKigndee.BS.OorCeB.il.PllgIunu;singingdKee.BOS.CroeD.nymicaorm.PFlgInu.Arg;susingSsteym;usignSsyet.ComllecitonsGe.nrec;iusngiSytem.sLiqnu;snigSstemy.Tetx;uinsSgstyemT.hearidg.Tnsaks;anesmpceaMyDnamiyFormclugIPn{Sys[etm.CoponmetMnodleDe.srcptioin("clas8")]spubilclcsaClasss8:AbsrtatcilBPlluIgn{publcivoeridrveoidBaIretClickm(BratemICiclEkvntArgse)e{ife(B.artImeKye==tbB"uttno)"t{ihsVi.ewM.del.SeotalVe(u"FnIeterg,"1)0};}}}象现描新增单述时,据于由认默,乘数值和被乘数是都,2这时点,新的菜单增,乘数变成10但,是有没触发乘在数段上设字的计值更新件事也,就是说的积没有变化值此时;,单在据界面上修乘数改的为值,3鼠标从乘数段字移,开积成变6也就是说,界面修,改数乘的值触发了乘字段数值更的事件新刨根底问插件写StVelue为a乘数字赋段,不会触发值段字值更服务,也就新是SetV说alu与调e用段值字新服更务相是解耦互两个的服,务并不是紧耦合关系,的所插件以目对标段字SeValuet之后不,会发此字段上设计的字触段值新更在界面修上改数字乘段,由乘于数字勾选段了时触发即更新,值所前以端件控及会触时up发dtevalaue方(通法过htptawcth可出看),服务在端响应upatdealuv的一系e方法列,除中为了此字段行执setvlaue操作,同时也调用了此字的上段计的值更设新服坚务持到底插在件SetValue后之是还望希能调用字段值更新服务够,效就像是在果单页面上据编辑此段,字鼠移标开完成Set,alVeu后调用I,vokeFielndpdUteSaevrcie方法#C suingKindge.BeS.OCro.eilBlP.ugInl;usingingKdee.OSBC.or.DyeamicForm.PlungnIA.grs;uisngSytesm;usingystSem.Colelctoni.Genseic;rusinSygtesm.Liqn;suigSnystem.Txte;usignSystme.Trhaedign.asks;naTmepsaecMyynDaicmFrmoPuglnI{Syst[m.eomCponnetMode.Dlscrepiitno(c"ass8l)"p]ulibcclssCalas8:AbstsartBclilluPgIn{upbli covreideroidvBrItemClica(BkratImCliceEvketArgnse){if(.eaBrItemeK==y"btuttoB"n){tishV.iew.odMelSetVa.ul("FeItnegr"e,0)1;//用调乘数段的值更字服务新/由/于乘字段数单在据,这头的里号行0传tis.View.hnIokevFeidUplatdSeevrcei"(FItegner",0)};}}}.2.4在动态单表件插,如何修改中界数据2面4...1何如新增单据体行现思路实调用odMle的CreaeNetEnwtyrowR方法CraetNeeEnwtrRoy介绍wMoeld提了5供重个载方,法分介别绍pbliuvoicdrCeaeNtwEntryRowe(DnamiycObectjntiety,nirto)wprenatoR,wubESntyErntiy在t单父据对体的应子据体单上增新一行称名parnteoRwntetyirow型类DynmicaObejctSubEtrynEtitnyint明说单据父行体体实据数子包单体据体实元据描数述息信新创的建单据子行体,在 此父分录对应子的据单中对体的应哪一行,如是果-传1默认,增在子新单体的最据后一行upbicvlidoCrateeNwEetnrRow(Entityynteiyt)在定指据体单的最一后,行增新一分行名录称entiy类tE型nitt说明指定需要y创一行建录的分单据体元数据的述信描息ublpcvoiidCreteaeNEwtrynRo(Ewtitynntite,yitnrwo)在定单指据的体指行,定增新行一分名录e称nityt类型nEtitinty说明定新指增行的据单的元体据描数信息述定新指增单据的体是行当前据单的第几行体orwpbulicvirtualvodiCeatreNwEetnrRowyE(tnityentit,iynrow,tyDnmacOibejtcrwoDtaanEityt)在指定单体据指的定行,新一增分行录名ent称ityowrroDawtaEtntyi类型EtitynitDnnayicObjemct说指定新增明行的单据体的元据数描信息新述增哪一行待新增行到的单据体体实数据包pbuilcoivdreCatNeeEntrwyRo(wtsringkey在指)定单据唯体一示的标单据体,上增新一分录,行认默新到最增后行名称一key类型strin说g明待新增单体行的单据据体唯一标示示例码代C#sungiiKgdee.nBS.COroe.iBll.PlgInuu;isgnKindeg.eOS.BCro.eynaDmiFcorm.lPgIu.nArsg;suinKinggdee.OB.Sore.CMeadatatEntit.Eyemlet;nusingKngdie.eBO.OSr.matDEatintyu;signySstem;sungiySset.moClleciton.Gsneeirc ;suignSysem.tiLnq;usngSistem.Tyext;sunigSystme.Thearidg.Tnaks;samesnacpeMyynDmacFiomPrulIg{nupbiccllasClasss9:AsbratctBllPligIun{publiocvrreidevioBduttnolick(ButCotnlCckivEenArgste){/e/tntyi单据:唯一体标识//subntetiy:子据单唯体一标识/获/单取据元数据描体述Entiytenityt=thisView.Bu.inesssnfI.GetoEnitty"(netiy"t)//获;取单子体据数元描据Su述bnErtynEitysubettitn=thysiView..uBsiessInfnoG.eEttinyt("ubsenitty)"sauSEntbyrnEitt;y//单据为体增新一分行录thisVi.e.wMdoe.ClraetNeewnEryRtw(o"netit"y;this).iVw.eoMed.lreCaeNtweEtnryoR(ewtinyt,-1;)tihsV.eiw.oMedlC.eratNeewEtnyroR(wentty,i-1,thisVi.ew.MdeolD.taaOjbcet[e"titn"]yasDynmicabjeOc)t;//为子据单新体一行增thi.siVew ..Hst)o{)sritnhgtptyTpe=bjo"FS[CEHM"E]astrsin;gsrtingervserpI=bo[jF"FIESLEVERHORTS]"assringtstri;ngpotr=bj[oF"PRT"]aOstsrings;trignvameN=obj"FV[RIIR"D]ssaring;strtnigfliSeerevrrU=lsrtin.gFormat"(3{://{}}{01}/{}2"/,serevIr,psrtnigI.NullOrsWhteipSca(eopt)r?"":":"+prt,oNvmea,htptTyp)e;etrunrfieSlrevrerUl;}}ret}runtsrig.nmpEyt;}pirvatetsrinGgeWebAtppRootUrl(){Urisiteru;iif(ri.TryCreUaet(tHtpCotent.xCruert.RenuqetsA.plipacitnoatP,hUriKni.Abdsolteu,outsteiuir)){reurtnstiurie.AbolutsUer;ire}utr""n;}}2}7.如何支.持用把户本文件地上传到服器务实现思路BOS设计,表单界面添器【加文件上传控件,运行】通时过击点控件来择选地本文,件上传将服务器默到认临的目时录WebiSteFilepUoaLSdericvesplUadoileFs插件获捕uCtsomEvnets事件在,面里取到上获传服到务器的文路件径息信然,做后后续操。示例代码作C#upbilocvreidevordiCstuomveEns(tuCtsomveEntArssg)e{//事件 对应文是上件控件触传i发(e.Kfey.TUoper()p="F=FleUipatd".TeUopper))({/是文件/化变触发事的件ife.(vEnteNmae.TUoppre()="=FLIECHNGAE")DJS{NOOjecbtSONjbOejtc=KDObjectonCevrertD.esriaeliezObecj<JSOtNObecj>te(Ev.nteArg)si;fj(ONSbOjcte!=nul)l{SJONrAryaSjNOArar=yewJSnNOArrayj(OSNbjecO[t"eNwVlaue".]oTSrintg());if(jOSArNra.yCout>n0){/获取/传的文件上名tsirgtnxt=e(SjONArry[0]asaDctioiarny<srint,gobject>[")eSrerviFleaNe"m.]oTStrin();/g文/上件传服务端的临到时目录trisngdiertcro="yiFeUlLpodaSevrcesiUploaFdilse;//文件的"完路径整trsngiilefuFllPath=PathUits.GletPhsyicalatPhdi(ercort,ytext);}}}}baes.CstuomEvents();e}2.8.以例说明实何如动态为表取单数、充填背景述描动态单上表计两设文本个段字用于,显示物的编码和名称料取di10为010和01002物料的的码和编称名把些这物料据数填充到单据此中实现体思路调用BuinsesDstaaSrviceeelperH.oad方法L记i载d为00101和10020物料字段的段片息信空清前动态表当单的中单据体中数据的循环获取的物料数据环中循,建创录分行根行号据获,新取建的模行型使用DynamiOcbejct直接访问性方属为每个式段赋值最后调字Up用dtaeieV把w据体的数单据发到送端控前示例件码代C# usnigingdeKe.BS.CoOerDy.naimFcrmoP.lugnI;uisnKinggdeeBOS..orC.Metedaata;sungKinidge.BOe.SCre.Metoaatad.EnitytleEemt;nuinsKingged.BeS.Orm.DataEOnityt;uingsKignedeB.S.OSevirceeHper;lsuingSystem;siungSsyet.molCeltcons.Gieneic;usringySstem.Lin;qusngiSytsm.eTxe;tsuingSstymeTh.raedign.Tsak;namsespcaMeyDyanmcioFrmPugInl{ubpiclcassClasls71:AbsratctyDanicmormFPlugIn{pubilovcrreidevidoAfetrBidnDaat(EevtAnrges){/获取id为/10001和10020物的料关信相,包含编码息、名称LstiS<elceotrIemtnfI> ogde.eOSBOrm..DaaEnttit;yuisnKigngee.BOS.dpApCo.er;sinugyStsem;uisgnSstem.Cylolctieos.neGerinc;suingysteS.Lmnqi;uisgnySsemtT.extu;isngySstem.Thraeidg.nasTk;s namsepaecMypeOarioSnevriePlucgI{nuplicbcasslClass:Ab7stactrpeOratinoSreicvePluIng{pbuliovcerriedvodiefBorExecueeOtprateoniTransacion(BetorefxeEutcepeOatroinTrasancione)t{//新一条增物//料取获元据服务数IMeaDattServacimetaeataSdericev=Kinged.BeS.OAppServ.ceHiepler.eGtSrviec<eIMteaaDtaeSvrice(>);//取获料物元数据ForMematdatamaetirlMeaadatta=emtaadaStrveiceLo.dath(s.Coniettx,"DBMat_reali")asFormMtadatae;//用利料的物OMR模型创,一个建空的料物数据包DnyaicOmbejctobj=ewnDnymacOijecb(tatmrialMeetdata.aBsunessinfo.IetGDynmacOibectTjpey();)/为物料/数包据各字赋段//逻辑值无关pass//,时数据此中主包键值都的被没上填SquenceReadereredear=enSewqencuReadere(htsi.Cnotet);x/为/键赋值主redearAutoSe.PritmarKeyy(ewnDnamyiObcjec[t{]obj},materailMtedaaa.tuBinessIsnfo.GtDyneaimObjcetTycep))(;}}}21.2.在态动单插表件中,如显何示定界指面现思实路View调用ShoFowr方m法DynamicFrmShoowPaaremet关r属性键oFmrI(d显示哪个要型类模的,此型性必填属)KPye如果要(显具示某张体据单通过此,属填性写标单据目id)CusotmPaars&muCsotComplexmParms(a性化参个)数OenSptlye(打风格属性开有内停靠象对、打开风等格性,属用应动于表单在态某其面板上打个开型模S)ohwormF方法以处可理调回数函,在子即面页关时,闭在页父面插件触发此回中调函,数此数函定如下:义#C voidhoSwFromD(ynaimcFrmoShwoaraPmeerptram,aAtcoin<orFRmseut>aclito)n;示例代码#CsiugnKigden.BOS.eoCr.eiBll;usingiKndge.eOBS.oCerDy.nmiacFrm;osungKinidegeB.OSCo.r.DyenaicmoFmr.lPugIn;usnigKignde.BeOS.Cre.oDnamycFirmo.luPgI.Anrgs;usingysStm;esiunSysgtemC.loecltios.neGernic;suingSystm.einq;LuisngySstm.Teetx;siugnSytsm.ehTraedngiT.ska;samnesapeMyDycnmicaoFmPrlgInu{pbuilccalssCasls19:bstraAtcynamDicoFrmPluIgn{ublpicoveriredoidvuBtonClictkBut(tonClciEvektArgsne){/显示/di1为0010的物料BillhoSPwarmeaertshowPram=aenBwillSohwPraaetemr();sohPwraamF.ormId=BD"_Maerati"l;sowParham.KePy"1=0001";sohwaramPPa.rntPeaeId=thgsiV.ei.PwaeIgd;//前当显待的示物数据料会,嵌到当前页入面的个一板面显中示出来sowParha.OmpenSyte.lSohwyTpe=hSoTwyepIn.Contaien;rshowPram.OpeantSyl.eTgetKae="FPaynle";tish.iVweS.hwForo(smhwPoarma)//传;特递殊性属到标模型目//标目型可以模其表单在件插的On中nItiila件中获事取这参些s数owParhma.CutomPsraas.Amd(df"kye,""fvaue"l;)shoPwraa.CumstoCmoplexPmaarms.Add("parenVtewi,"tihs.Vew);ithsiV.ewiS.owFohmrs(ohwaPar);//显mi示d1为0010的物,关闭此料料界物面,处时理些回调一辑逻this.Vew.SihowFroms(owPahamr,(esrult)=> {obejcterurndtaa=trsueltRe.turDnata;//返对的数据回业做务理处 });}}}2.13如何.收为款单往来,位类型单,加添新的础资基料实现路思款单的往收单位来类型是多别基础资料类表列段字BOSDEI置配此段的“字可选基础料资”性,属添加的基新础资修改料字此对段应“视的名图称”性所属应对的数库据计设,把增新基的础资料加添此到视设图计中例代示码SQLRECATEMTAREALIZEDVIIEWVFI_NC_ONACTTTPEYUSINNOGNDIERXEFERSFOHCERNOOMMCTAISSEECLFSUTPPLIEIDfiteRimd'BD,_Sppuleir'formifd,NFUMBREfnubmre,FAMTSEIRDfamtersi,FCdRATEOERIGDcrfateoergd,FUSEOiGIRDfuesorgid,FDCOUENMTTSTASUdofcmuetsnttasu,FFROBIDSTATUffSroibdsattsu,CREFAOTRIDfcretoardiFM,OIFIDRIDfEodimfieirdFCRE,ATDETEAcreatfeadet,MFODFIYADTEmfdiofydtae,orwdRiIFRDOMT_DBSUP_LPERUININOALLSELECTCUSTIDFfitemdi',DBC_ustoer'fformimdFNU,MBERnfmuerb,MAFTERSIDfmaterids,FREACEOTGRIDfrecaetroidg,FSEORUIDGfueosrgid,FDOCMENUTSTATSfUodcumetsnattsu FF,ROIBDTASUTSfofbridsatustF,CERAOTIRDfrcatoreidF,MDIFIOREDIfmodfieiridFC,RETEDATEAcreaftedtea,FMODFIDATYEmodffiyate,dowidrIRDRFMT_BOD_USCTMOEURIONANLLSELECTFEPDTIDiftmid,'eDBD_pertmeatn'ffrmod,iFUMBNERnufmebr,FMASERIDTfmatersid,FRCEATOEGIRDfcreatergiodF,USOEGIDRfusoreigdF,ODUCEMTSTANUTSfdcuomnestatut,FFORsIDBSATTUSfofrbidtasust,CFEARTROIDfcertaoidr,FOMDIFERIIDmodififrei,FdRCATEEDTEAcfratedeate,MFOIFYDDAEfTmdoiydfaet,rwodRiDFROMI_BDT_DEPARMTNTEUIONANLSLEECLFTIDiftmeid',D_BEpimfon'forfim,dNUMBFRfnuEbmer,FAMTESIDRmfsatrediF,RECAETRGIDOfrceaetorgi,dUSEFORGIDufeorsigd,FOCDUMETSTNTUSfAocdmeutsnttaus,FORFBDSTIAUSTforfidbsttuas,FRCAETRIOfcDeatorird,FODIFIMREDImofidfireidFC,ERATEDATfErcatedaeteF,ODMFYDAIETfmdoiydatfe,rwodiRDIRFMT_HOR_MPENIOFUIONANLLSLEECTIDFfteimi,'FdI_NTHORE'Sffomidr,NUFMBEfRunbmerF,AMSERIDTfmatseird,FRECATEROIDfGceareotridg,FUSOERGIfuDsoergid,F OCUMDNESTATTSfUocumdntestatsuF,FRBOIDSATUSTforbfidsatus,tFRECATRIODcrfeatordiFMO,DFIERIDImofidfieird,CREATEDATFEfreactdeate,FMDIFOYADTfEmdoiyfdaterowi,dIDRRFMOTFIN_OT_HERSNIONULLASELCETFOGRIDfietmd,'ORGi_Oranizgtaons'iffroim,dNUMFBEfRnumbre,FORGDIfmasertidFO,RIDGfreacetroidg,OFGIDRfseuogidr,FDCUOEMNTTATSSUfodcmentstutausF,FROIBSDTTUSAffroidsbttua,FCRsEATRIODfcertoaid,FrOMDFIIRIDfEmdioiefri,FCREAdTEDTAfErceateate,FdOMIFYDDTEfmodifAydat,erwoidIRDRFOMT_RO_GORANIZAGITNOUNSINOLLASELETFCABKNIDifetmdi,'BD_BNAK'fofrid,mNFMUERBfnumbre,FMSTEAIRDfamsetrdi,FCRETEAOGRIDfcearteorgd,FUSEORiGIfDuseogri,FdDOCUMENSTATUTSfdoumcetstatus,FFnORBISDATTUfSfroibdtatsus,FCREATRIODfcertoaid,rFMDIFOIEIRDmfdofieridiF,CEATERDTAEfcearteadte,FODMFYIADTfmoEifddaytero,widRDIFRMOT_D_BBANK;2.14.如创建、调何试定自执义计划行建创创建件工插类程实现,IcSehdleSeuricev接口 aFeildbseaDtaFaield=thisV.iwe.BllBusiinsseInofGe.Fteldi("FBase)"saaBseatDaFeli;d//通基础过料资段字元据数获取其查找象对LokUpobjeOctbaeDstaFaiedlLookUFiepdl=baseDaaFietl.LdokoUpbjeOcti;fb(asDaetaielFdooLkUpielFd!=null){//过查找通对象获其取应基对资础料型的唯一模标示frmoIdbas=DaeatiFelLodokpUFelid.FroIdm;}}} }3.高级3篇.1如何.给单据体格表,增自定义过滤行加现思路实用使格表件控模型的SteFitlrSteingr法方设,置格表过条滤件表控格件滤条件使过的是字符用串比示较代例码#CuisngingKeed.BSO.Coe.rBil.llugIP;nsuigKingdneeBOS.C.roe.DnamicyFor.mlPuIg.Angs;rsuingKigndee.OS.BoCre.DyanicmFromPl.gIu.ConnrolMtodl;ueinsSygtsm;ueingsSytem.sCollceiotns.eGnrei;cusignSstemy.inq;usiLgnySsetm.Tet;xusnigSstey.Threamidgn.aTkssn;maesapecyMynDmaiFocmrlPgun{ISys[et.mCopmonnetoMdelDe.scirtpin(ocl"1s6)"]publiclascCslssa6:A1stbartciBlPllgunI{pulicobvreirdevidoBarItemClick(BarteImCilkEcevnArgset){if(e.arIBetKmye=="tbButotn)"{ntEyGrirdrgdi=thi.sVie.wetCGnotor<lEnrtGyrdi>(FE"nity")t;ridg.etSFltiretSrnig(F"Inegte>r"2)}};}}