cancel
Showing results for 
Search instead for 
Did you mean: 

Internal Error (6001) occured

former_member275826
Participant
0 Kudos

Dear all,

I am trying to get data after selection of CFL.

I have custom form SAY "Work Order".

In that i have Vendor Code CFL. After Selection of CFL, i want to fetch ShiptoAdress of that corresponding Vendor.

Code:

((SAPbouiCOM.EditText)(oForm.Items.Item(pVal.ItemUID).Specific)).Value = val;//code             ((SAPbouiCOM.EditText)(oForm.Items.Item(destControl).Specific)).Value = val1;//name 

string Querry="select isnull([Address],'')+', '+ isnull(Street,'')+', '+isnull(Block,'')+ "+

                                          "  ', '+isnull(ZipCode,'') +', '+isnull(City,'') +', '+isnull([State],'') + "+

                                           " ', '+isnull(Country,'')  from CRD1 where CardCode='" + val + "' and AdresType='S' ";

   SelectRec = ((SAPbobsCOM.Recordset)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));

            SelectRec.DoQuery(Querry);

            if (SelectRec.EoF == false)
            {
                str = SelectRec.Fields.Item(0).Value.ToString();
            }
       ((SAPbouiCOM.EditText)(oForm.Items.Item("txtAddr").Specific)).Value =str ;//name

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Put a break point on the statement just after where you load the field called querry with the sql stmt.  Then copy the contents of that variable and paste into SQL Management Studio and run the statement from there.  It should tell you whether the problem is with the syntax of the statement and will offer info about what is wrong.

former_member275826
Participant
0 Kudos

Hi John,

Sql query is running properly. Its also showing result properly in "str" variable.

& it also assigning value to editext properly.

But after that its giving me this error.

Former Member
0 Kudos

Perhaps the value in the str field is too long for the receiver;.  Also, are you sure you have the case of the "txtAddr" value correct? 

former_member275826
Participant
0 Kudos

Also, are you sure you have the case of the "txtAddr" value correct?

Sorry John i have not understood.

Former Member
0 Kudos

Upper case versus lower case.  B1 will not see "txtAddr" as being equal to "TXTADDR" or 'txtaddr".  Does "txtAddr"  match the precise character case of the field you are trying to retrieve?

Former Member
0 Kudos

Dear Pravin,

There may be two reasons for the above mentioned error

First one is, may be you have created the user data source of edit text box with minimum length and you are trying to set the edit text box value with larger length (i.e. including Address, City and ZipCode etc...). So please create the edit text box with larger length using the code : oForm.DataSources.UserDataSources.Add("EdtDS", BoDataType.dt_LONG_TEXT).

Second one is, try to set the edit text box value in try... catch block and don't write any code in catch block. It will set the text box value and at the same time the code will give the error but since you are writing the code in try... catch block it will not crash the whole application.

Please let me know if the issue get resolved.

Have a great day!

Sincerely,

Nitin

____________________

Manager, SAP Business One

Greytrix
It's time to think outside the box.

Email: sap@greytrix.com | Web: www.greytrix.com

____________________

Development Partners for SAP B1

Answers (0)