on 04-26-2012 11:16 AM
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 |
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
99 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.