Skip to content

Replies

0
akram khan
akram khan answered on Sep 17, 2015 5:48 AM

Hi Mike,

Fresh entry means when i save a record in the form , system does not throw any error and i can see all the data in combo boxes. when i close and open the form and select the record which entered, then this error appears. 

Regards,

akram

0
akram khan
akram khan answered on Sep 16, 2015 5:47 AM

Hi Mike,

Last piece of code refers to "SearchOnUserCodesAdapterShowDialog("RunningNum",cbxRunningNum);" line. 

when i re load the form the data in the combo boxes (field ) does not appear. 

When i create a fresh entry everything is normal, data appears in the combo boxes. when i re load the form with same projectid , data in combo boxes does not appear. so wrote below code. When  i comment "SearchOnUserCodesAdapterShowDialog("RunningNum",cbxRunningNum);" error does not appear. for "SearchOnUserCodesAdapterShowDialog("DepIdent",cbxDepart);" data apears after form reload also. 

private void edvProject_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{

if ((args.Row > -1))
{
if (dept_selected == false)
{
SearchOnUserCodesAdapterShowDialog("DepIdent",cbxDepart);
SearchOnUserCodesAdapterShowDialog("RunningNum",cbxRunningNum);
}

}

Regards,

akram

0
akram khan
akram khan answered on Sep 15, 2015 1:32 PM

Hi mike,

This code has no issues until i add the last piece of code . when i re load the form my combo boxes does not appear , i wrote the below code to see the data in combo boxes, the first line of code is fine (SearchOnUserCodesAdapterShowDialog("DepIdent",cbxDepart);), there is no error upto this point, where as when write the next line (SearchOnUserCodesAdapterShowDialog("RunningNum",cbxRunningNum);) error comes here. 

private void edvProject_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{

if ((args.Row > -1))
{
if (dept_selected == false)
{
SearchOnUserCodesAdapterShowDialog("DepIdent",cbxDepart);
SearchOnUserCodesAdapterShowDialog("RunningNum",cbxRunningNum);
}

}

}

This is the actual method..

private void SearchOnUserCodesAdapterShowDialog(string TypeID,Epicor.Mfg.UI.FrameWork.EpiUltraCombo Ctr)

                {

                                UserCodesAdapter UserCodesAdapter = new UserCodesAdapter(oTrans);

                                UserCodesAdapter.BOConnect();

 

                                bool avail = UserCodesAdapter.GetByID(TypeID);

 

                                if(avail)

                                {

                                                {

                                                                Ctr.ValueMember = "CodeID";

                                                               

                                                                if(TypeID == "RunningNum")

                                                                {

                                                                Ctr.ValueMember = "CodeDesc";

                                                                string str1 ="";

                                                                                DataRow row = this.edvProject.CurrentDataRow;

                                                                                if(row!=null)

                                                                                str1= row["ShortChar01"].ToString();

                                                                                Ctr.DataSource = UserCodesAdapter.UserCodesData.UDCodes.Select("CodeID = '" +  str1 + "'");

 

                                                                               

                                                                                if(((DataRow[])Ctr.DataSource).Length>0)

                                                                                {

                                                                                               

                                                                                                ((DataRow[])Ctr.DataSource)[0]["CodeDesc"] = Convert.ToDouble(((DataRow[])Ctr.DataSource)[0]["CodeDesc"]) + 1;

                                                                                                                                                                                }

                                                                }

                                                                else if(TypeID =="DepIdent")

                                                                {

                                                                                string str ="";

                                                                                DataRow row = this.edvProject.CurrentDataRow;

                                                                                                                if(row!=null)

                                                                                                                str= row["ShortChar01"].ToString();

                                                                                Ctr.DataSource = UserCodesAdapter.UserCodesData.UDCodes.Select("Character01 = '" +  str + "'");

                                                                }

 

                                                                else                                                       

                                                                                Ctr.DataSource = UserCodesAdapter.UserCodesData.UDCodes;

 

 

                                                                Ctr.DisplayMember = "CodeDesc";

                                                                string[] fields = new string[] {"CodeDesc"};

                                                                Ctr.SetColumnFilter(fields);

 

                                                }

                                }

                                UserCodesAdapter.Dispose();

                               

                }

please suggest . 

Regards,

Akram 

0
akram khan
akram khan answered on Sep 2, 2015 8:36 AM

Hi mike,

The data types of the fields are char only but i am populating a number field in the char field and converting to double +1; my application provides standard char fields only, that i why i am converting to double and adding. 

((DataRow[])Ctr.DataSource)[0]["CodeDesc"] = Convert.ToDouble(((DataRow[])Ctr.DataSource)[0]["CodeDesc"]) + 1;

Hope you understand..

regards,

akram 

0
akram khan
akram khan answered on Sep 1, 2015 11:23 AM

Hi ,

Adding to that in my case the data value and display member both are number only , i want to display number itself.How could i acheive this. 

Regards,

akram 

0
akram khan
akram khan answered on Sep 1, 2015 11:00 AM

Hi,

Could you please help me with the code. What to replace this code with , 

((DataRow[])Ctr.DataSource)[0]["CodeDesc"] = Convert.ToDouble(((DataRow[])Ctr.DataSource)[0]["CodeDesc"]) + 1.


Regards,

akram 

0
akram khan
akram khan answered on Aug 30, 2015 6:16 AM

((DataRow[])Ctr.DataSource)[0]["CodeDesc"] = Convert.ToDouble(((DataRow[])Ctr.DataSource)[0]["CodeDesc"]) + 1