Q_ID

CAS Tags
The Q_ID string tag is used in taglists prepared for the GET_Q_ENTRIES_INFO function to specify the source queue from which messages will be retrieved.  Note that the values for this tag are string literals.

The Q_ID tag can be set to one of the following string values:
"Q_ID_SEND" The send (or scheduled) queue
"Q_ID_SENDING" The actively sending queue
"Q_ID_SENT" The sent (or outbox) queue
"Q_ID_RECEIVING" The actively receiving queue
"Q_ID_RECEIVED" The received (or inbox) queue.

 
  Type Max Size Multiple Allowed
String N/A No

Example:
function GetReceivedMessages()
  {
  var Tl, Sl;
  var Msg = "";

  Tl = CAS.New();
  CAS.AddTag(Tl,"GET_Q_ENTRIES_INFO","");
  CAS.AddTag(Tl,"REGISTERED_NAME","Fred");
  CAS.AddTag(Tl,"REGISTERED_PASSWORD","");
  CAS.AddTag(Tl,"USER_NAME","Fred");
  CAS.AddTag(Tl,"Q_ID","Q_ID_RECEIVED");

  Sl = CAS.CreateSection(Tl,"RESPONSE_INCLUDE_ONLY","");
   CAS.AddTag(Sl,"SUBMIT_TIME",0);
   CAS.AddTag(Sl,"MESSAGE_COMPLETION_CODE","");
   CAS.AddTag(Sl,"RECEIVER_CSID","");
   CAS.AddTag(Sl,"PAGE_COUNT","");
  CAS.CloseSection(Sl);
   
    // Get messages on this already open session
  Tl = CAS.Send(Instance,Tl);
  
  if ( CAS.GetTag(Tl,"STATUS_NUM",0) == 0 )
    {
      // The number of messages is in the root of the reply taglist
    QueueCount = CAS.GetTag(Tl,"NUMBER_OF_Q_ENTRIES",0);
    
      // Each message is in it's own sub-section
    for ( a = 0; a < QueueCount; a++)
      {
      var st;

      Sl = CAS.OpenSection(Tl,"MESSAGE_HANDLE[" + a + "]");
        st = new Date(parseInt(CAS.GetTag(Sl,"SUBMIT_TIME",0)));
        Msg += CAS.GetTag(Sl,"MESSAGE_HANDLE",0) + ",";
        Msg += st + ",";
        Msg += CAS.GetTag(Sl,"MESSAGE_COMPLETION_CODE",0) + ",";
        Msg += CAS.GetTag(Sl,"RECEIVER_CSID",0) + ",";
        Msg += CAS.GetTag(Sl,"PAGE_COUNT",0) + "\r\n";
      CAS.CloseSection(Sl);
      }
    }
  else
    {
      // Return the error
    Msg = CAS.GetTag(Tl,"STATUS",0);
    }

  CAS.Delete(Tl);

  return(Msg);
  }

See Also:
GET_Q_ENTRIES_INFO