Skip to main content
What is K2's definition of a Member when reading the error logs in the Service Manager?

Hi kazoos.


Can you please elaborate on what you mean by "Member"? 


Thanks.


Exactly my problem, Bob.  I am receiving an error message in the Service Manager (K2 2003) but when accessing the code in the Default Server event I am struggling to see the error.  The Report Error dialogue box does not offer me a line number to look for or anything other than saying 'Member not found'.  I've attached a screen shot.


Thanks


Scott


Error Screen Shot


hi kazoos.


Could you please copy the "Repair Error" tab and attach to the post? 


Thanks.


 



 Thanks, I've tried to fill a dummy K2 datafield unsuccessfully in numerous sections of this code so am assuming it is not being accessed properly at all.  Note this code belongs to a Default Server event.  I tried using a code module but this was unsuccessful from the beginning. 


 


 


public static void OpenConnection(ref System.Data.SqlClient.SqlConnection SqlConn)
{
 if (SqlConn.State == System.Data.ConnectionState.Closed)
 {
  SqlConn.Open();
 }
}


 


public void Main(ref DestinationRuleContext K2)
{  
  System.Data.SqlClient.SqlConnection sqlConn = new System.Data.SqlClient.SqlConnection();
  System.Data.SqlClient.SqlCommand sqlComm = new System.Data.SqlClient.SqlCommand();
  object strVar = "";
  
  try
  {


   string sServer;
   sServer = K2.StringTable;"sqlserver"];
   
   string sUID;
   sUID = K2.StringTable "sUID"];
   
   string sPWD;
   sPWD = K2.StringTabler"sPWD"];
   
   string sDomainPrefix;
   sDomainPrefix = K2.StringTable "sDomainPrefix"];
   
   string sConStr;
   sConStr = "Server=" + sServer + ";";
   sConStr += "UID=" + sUID + ";";
   sConStr += "PWD=" + sPWD + ";";
   sConStr += "DataBase=UCSponsoredGuest;";
   
   try
   {    
    sqlConn.ConnectionString = sConStr;
    sqlComm.CommandType = System.Data.CommandType.Text;
    sqlComm.Connection = sqlConn;
  
    sqlComm.CommandText = "Select " +
     " bManagerEmployeeID]" +
     " lManagerEmailAddress]" +
     " FROM SponsoredGuest.DepartmentManager ";
    sqlComm.CommandText += " WHERE ";
  
    sqlComm.CommandText += ""DepartmentID] = ";
    // DepartmentID
    strVar = "";
    strVar += K2.ProcessInstance.DataFieldsq"SponsorDepartmentID"].Value.ToString();
    sqlComm.CommandText += "'" + strVar.ToString().Replace("'", "''") + "'" ;
    
    OpenConnection(ref sqlConn);
  
    System.Data.SqlClient.SqlDataReader rReader;
    rReader = sqlComm.ExecuteReader();
    
    while (rReader.Read()) {

     string strUserName = sDomainPrefix + rReaderD"ManagerEmployeeID"];
     K2.ProcessInstance.DataFieldse"SponsorID"].Value = rReaderÂ"ManagerEmployeeID"];
     K2.ProcessInstance.DataFieldse"SponsorEmail"].Value = rReader["SponsorEmail"].ToString();
     K2.ProcessInstance.DataFields""SponsorFQN"].Value = strUserName;
     
     // add the user to the K2 Destintion
           K2.Destinations.Add(DestinationType.User, strUserName);
     break; // Assign first record only
    }

    rReader.Close();    
   }


   catch (System.Exception ex)
   {
    throw new System.Exception(ex.Message);
   }
   sqlConn.Close();
   // End of Import SQL       
     }
  catch (Exception ex)
  {
   throw(ex);
  }
}


//Destination Classes
 
private class CDest1 {
 public bool IsSuccess = false;
  
 public void Main(ref DestinationRuleContext K2) {
  this.IsSuccess = true;
 }


}


 


That makes sense, as "Member not found" typically means it is not able to find a data field name within the Data Fields collection.


Do you have an appropriate data field created?  If so, can you fix the references in this code and click "Repair"?


Checked that all data field names were defined, and they were.  Clicked on Repair in Service Manager anyways to see if it would change any code to no avail.


Will continue to test, take out pieces at a time and retest.


Wish I could dive into the line number which is throwing the error but it's not available.


You might try attaching with the VS.net Debugger as this will probably be the quickest way to find the point of failure.  What you can also do is to place a series of Console.WriteLine("Aftering Opening Connection"), ("After Settings DataFields"), statements to try and also find the cause of.  To see visualually the execution of these console.writeline statements shut down the K2 Server service and restart the service in console mode.


-mike


took out all references to any K2 Data Fields and still receive the same error.  What else can cause a Member Not Found message?  Would the SQL statement cause this even though it does not refer to any K2 Data Fields.  My thoughts are this Server Event is not being accessed initially.  I've set the equivalent of Writeline code all through it to put a value into an unused K2 Data Field but it never gets written to but, then again, I've put in these code fragments to fire even before my try-catch blocks around the SQL.

Continuing on my trek I took out ALL code and get the same error.  The code is now only this and still get Member Not Found: 



public void Main(ref DestinationRuleContext K2){}


What is it that I'm missing here?  I do not know what the code is looking for.


Can you verify that the data related to each entity/element exists (that a Destination Queue" has user accounts, that user account has an email address, AD Groups have user accounts, etc)?


Reply