設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 677|回復: 0
打印 上一主題 下一主題

Overview - Purchase Requisition Lines rmb Change to Planned

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2017-11-23 08:12:58 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
Overview - Purchase Requisition Lines rmb Change to P&lanned<總覽 - 請購單項次 rmb 變更至計畫中>


PM_DataRecordStateEvent 運用
  1. Menu Item: Change to P&lanned
  2.         Resource Id: 23077
  3.         Keyboard Accelerator: (none)
  4.         Status Text: Change the selected Requisitions to Planned
  5.         Menu Settings
  6.                 Enabled when: SalSendMsg( hWndForm, PM_DataRecordStateEvent, METHOD_Inquire, SalHStringToNumber( 'ChangeToPlanned' ) )
  7.                 Checked when:
  8.         Menu Actions
  9.                 Call PostMessage( hWndForm, PM_DataRecordStateEvent, METHOD_Execute, 'ChangeToPlanned'  )
  10.         Menu Item Name:
複製代碼
  1. Function: UserMethod
  2.         Description:
  3.         Returns
  4.                 Number:
  5.         Parameters
  6.                 Number: nWhat
  7.                 String: sMethod
  8.         Static Variables
  9.         Local variables
  10.                 String: sRequiNo
  11.                 String: sRequisitionState
  12.                 String: sAuthCode
  13.                 String: sReqNoArray[*]
  14.                 String: sLineNoArray[*]
  15.                 String: sReleaseNoArray[*]
  16.         Actions
  17.                 If nWhat = METHOD_Execute

  18.                         If sMethod = 'Release'

  19.                         Else If sMethod = 'ChangeToPlanned'
  20.         Select Case AlertBox (TranslateConstant(TEXT_FreezeREQ), CAPTION_Information, INFO_OkCancel)
  21.                 Case IDCANCEL
  22.                         Break
  23.                 Case IDOK
  24.                         Call SalSendMsg( hWndForm, PM_DataRecordStateEvent, METHOD_Execute, SalHStringToNumber( 'ChangeToPlanned' ) )
  25.                         Call RefreshRecord()

複製代碼

PM_DataRecordStateEvent
  1. Function: DataRecordExecuteStateEvent
  2.         Description: The DataRecordExecuteStateEvent function executes a state event in the server for
  3.                         a record.
  4.                         COMMENTS:
  5.                         DataRecordExecuteStateEvent is called once for each selected record by the
  6.                         DataSourceExecuteSqlStateEvent function.
  7.         Returns
  8.                 Boolean:
  9.                 ! The return value is TRUE if the state event is executed successfully, FALSE otherwise.
  10.         Parameters
  11.                 Sql Handle: hSql
  12.                         ! Sql handle
  13.                                         Database connection sql handle to use for this server function call. Typically c_hSql is used.
  14.                 String: sEvent
  15.                         ! Event name
  16.                                         Name of event to execute. This event is converted using client->server naming conventions
  17.                                         to procudce the name of the server method to call.
  18.         Static Variables
  19.         Local variables
  20.         Actions
  21.                 If (p_sPackageName != strNULL)
  22.                         Set __lsAttr = strNULL
  23.                         Call _SetAction( ACTION_Do )
  24.                         If DbPLSQLBlock( hSql, p_sPackageName || '.' || ClientNameToDbName( sEvent ) || "__( :__lsResult, :__sObjid, :__lsObjversion, :__lsAttr, :__sAction )" )
  25.                                 If HandleSqlResult( __lsResult )
  26.                                         Call DataRecordToForm( __lsAttr, FALSE )
  27.                                         Return TRUE
  28.                                 Else
  29.                                         Return FALSE
  30.                         Else
  31.                                 Return FALSE
  32.                 Else
  33.                         Return TRUE
複製代碼
Call _SetAction( ACTION_Do )
If DbPLSQLBlock( hSql, p_sPackageName || '.' || ClientNameToDbName( sEvent ) || "__( :__lsResult, :__sObjid, :__lsObjversion, :__lsAttr, :__sAction )" )
***** ChangeToPlanned -->ClientNameToDbName( sEvent )-->CHANGE_TO_PLANNED__ ****
Client DB call        06:10:36.89 (+0.00)        Action = 'DO'
Client DB call        06:10:36.89 (+0.00)        DbPLSQLBlock( 'IFSAPP.PURCHASE_REQ_LINE_API.CHANGE_TO_PLANNED__( :__lsResult, :__sObjid, :__lsObjversion, :__lsAttr, :__sAction )' )

ClientNameToDbName( sEvent )
  1. Function: ClientNameToDbName
  2.         Description: The ClientNameToDbName converts an object name from server name conventions
  3.                         to client FrameWork name conventions.
  4.                         COMMENTS:
  5.                         This function works by adding an underscore (_) before all uppercase characters
  6.                         (except the first character) and then converting the name to uppercase. For example
  7.                         ClientNameToDbName( 'OrderItem' ) -> 'ORDER_ITEM'.
  8.                         
  9.                         Use function DbNameToClientName to perform the reverse conversion.
  10.         Returns
  11.                 String:
  12.                 ! The return value is object name with server name conventions.
  13.         Parameters
  14.                 String: sClientName
  15.                         ! Object name
  16.                                         The object name with client FrameWork name conventions.
  17.         Static Variables
  18.         Local variables
  19.                 Number: nChar
  20.                 String: sDbName
  21.                 Boolean: bFirstInName
  22.                 Number: nUnderscoreCnt
  23.         Actions
  24.                 Set bFirstInName = TRUE
  25.                 Set nUnderscoreCnt = 0
  26.                 While SalStrFirstC( sClientName, nChar )
  27.                         If nChar = 0
  28.                                 Break
  29.                         If nChar = 95
  30.                                 Set nUnderscoreCnt = nUnderscoreCnt+1
  31.                         Else
  32.                                 If nChar >= 65 And nChar <= 90 And not bFirstInName
  33.                                         Set sDbName = sDbName||'_' || SalNumberToChar(nChar)
  34.                                 Else
  35.                                         Set sDbName = sDbName || SalNumberToChar(nChar)
  36.                                 Set bFirstInName = FALSE
  37.                 Select Case nUnderscoreCnt
  38.                         Case 1
  39.                                 Set sDbName = sDbName || '_'
  40.                                 Break
  41.                         Case 2
  42.                                 Set sDbName = sDbName ||'__'
  43.                                 Break
  44.                 Return SalStrUpperX( sDbName )
複製代碼



分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-5-16 15:39 , Processed in 0.220574 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表