Hi everyone,
I have small problem with that script.
I look at bulkretrieve methods and i think i wrote this code correct, but there is some errors...
I wrote earlier codes with this method and everything was ok.
Can anyone tell me what is wrong and why i get this error?
Error: ByRef data type mismatch
Sub POST_BTN_dummy_Click(ByRef br As bulkretrieve)
Statistic_Save 7280,true
Dim pq As New PowerQuery
Dim lstRet As New list
Dim recRet As New record
pq.setObjectType 0, g_ModLevel.Value ' czy dobrze aby uzyskać rekord mod_level?
pq.appendFilter 0, c_PartInfo2sitePart_SitePart2case_1 , g_IsEqualTo_1.Value, cGetField(COBJ_case_obj, g_Objid.Value)
pq.Query
set lstRet = pq.retrieveRecords(0, g_ModLevel.Value, 0)
set recRet = lstRet.itemByIndex(0)
Dim lstCase_block_action_conf As New List
Dim recCase_block_action_conf As New Record
br.SimpleQuery 0, "x_case_block_action_conf"
br.AppendFilter 0, "x_case_object_type" , cbEqual, cGetField(COBJ_case_obj,g_XCaseType) ' Error : ByRef argument mismatch
br.AppendFilter 0, g_XCaseObjectSubtype.Value, cbEqual, cGetField(COBJ_case_obj,g_XCaseSubtype)
br.AppendFilter 0, g_XBlockConf2modLevel.Value, cbEqual, recRet.getField(g_ModLevel.Value)
br.RetrieveRecords
Set lstCase_block_action_conf = br.GetRecordList(0)
Set recCase_block_action_conf = lstCase_block_action_conf.ItemByIndex(0)
If Not IsEmpty(recCase_block_action_conf) Then
Set pq = New PowerQuery
Dim lstRet1 As New List
Dim recRet1 As New Record
pq.setObjectType 0, g_PartNum.Value
pq.appendFilter 0, c_PartNum2modLevel_partInfo2site_4 , g_IsEqualTo_1.Value, cGetField(COBJ_case_obj, g_Objid.Value)
pq.Query
Set lstRet1 = pq.retrieveRecords(0, g_PartNum.Value, 0)
Set recRet1 = lstRet.itemByIndex(0)
Dim lstChild_ex_def As New List
Dim recChild_ex_def As New Record
br.Clear
br.SimpleQuery 0, "x_child_ex_def"
br.AppendFilter 0, g_XChildEx2parPartNum.Value, cbEqual, recRet1.GetField(g_Objid.Value)
br.RetrieveRecords
Set lstChild_ex_def = br.GetRecordList(0)
Set recChild_ex_def = lstCase_block_action_conf.ItemByIndex(0)
Dim lstMTMtechnology As New List
Dim recMTMtechnology As New Record
br.Clear
br.SimpleQuery 0, "mtm_mod_level88_x_technology5"
br.AppendFilter 0, g_XModLevel2technology.Value, cbEqual, recRet.GetField(g_Objid.Value)
br.RetrieveRecords
Set lstMTMtechnology = br.GetRecordList(0)
Set recMTMtechnology = lstMTMtechnology.ItemByIndex(0)
Dim lstMTMcompany As List
Dim recMTMcompany As Record
br.Clear
br.SimpleQuery 0, "mtm_mod_level64_x_company0"
br.AppendFilter 0, g_XModLevel2comp.Value, cbEqual, recRet.GetField(g_Objid.Value)
br.RetrieveRecords
Set lstMTMcompany = br.GetRecordList(0)
Set recMTMcompany = lstMTMcompany.ItemByIndex(0)
Dim Conf2childExDef As Integer
Dim Conf2technology As Integer
Dim Conf2company As Integer
Dim Conf2caseStatus As Integer
Set Conf2childExDef = recCase_block_action_conf.GetField(g_XBlockConf2childExDef.Value)
Set Conf2technology = recCase_block_action_conf.GetField(g_XBlockConf2technology.Value) ' mtm_mod_level88_x_technology5
Set Conf2company = recCase_block_action_conf.GetField(g_XBlockConf2company.Value) ' mtm_mod_level64_x_company0
Set Conf2caseStatus = recCase_block_action_conf.GetField(g_XBlockConf2caseStatus.Value) ' table_case - casests2gbst_elm
If Conf2childExDef = recChild_ex_def.GetField(g_Objid.Value) And
Conf2technology = recMTMtechnology.GetField(g_XTechnology2modLevel) And
Conf2company = recMTMtechnology.GetField(g_XComp2modLevel) And
Conf2caseStatus = cGetField(COBJ_case_obj, g_CaseSts2gbstElm.Value) Then
POST_BTN_dummy.Enable = False
If x_action = "CLOSE" Then
msgbox("Konfiguracja tego zlecenia uniemożliwia jego ręczne zamknięcie")
ElseIf x_action = "CANCEL" Then
msgbox("Konfiguracja tego zlecenia uniemożliwia jego ręczne anulowanie")
End If
End if
End if
I have small problem with that script.
I look at bulkretrieve methods and i think i wrote this code correct, but there is some errors...
I wrote earlier codes with this method and everything was ok.
Can anyone tell me what is wrong and why i get this error?
Error: ByRef data type mismatch
Sub POST_BTN_dummy_Click(ByRef br As bulkretrieve)
Statistic_Save 7280,true
Dim pq As New PowerQuery
Dim lstRet As New list
Dim recRet As New record
pq.setObjectType 0, g_ModLevel.Value ' czy dobrze aby uzyskać rekord mod_level?
pq.appendFilter 0, c_PartInfo2sitePart_SitePart2case_1 , g_IsEqualTo_1.Value, cGetField(COBJ_case_obj, g_Objid.Value)
pq.Query
set lstRet = pq.retrieveRecords(0, g_ModLevel.Value, 0)
set recRet = lstRet.itemByIndex(0)
Dim lstCase_block_action_conf As New List
Dim recCase_block_action_conf As New Record
br.SimpleQuery 0, "x_case_block_action_conf"
br.AppendFilter 0, "x_case_object_type" , cbEqual, cGetField(COBJ_case_obj,g_XCaseType) ' Error : ByRef argument mismatch
br.AppendFilter 0, g_XCaseObjectSubtype.Value, cbEqual, cGetField(COBJ_case_obj,g_XCaseSubtype)
br.AppendFilter 0, g_XBlockConf2modLevel.Value, cbEqual, recRet.getField(g_ModLevel.Value)
br.RetrieveRecords
Set lstCase_block_action_conf = br.GetRecordList(0)
Set recCase_block_action_conf = lstCase_block_action_conf.ItemByIndex(0)
If Not IsEmpty(recCase_block_action_conf) Then
Set pq = New PowerQuery
Dim lstRet1 As New List
Dim recRet1 As New Record
pq.setObjectType 0, g_PartNum.Value
pq.appendFilter 0, c_PartNum2modLevel_partInfo2site_4 , g_IsEqualTo_1.Value, cGetField(COBJ_case_obj, g_Objid.Value)
pq.Query
Set lstRet1 = pq.retrieveRecords(0, g_PartNum.Value, 0)
Set recRet1 = lstRet.itemByIndex(0)
Dim lstChild_ex_def As New List
Dim recChild_ex_def As New Record
br.Clear
br.SimpleQuery 0, "x_child_ex_def"
br.AppendFilter 0, g_XChildEx2parPartNum.Value, cbEqual, recRet1.GetField(g_Objid.Value)
br.RetrieveRecords
Set lstChild_ex_def = br.GetRecordList(0)
Set recChild_ex_def = lstCase_block_action_conf.ItemByIndex(0)
Dim lstMTMtechnology As New List
Dim recMTMtechnology As New Record
br.Clear
br.SimpleQuery 0, "mtm_mod_level88_x_technology5"
br.AppendFilter 0, g_XModLevel2technology.Value, cbEqual, recRet.GetField(g_Objid.Value)
br.RetrieveRecords
Set lstMTMtechnology = br.GetRecordList(0)
Set recMTMtechnology = lstMTMtechnology.ItemByIndex(0)
Dim lstMTMcompany As List
Dim recMTMcompany As Record
br.Clear
br.SimpleQuery 0, "mtm_mod_level64_x_company0"
br.AppendFilter 0, g_XModLevel2comp.Value, cbEqual, recRet.GetField(g_Objid.Value)
br.RetrieveRecords
Set lstMTMcompany = br.GetRecordList(0)
Set recMTMcompany = lstMTMcompany.ItemByIndex(0)
Dim Conf2childExDef As Integer
Dim Conf2technology As Integer
Dim Conf2company As Integer
Dim Conf2caseStatus As Integer
Set Conf2childExDef = recCase_block_action_conf.GetField(g_XBlockConf2childExDef.Value)
Set Conf2technology = recCase_block_action_conf.GetField(g_XBlockConf2technology.Value) ' mtm_mod_level88_x_technology5
Set Conf2company = recCase_block_action_conf.GetField(g_XBlockConf2company.Value) ' mtm_mod_level64_x_company0
Set Conf2caseStatus = recCase_block_action_conf.GetField(g_XBlockConf2caseStatus.Value) ' table_case - casests2gbst_elm
If Conf2childExDef = recChild_ex_def.GetField(g_Objid.Value) And
Conf2technology = recMTMtechnology.GetField(g_XTechnology2modLevel) And
Conf2company = recMTMtechnology.GetField(g_XComp2modLevel) And
Conf2caseStatus = cGetField(COBJ_case_obj, g_CaseSts2gbstElm.Value) Then
POST_BTN_dummy.Enable = False
If x_action = "CLOSE" Then
msgbox("Konfiguracja tego zlecenia uniemożliwia jego ręczne zamknięcie")
ElseIf x_action = "CANCEL" Then
msgbox("Konfiguracja tego zlecenia uniemożliwia jego ręczne anulowanie")
End If
End if
End if