on 03-14-2016 5:03 AM
Hi,
I have created a new form
added a combo box to it
added a DBDatasource for table OPDN
the combobox alias is set to DocCur and datasource is set to OPDN
Now the combo box is not listing any info. Basically i need to query the DBDatasource with conditions. I am unable to use the DBDatasource added to form too, please give me a sample on how to get the datasource in the backend code? Also if the steps mentioned is incorrect, please help me correct it.
Hello Sam & others who get in to this trouble,
I have figured out a way and i am not sure whether there is another way to acheive this.
You can get the datasources of the form in the following way, and query it to display the data. If you are using matrix, may be you need a statement to load data from the datasource.
SAPbouiCOM.Conditions conditions = new SAPbouiCOM.Conditions();
SAPbouiCOM.Condition condition = null;
SAPbouiCOM.DBDataSource opdn = null;
condition = conditions.Add();
condition.Alias = "docdate";
condition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
condition.CondVal = EdDate.Value;
//get the active form of application or using the ID
oForm = Application.SBO_Application.Forms.ActiveForm;
opdn = oForm.DataSources.DBDataSources.Item("OPDN");
opdn.Query(conditions);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Sinoj !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got the similar situation.
In SAP Business One Studio for MS Visual studio 2012, I created a Matrix, added a DB Data Resource for table OCRD, set the Matrix's alias to CardCode and datasource to OCRD.
But the Matrix is NOT actually bonded to OCRD...I went over the auto-generated C# codes and there's nothing about dbdataresource or OCRD.
Any input on this issue will be valuable, and will be appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.