비즈니스 규칙에서 워크플로우 스크래치패드에 액세스

  • 릴리스 버전: Washingtondc
  • 업데이트 날짜 2024년 02월 01일
  • 읽기1분
  • 카탈로그 항목이 요청되었습니다. 첨부된 워크플로우에 스크래치패드의 값을 채우는 스크립트 실행 활동이 포함됩니다. 요청 항목에서 실행되는 비즈니스 규칙에서 스크래치패드 값을 검색하거나 설정하려고 합니다.

    필요 조건

    필요한 역할: admin

    이름: 비즈니스 규칙에서 워크플로우 스크래치패드에 액세스

    형식: 비즈니스 규칙

    테이블: sc_req_item(요청된 항목)

    설명: 카탈로그 항목이 요청되었습니다. 첨부된 워크플로우에 스크래치패드의 값을 채우는 스크립트 실행 활동이 포함됩니다. 요청 항목에서 실행되는 비즈니스 규칙에서 스크래치패드 값을 검색하거나 설정하려고 합니다.

    매개변수: 해당 사항 없음

    스크립트:
    //the run script activity sets a value in the scratchpad
    workflow.scratchpad.important_msg = "scratch me";
     
    //get the workflow script include helper 
    var workflow = new Workflow();
     
    //get the requested items workflow context 
    //this will get all contexts so you'll need to get the proper one if you have multiple workflows for a record 
    var context = workflow.getContexts(current); 
    //make sure we have a valid context 
    if (context.next()) { 
      //get a value from the scratchpad 
      var msg = context.scratchpad.important_msg; 
      //msg now equals "scratch me", that was set in the run script activity
     
      //add or modify a scratchpad value
      context.scratchpad.status = "completed"; 
      //we need to save the context record to save the scratchpad
      context.update(); 
    }