Files
open-insight/LSL2/OIEVENT/OPTIONS/CALL_VISIT_QUERY.CONTACT_IDS.json
2024-03-25 15:12:53 -07:00

11 lines
1.6 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare function entid, repository, send_event, msg\r\ndeclare subroutine rlist\r\n$insert popup_equates\r\n$insert rlist_equates\r\n$insert msg_equates\r\n\r\nCustIds = .customer_info->array<1>\r\nswap @vm:@vm with '' in CustIds\r\nif CustIds[-1,1] = @vm then CustIds[-1,1] = ''\r\nif CustIds then\r\n convert @vm to ' ' in CustIds\r\n\tSelPos = .contact_ids->selpos\r\n\tCurRow = SelPos<2>\r\n\tPopRec = entid( @appid<1>, 'POPUP', '', 'CHOOSE_NAME' )\r\n\tOverRide = ''\r\n\tOverRide<pselect$> = 2\r\n\tStmt = 'SELECT NAMES WITH CO_ID = ':CustIds:' BY CO_NAME BY LAST_FIRST'\r\n\trlist( Stmt, target_activelist$, '', '', '' )\r\n\tChoosen = repository( 'EXECUTE', PopRec, @window, OverRide )\r\n\tif Choosen then\r\n\t convert @fm to @vm in Choosen\r\n\t\tCurArray = .contact_ids->array\r\n\t\tCurArray = delete( CurArray, 1, CurRow, 0 )\r\n\t\tCurArray = delete( CurArray, 2, CurRow, 0 )\r\n\t\tCurArray = insert( CurArray, 1, CurRow, 0, Choosen )\r\n CurArray = insert( CurArray, 2, CurRow, 0, oconv( Choosen, '[XLATE_CONV,NAMES*LAST_FIRST]') )\r\n\t\t.contact_ids->array = CurArray\r\n\t\tVoid = set_property( @window, '@NoTopPos', 1 )\r\n\t Void = send_event( @window:'.CONTACT_IDS', 'LOSTFOCUS' )\t\r\n\t\tVoid = set_property( @window, '@NoTopPos', '' ) \r\n\tend\r\nend else\r\n MsgInfo = ''\r\n MsgInfo<micon$> = '!'\r\n MsgInfo<mtext$> = 'You must select at least one customer above...'\r\n Void = msg( '', MsgInfo )\r\nend\r\nRETURN 0\r\n"
}
}
}