Need help in fixing the join issues with editor

Need help in fixing the join issues with editor

Benn Solomon DBenn Solomon D Posts: 10Questions: 4Answers: 0

I'm joining 2 tables for populating the options for select type and getting below error:

DataTables warning: table id=emailTable - Table part of the field 'Case_Number' was not found. In Editor instance that use a join, all the fields must have the database table set explicity.

Appreciate your help !!

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @Benn Solomon D ,

    Could you provide more details, please, such as your DB schema that you're joining, your server-side script and the Editor initialisation on the client.

    Cheers,

    Colin

  • Benn Solomon DBenn Solomon D Posts: 10Questions: 4Answers: 0

    Hi Colin,

    Now i'm getting different error : "Invalid column name 'CAR_EMAIL_SUPPORT_ENG'.\r\nInvalid column name 'Email_Response_Detail_TBL'."

    I've debugged the .Net code and above error is showing in response object

        [HttpGet]
        public ActionResult Edit()
        {
            var settings = Properties.Settings.Default;
            HttpRequest request = System.Web.HttpContext.Current.Request;  // HttpContext.Current.Request;
    
                   using (var db = new DataTables.Database(settings.DbType, settings.DexConn))
            {
    
                var response = new Editor(db, "Email_Response_Detail_TBL", new[] { "Case_Number", "Email_Message_date" })
                .Model<Email_Response_Detail_TBL>("Email_Response_Detail_TBL")
                .Model<CAR_EMAIL_SUPPORT_ENG>("CAR_EMAIL_SUPPORT_ENG")
                .Field(new Field("Email_Response_Detail_TBL.Case_Number"))
                .Field(new Field("Email_Response_Detail_TBL.Email_Message_date"))
                .Field(new Field("Email_Response_Detail_TBL.Last_Activity_Time"))
                .Field(new Field("Email_Response_Detail_TBL.Case_Owner_Manager"))
                .Field(new Field("Email_Response_Detail_TBL.case_owner"))
                .Field(new Field("Email_Response_Detail_TBL.date_time_opened"))
                .Field(new Field("Email_Response_Detail_TBL.Agent_Call_Center"))
                .Field(new Field("Email_Response_Detail_TBL.Tower_Manager_Email"))
                .Field(new Field("Email_Response_Detail_TBL.Severity"))
                .Field(new Field("Email_Response_Detail_TBL.DCT"))
                .Field(new Field("Email_Response_Detail_TBL.Delivery_Type"))
                .Field(new Field("Email_Response_Detail_TBL.Entitlement_SLA_Response"))
                .Field(new Field("Email_Response_Detail_TBL.Service_Portfolio"))
                .Field(new Field("Email_Response_Detail_TBL.Coverage_Response"))
                .Field(new Field("Email_Response_Detail_TBL.Last_Outgoing_Email"))
                .Field(new Field("Email_Response_Detail_TBL.Subject"))
                .Field(new Field("Email_Response_Detail_TBL.Region"))
                .Field(new Field("Email_Response_Detail_TBL.Assigned_to_Engineer").Options("CAR_EMAIL_SUPPORT_ENG","ENG_EMAIL", "ENG_EMAIL").Validator(Validation.DbValues(new ValidationOpts { Empty = false })))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_Date_Time_1"))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_By_1"))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_Date_Time_2"))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_By_2"))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_Date_Time_3"))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_By_3"))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_Date_Time_4"))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_By_4"))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_Date_Time_5"))
                .Field(new Field("Email_Response_Detail_TBL.Intervention_By_5"))
                .Field(new Field("Email_Response_Detail_TBL.Comments"))
                .Field(new Field("Email_Response_Detail_TBL.Exclusion_Flag"))
                .Field(new Field("Email_Response_Detail_TBL.Exclusion_Reason"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_FRESH_CNT"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_FRT_INT_DUE"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_SND_INT_DUE"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_TRD_INT_DUE"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_EXP_INT_DUE"))
                .Field(new Field("Email_Response_Detail_TBL.Last_intervention_By"))
                .Field(new Field("Email_Response_Detail_TBL.Last_intervention_Time"))
                .Field(new Field("Email_Response_Detail_TBL.TOTAL_CNT"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_FRT_INT_COMP"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_SND_INT_COMP"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_TRD_INT_COMP"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_FRT_INT_EXP"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_SND_INT_EXP"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_TRD_INT_EXP"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_FRT_INT_COMP_UNASGN"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_SND_INT_COMP_UNASGN"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_TRD_INT_COMP_UNASGN"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_ALL_INT_EXP_UNASGN"))
                .Field(new Field("Email_Response_Detail_TBL.CAR_ALL_INV_COMP_EXP"))
                .Field(new Field("Email_Response_Detail_TBL.Case_Age"))
                .LeftJoin("CAR_EMAIL_SUPPORT_ENG", "CAR_EMAIL_SUPPORT_ENG.ENG_EMAIL", "=", "Email_Response_Detail_TBL.Assigned_to_Engineer")
                .Process(request)
                .Data();
    
                var result = Json(response, JsonRequestBehavior.AllowGet);
                result.MaxJsonLength = int.MaxValue;
                return result;
            }
            //return View();
        }
    
  • Benn Solomon DBenn Solomon D Posts: 10Questions: 4Answers: 0

    Here is my requirement : I need to load the data into editor from "Email_Response_Detail_TBL" table.
    In editor, only "Assigned_to_Engineer" field is of "Select" type and i need to display list of Engineers names from "CAR_EMAIL_SUPPORT_ENG" table in a drop down while editing.

    Thanks inadvance !

  • Benn Solomon DBenn Solomon D Posts: 10Questions: 4Answers: 0

    Nevermind. The issue is fixed when i removed
    .Model<Email_Response_Detail_TBL>("Email_Response_Detail_TBL")
    .Model<CAR_EMAIL_SUPPORT_ENG>("CAR_EMAIL_SUPPORT_ENG")

    Thanks!

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @Benn Solomon D ,

    Glad all working,

    Cheers,

    Colin

This discussion has been closed.