前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >几个有用的LN上传文件必备的数据校验函数

几个有用的LN上传文件必备的数据校验函数

作者头像
崔文远TroyCui
发布2019-02-26 15:16:04
5610
发布2019-02-26 15:16:04
举报
文章被收录于专栏:远在上海远在上海

 有时候上传数据到Infor ERP LN 系统的时候,需要写一段说明放在Session上面,备注一下相关的上传格式,每一次都写Label的话有点麻烦,于是用自定义一个相对长的字符串参数,显示到Session。

 extern domain tcmcs.str80 f.format

before.program:  f.format = "Format:BP,Agency,Item Group,S B Appli.(1=Y,2=N),Country,State,S Zip, E Zip,Rate"

好了,回到正题,以下函数会有经常在上传前进行数据校验:

代码语言:javascript
复制
function domain tcbool valid.bp(domain tccom.bpid tmp.bpid)
{
 select tccom100.bpid
 from tccom100
 where tccom100.bpid = {:tmp.bpid}
 selectdo
  return(true)
 endselect
 return(false)
}
function domain tcbool valid.agency(domain tccitg tmp.agen)
{
 if (tmp.agen="") then
  return(true)
 endif
 select tdwai079.agen
 from tdwai079
 where tdwai079.agen = {:tmp.agen}
 selectdo
  return(true)
 endselect
 return(false)
}
function domain tcbool valid.item.group(domain tccitg tmp.citg)
{
 select tcmcs023.citg
 from tcmcs023
 where tcmcs023.citg = {:tmp.citg}
 selectdo
  return(true)
 endselect
 return(false)
}
function domain tcbool valid.country(domain tcccty tmp.ccty)
{
 if (tmp.ccty="") then
  return(true)
 endif
 select tcmcs010.ccty
 from tcmcs010
 where tcmcs010.ccty = {:tmp.ccty}
 selectdo
  return(true)
 endselect
 return(false)
}
function domain tcbool valid.state(domain tcccty tmp.ccty, domain tcmcs.cste tmp.cste)
{
 if (tmp.ccty="") then
  return(true)
 endif
 if (tmp.cste="") then
  return(true)
 endif
 select tcmcs143.cste
 from tcmcs143
 where tcmcs143.ccty = {:tmp.ccty}
 and tcmcs143.cste = {:tmp.cste}
 selectdo
  return(true)
 endselect
 return(false)
}
function domain tcbool valid.item(domain tcitem tmp.item)
{
 select tcibd001.item
 from tcibd001
 where tcibd001._index1 = {:tmp.item}
 selectdo
  return(true)
 endselect
 return(false)
}
function domain tcbool valid.cwar(domain tccwar temp.cwar)
{
 select tcmcs003.*
 from tcmcs003
 where tcmcs003._index1 = {:temp.cwar}
 selectdo
  return(true)
 endselect
 return(false)
}
function domain tcbool valid.loca(domain tccwar temp.cwar, domain whloca temp.loca)
{
 select whwmd300.loca
 from whwmd300
 where whwmd300._index1 = {:temp.cwar,:temp.loca}
 selectdo
  return(true)
 endselect
 return(false)
}
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2016年4月6日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档