Foxtable(狐表)用户栏目专家坐堂 → [求助]for next代码执行问题【已解决】


  共有1706人关注过本帖树形打印复制链接

主题:[求助]for next代码执行问题【已解决】

帅哥哟,离线,有人找我吗?
浙江仔
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1316 积分:9484 威望:0 精华:1 注册:2010/7/21 14:20:00
[求助]for next代码执行问题【已解决】  发帖心情 Post By:2018/3/30 10:52:00 [显示全部帖子]

如下代码,为什么红色代码不执行?(前提是fdr 有)

Dim fileid  As String=args(0) 'fileid
Dim s4 As String=args(1) '备注
Dim urls As String=args(2) '网址
Dim fdr As DataRow= DataTables("C_PYH_WorkFile_DTL").SQLFind("Work_id='"& fileid &"' and is_active='1' ")
If fdr IsNot Nothing Then
‘这里能执行

    ‘msgbox("执行成功")
    For Each dr As DataRow In DataTables("S_PYH_WCHACT_INFO").SQLSelect("IS_ACTIVE='1' and enterprise_id > '' ")
        If Functions.Execute("getProdCodeByid",dr("enterprise_id")) .contains(fdr("attach_pcode"))   Then
            Dim xdr As DataRow=DataTables("C_PYH_WORK_Process").SQLFind("WORK_id ='"& fileid &"' and dept_id= '"& dr("enterprise_id") &"' And WORK_STATUS='完成' and IS_ACTIVE='1'  ")
            If xdr Is Nothing Then
                
                '加入发送队列
                Dim r As DataRow =DataTables("Wechat_TM_Send_List").SQLAddNew()
                r("WCHAT_ID")=dr("WCHAT_ID")
                r("fileid")=fileid
                r("remarks")=s4
                r("urls")=urls
                r("state")=1
                r.save()
                '立即发送
                '   Functions.Execute("TemplateMessage_send_File",dr("WCHAT_ID"),fileid,s4,urls)
            End If
        End If
    Next
’这里不执行!
   MyTimers("微信模板消息").Enabled = True
   Functions.Execute("TemplateMessage_send_File","otmQFs6MaQBpfCrkihqi_XMw4V4s",fileid,s4,urls)  '这是发送到我自己手机的,测试用的
   ’msgbox("执行成功")
End If



[此贴子已经被作者于2018/3/30 11:16:39编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1316 积分:9484 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2018/3/30 10:57:00 [显示全部帖子]

一楼的代码是将要发送的消息,生成在待发送表中,然后启动计划任务
通过这个启动
MyTimers("微信模板消息").Enabled = True

 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1316 积分:9484 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2018/3/30 11:16:00 [显示全部帖子]

原来我这个代码有问题,导致代码未执行完成

 Functions.Execute("getProdCodeByid",dr("enterprise_id")) .contains(fdr("attach_pcode")) 

 回到顶部