Adding Code for FrameActivate, Clearing, Setting, and Activation Functions

The following code belongs in the FrameActivate button of 1100 Custom FrameType. Also see 1100 Custom.

var trl=0
var thisSection=this.Parent
var cnCustom = ActiveDocument.Sections[BaseFrameType.Text + " Custom"]
Qiq_enter("1100()",trl,thisSection)


function getFilterName(obj){
   Qiq_enter("getFilterName() ",trl+1,thisSection)
   // extract the filter name from the text property of the button
   // the name is after the last newlile
   var arrFilterName = obj.Text.split("\r\n")
   Qiq_exit("getFilterName() " + arrFilterName[arrFilterName.length-... 
...1],trl+1,thisSection)
   return arrFilterName[arrFilterName.length-1]
}


function clearRangeCal(in_obj){
   Qiq_enter("clearRangeCal() ",trl+1,thisSection)
   var strFilterName = getFilterName(in_obj.Parent.Shapes["cbtSet_1"])
   var objStaCal = ... 
...in_obj.Parent.Shapes["picDatePicture^Qiq_cal^1"].Qiq_objCalDate
   var objEndCal = ... 
...in_obj.Parent.Shapes["picDatePicture^Qiq_cal^2"].Qiq_objCalDate
   var objStaDate = objStaCal.Qiq_getDate()
   var objEndDate = objEndCal.Qiq_getDate()
   var objFilter = new Qiq_filter(strFilterName)
   if (!(objEndDate instanceof Date) && !(objStaDate instanceof Date)){
      Qiq_objDocFilters.Qiq_ignoreFilter(strFilterName)
   }else{
      if (objEndDate instanceof Date) {
         objFilter.Qiq_setOperator(bqLimitOperatorLessThanOrEqual)
         objFilter.Qiq_setSelectedValues(objEndDate)
      }else{
         objFilter.Qiq_setOperator(bqLimitOperatorGreaterThanOrEqual)
         objFilter.Qiq_setSelectedValues(objStaDate)
      }
      Qiq_objDocFilters.Qiq_setFilters(objFilter)
   }
   in_obj.Parent.OnActivate()
   Qiq_exit("clearRangeCal() ",trl+1,thisSection)
} 
ActiveDocument.clearRangeCal = clearRangeCal

These examples illustrate code that is added into Script Editor for the functions:

Note:

Code examples must be customized to suit your requirements.