Topic
  • 4 replies
  • Latest Post - ‏2016-07-05T20:34:59Z by Nico Schilling
Nico Schilling
Nico Schilling
10 Posts

Pinned topic Fill custom job monitor column

‏2016-07-05T09:45:56Z | datacap jobmonitor

Hey!

 

I followed the follwing technote: http://www-01.ibm.com/support/docview.wss?uid=swg21500306

 

I am able to see the custom column in tmweb, but I am not really sure how to fill these column correct with supported actions. I tried the following combination with rrset:

Can anybody help me? Thanks in advance.

 

  • Nico Schilling
    Nico Schilling
    10 Posts
    ACCEPTED ANSWER

    Re: Fill custom job monitor column

    ‏2016-07-05T20:34:59Z  

    I found the code snipped by myself. Just look here: https://www.ibm.com/developerworks/community/forums/html/topic?id=f0aef757-620e-4f16-ad53-e43c28f2cebf

     

    Here is my vbscript sample:

     

         Dim columnName
          Dim columnValue
          Dim ParamAr
          
          UpdateCustomColumn = False
        
        Writelog "UpdateCustomColumn: Start splitting the parameter."
        
           ParamAr = SPLIT(strParam,",")
           if uBound(ParamAr) <> 1 then
              Writelog("Wrong number of parameters.  Expecting (columnName,columnValue) as a parameter. Please see action help for more information. Exiting.")
              Exit Function
           else
              columnName = MetaWord(Trim(ParamAr(0)))
              columnValue = MetaWord(Trim(ParamAr(1)))
           End if
      
        Writelog "UpdateCustomColumn: Starting to set the value '" & columnValue & "' to the custom job monitor column '" & columnName & "'."
        
          Pilot.XtraBatchFieldValue(columnName) = columnValue    
      
        Writelog "UpdateCustomColumn: The action was able to set the value '" & columnValue & "' to the custom job monitor column '" & columnName & "'."
          
          UpdateCustomColumn = True
    

     

  • Tom Price
    Tom Price
    288 Posts

    Re: Fill custom job monitor column

    ‏2016-07-05T16:07:01Z  

    The technote you reference refers to calling code from a BatchPilot form (pre-DotEdit/Datacap Desktop). The second option details  how to call it in Custom Action code.

     

    I use the following code in a C# action to update custom columns - 

     

    public bool UpdateCustomColumn(string column, string value)
            {

                dcSmart.SmartNav localSmartObj = new dcSmart.SmartNav(this)

                string input = localSmartObj.MetaWord(value);
                BatchPilot.set_XtraBatchFieldValue(column, input);
                WriteLog("Setting Column: " + column + " To Value: " + input); 

                return true;
            }

    It's called as followed in DStudio - 

    UpdateCustomColumn("PB_LOCATION", "InsertThisValue")

     

    Hopefully this will give you enough information to progress.

     

    Regards

     

  • Nico Schilling
    Nico Schilling
    10 Posts

    Re: Fill custom job monitor column

    ‏2016-07-05T17:47:40Z  
    • Tom Price
    • ‏2016-07-05T16:07:01Z

    The technote you reference refers to calling code from a BatchPilot form (pre-DotEdit/Datacap Desktop). The second option details  how to call it in Custom Action code.

     

    I use the following code in a C# action to update custom columns - 

     

    public bool UpdateCustomColumn(string column, string value)
            {

                dcSmart.SmartNav localSmartObj = new dcSmart.SmartNav(this)

                string input = localSmartObj.MetaWord(value);
                BatchPilot.set_XtraBatchFieldValue(column, input);
                WriteLog("Setting Column: " + column + " To Value: " + input); 

                return true;
            }

    It's called as followed in DStudio - 

    UpdateCustomColumn("PB_LOCATION", "InsertThisValue")

     

    Hopefully this will give you enough information to progress.

     

    Regards

     

    Thanks for your input. So, there is no standard action shipped with datacap to set this value? 

    Do you have a vbscript sample for this topic? For me it would be a little bit easier to integrate a custom vbscript action.

  • EdLee
    EdLee
    30 Posts

    Re: Fill custom job monitor column

    ‏2016-07-05T19:16:32Z  

    Thanks for your input. So, there is no standard action shipped with datacap to set this value? 

    Do you have a vbscript sample for this topic? For me it would be a little bit easier to integrate a custom vbscript action.

    Try this:

     

    <f name="AddValueToCustomColumn" access="public" qi="adds the value from varSource into the custom column (varTarget).">
       <p name="varSource"/>
       <p name="varTarget"/>
      
       <ap>
        <br/>
       </ap>
       <h>
              AddValueToCustomColumn adds the value from varSource into the custom column (varTarget).  <br/>
              
         <e>
             
         </e>
       </h>
       <lvl>
           <b></b>
       </lvl>
       <ret>
          <br/>
         Returns <b>TRUE</b>
       </ret>
       <see>
         <br/>
         <scr></scr>
       </see>
       <g>
       <![CDATA[
       'Your VBScript code goes here.
     
       Writelog("Beginning AddValueToCustomColumn.")
         Dim sSource
         Dim sDestination
         Dim sValue
         Dim sReturn
        Dim sDest
         
         
         AddValueToCustomColumn = False
             
         sSource = Trim(varSource)
         sDestination = Trim(varTarget)
         
         
         sValue = MetaWord(sSource)
        sDest = MetaWord(sDestination)
         
         
     
         pilot.XtraBatchFieldValue(sDest) = sValue 
     
         
         AddValueToCustomColumn = TRUE       'Actions must always return a TRUE or FALSE.
     
     ]]></g></f>

     

    Peace,

     

    Ed

  • Nico Schilling
    Nico Schilling
    10 Posts

    Re: Fill custom job monitor column

    ‏2016-07-05T20:34:59Z  

    I found the code snipped by myself. Just look here: https://www.ibm.com/developerworks/community/forums/html/topic?id=f0aef757-620e-4f16-ad53-e43c28f2cebf

     

    Here is my vbscript sample:

     

         Dim columnName
          Dim columnValue
          Dim ParamAr
          
          UpdateCustomColumn = False
        
        Writelog "UpdateCustomColumn: Start splitting the parameter."
        
           ParamAr = SPLIT(strParam,",")
           if uBound(ParamAr) <> 1 then
              Writelog("Wrong number of parameters.  Expecting (columnName,columnValue) as a parameter. Please see action help for more information. Exiting.")
              Exit Function
           else
              columnName = MetaWord(Trim(ParamAr(0)))
              columnValue = MetaWord(Trim(ParamAr(1)))
           End if
      
        Writelog "UpdateCustomColumn: Starting to set the value '" & columnValue & "' to the custom job monitor column '" & columnName & "'."
        
          Pilot.XtraBatchFieldValue(columnName) = columnValue    
      
        Writelog "UpdateCustomColumn: The action was able to set the value '" & columnValue & "' to the custom job monitor column '" & columnName & "'."
          
          UpdateCustomColumn = True