Associating a Custome ResultSet with a Choose From List
Hi Experts,
I have to Link the Chose from List with a UDO for accessing the records from the Parent Table /Child Table
How to crack this problem?
Also I have to associate the Results of a custom query in a choose from list so that when I press TAB over a Text Box I get a Choose From List which displays the Results and I could select one of those rows.
Plz Hint me for this Problem
Hello,
When you create CFL, just set your UDO type with oCFLCreationParams.ObjectType = "My_UDO", the collumn to be displayed in CFL has been determined by Find Service in your UDO definition.
As per custom query, actually you can set the condition to do so. Direct customed SQL is not supported in CFL. You may refer to the SDK sample for further info after you install SDK component:
<<C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\17.ChooseFromList>>
Private Sub AddChooseFromList()
Try
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
oCFLs = oForm.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
' Adding 2 CFL, one for the button and one for the edit text.
oCFLCreationParams.MultiSelection = False
'Just Set your UDO type.
oCFLCreationParams.ObjectType = "My_UDO"
oCFLCreationParams.UniqueID = "CFL1"
oCFL = oCFLs.Add(oCFLCreationParams)
' Adding Conditions to CFL1
oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "CardType"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "C"
oCFL.SetConditions(oCons)
Catch
MsgBox(Err.Description)
End Try
End Sub
Kind Regards
-Yatsea
Similar Messages
-
Showing choose from list indicator on text edit field
Hello expert,
I have an UDF with a choose from list linked to one text edit object.
Actually, I don't see the fields selection list indicator inside the text edit object.
I thought it should have the same behavior as the cardcode text edit in the sales order form.
Someone can explain me what's the reason ?
Thanks in advance.
Best regards
AndreaHi,
If You Mean To Display CFL Icon in the edit text then
Try This.....
Go To SAP Then
View -
> Pickers Display -
> List Selection
View-->Indicator Displaly--
>Choose From List Fields
Thanks
Shafi -
What is the best way to zero a 'custom voltage with excitation' sensor from the front panel?
What is the best way to zero a 'custom voltage with excitation' sensor from the front panel?
Thanks for any helpHi Donavan,
There are two options for zeroing with the NI-9237. You can perform offset nulling and shunt calibration with a strain task, or if you use custom excitation you can use software compensation.
See the Bridge Balancing, Offset Nulling section in the Load, Force, and Torque Measurements tutorial. Take a measurement before the strain is applied and subtract this from all subsequent measurements. See the above tutorial to consider the tradeoff in accuracy between these two options.
Hope this helps,
Jennifer O.
Applications Engineer
National Instruments -
I am looking for custom sendemail in sharepoint 2013 designer workflow using dictionary object with email template from list
MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint LeadHi Greetings.
pls check if it helps you.
http://msdn.microsoft.com/en-us/library/office/jj554504(v=office.15).aspx
Please remember to click 'Mark as Answer' on the answer if it helps you -
Choose from list - data display with condition
Hi,
I 've developed a form using screen painter, I ' ve attached a choose from list to fill GRPo Number. In the choose from list the GRPo no. should not display again which once I have selected and saved.
Let me have a good solution please and it would be appreciated.
Thanks & Regards,
Venkatesan G.Hi suresh,
where did you put this code?....In the choose_from_list event handler?..I've tried a similar solution, before reading your post, but it doesn't work because if i dynamically set the condition for the choose from list i got an empty table.
i've tried to put my code when beforeaction=true and i have this kind of problem. The difference is that i need to set the filter starting with the value i've entered on the field connected to the choose from list. I put code here, so it's more clear
If (pVal.Before_Action = True) And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) Then
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim sItemCode As String
oEditText = oMatrix.Columns.Item("V_ItemCode").Cells.Item(pVal.Row).Specific
sItemCode = oEditText.Value.ToString
oCFL = oForm.ChooseFromLists.Item("CFL_Item")
oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "ItemCode"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_START
oCon.CondVal = sItemCode
oCFL.SetConditions(oCons)
End If
My situation is that i type something in V_ItemCode column and after that i press the tab key to open the choose from list.
Would be ok if i get the SAP standard beahviour too, that doesn't open the choose from list, but fills the field with the first code starting with what you type.
Thanks in advance -
I need a resultset with 10 rows from dual
Which is the easiest SELECT I have to write, when the question is: "I need a resultset with 10 rows from dual"
one solution is
SELECT 'X' FROM EMP WHERE ROWNUM <= 10;
problem: if emp has fewer than 10 rows, I have an incorrect resultset
another problem: if I need 1000 and not 10 dummy-rows, than is emp definitely the wrong way, because the default-emp table has only 14 rows.
Is there an easy generic solution for this problem? If I need only one row, Oracle has the workaround with the DUAL-table.What about this new method (dedicated by me to this great FORUM!). It is easy to use, easy to understand, and very fast:
SQL> set echo on
SQL> set timing on
SQL> select rownum
2 from all_objects
3 where rownum <=10;
ROWNUM
1
2
3
4
5
6
7
8
9
10
10 rows selected.
Elapsed: 00:00:00.00
SQL> select COUNT(rownum)
2 from all_objects
3 where rownum <=1000;
COUNT(ROWNUM)
1000
Elapsed: 00:00:00.00
SQL> with r1000
2 as (select rownum
3 from all_objects
4 where rownum <=1000)
5 select count(rownum)
6 from r1000, r1000
7 where rownum <= 1000000;
COUNT(ROWNUM)
1000000
Elapsed: 00:00:00.05 -- !for 1 million numbers!
SQL> with r1000
2 as (select rownum
3 from all_objects
4 where rownum <=1000)
5 select count(rownum)
6 from r1000, r1000, r1000
7 where rownum <= 10000000;
COUNT(ROWNUM)
10000000
Elapsed: 00:00:04.09 -- !for 10 millions numbers! -
Hi all,
I am trying to develop a custom choose from list functionality for my addon. I have created two forms first.srf and second.srf .In the key down event of an edittext in my first form i wrote the code for opening the second form
LoadFromXML("Second.srf")
Private Sub LoadFromXML(ByRef FileName As String)
Dim oXmlDoc As Xml.XmlDocument
oXmlDoc = New Xml.XmlDocument
Dim sPath As String
sPath = System.Windows.Forms.Application.StartupPath()
sPath = sPath.Remove(sPath.Length - 3, 3)
oXmlDoc.Load(sPath & "" & FileName)
B1Connections.theAppl.LoadBatchActions(oXmlDoc.InnerXml)
End Sub
second form is loading very well but my problem is that in the form load event of the second form when i try to access the grid i will get an error message
Item - Invalid Item [66000-3]. Form unique Id "Second", Item Unique Id : "grdItem"
I am using SAP B1 8.8 PL 10, visual Studio 2008 and B1DE 2.1.
Any help
Regards
ArunHi Sebastian,
Thanks for your reply. i used
Dim oForm As SAPbouiCOM.Form = B1Connections.theAppl.Forms.GetForm("FrmSecond", 0)
to get the form also tried
Dim oForm As SAPbouiCOM.Form
oForm = B1Connections.theAppl.Forms.ActiveForm
but not working . second forms unique id and type are set correctly but the object type is not set because this form is not binded to any UDT.
The OForm objects item count is always 0
Thanks in advance
Regards
Arun -
Get cardname along with cardcode usuing Choose From List Button
Hi,
I am using Choose From List button in my form. If I click the button then I can see the matrix containing business partners list and if I choose any business partner from that list then I can see the business partners id or cardcode from ocrd table in the corresponding textbox.
But I want the business partner's name or cardname also should come simultaneously in the next textbox of my form. Can some one provide me any code help for this process.
Regards,
Sudeshna.Hi Sudesha,
You can get the CardName with the following code:
sCardCode = oDataTable.GetValue(0, 0)
sCardName = oDataTable.GetValue(1, 0)
Hope it helps,
Adele -
Create choose from list in Report selection criteria
Hi all,
Is it possible to create a choose from list in UDF in a Report selection criteria ?
My issue is i just want to create a report using crystal report. In this report contain some parameter which the parameter choose from list value is come from a UDT. If the value come from OCRD or OITM , it's so easy to make. I just make Customer @From OCRD in parameter CR, then i just preview, it will make choose from list from business partner. But how about from UDT.
I have try to make it using Formatted search. So in SAP B1, i binded with formatted search in some parameter that i make it in CR. But there is some thing odd. if I make 2 different report with different parameter. The formatted search with binded in the first report, will also binded in the second report. And i don't want this happen.
How can i make it , the formatted search didn't binded in second report parameter, because the second report is totally different. ?
thanks in advance
regards
Jia shunHi Jia
Try this
@UDT
Code Alpha(8)
Name Alphe(30)
Fields etc
Define the parameter token as follows.
Season@SELECT DISTINCT T1.Code, T1.Name FROM OADM T0 CROSS JOIN "@UDT" T1
OADM only has one record so the join will return the right number of records.
Hope this helps
Rob -
Choose From List used in UDO (B1 2004)
Hi,
in the presentation "Creating a UDO of document type.pps" (slide 53+55) provided with the SDK 2004 they use the Choose From List to select business partners and/or items in their UDO form when adding a new document. Does anyone know, how this has to be done? The sample, from the presentation is not provided in the sample codes.
Do I have to use an implementation DLL for my UDO to use this functionality?
My problem is, that it takes too long (about 5 times longer than with the system CFL) to get all items in my custom defined matrix.
thanks,
MarkusHi Markus,
You cannot use the built-in CFL in version 2004. It is only exposed from version 2005. The only suggestion is to look at optimizing your matrix. All CFLs in the system uses DB Datasources which makes populating the grid faster than using User data sources.
Hope it helps,
Adele -
Problem in Choose from list.
Hi,
As I tried CFL for a user defined form, when I select an item from CFL and it is displaying in the relevant field. And when I save the data it is perfectly saving with the message of "Operation has been completed successfully". But the data is not saving in the field in which is the CFL is activating.
It would be appreciated, if any one can give the solution please.
The steps I' ve followed as,
1. In the screen painter I' ve added the choose from list thru' the collection folder.
2. Then the choose from list id is attached and give the allias in the item's specific property.
3. Then I' ve written code in the load form function as follows.
Oform.DataSources.UserDataSources.Add("EditDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
txtaccode.DataBind.SetBound(True, "", "EditDS")
4. In the item event
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val As String
Dim val1 As String
Dim val2 As String
Dim val3 As String
Try
Try
val = oDataTable.GetValue(0, 0)
val1 = oDataTable.GetValue(1, 0)
If (pVal.ItemUID = "txtaccode") Then
oForm.DataSources.UserDataSources.Item("EditDS").ValueEx = val
txtaccode.Value = val
oForm.DataSources.UserDataSources.Item("EditDS1").ValueEx = val1
End If
Catch ex As Exception
Exit Sub 'For Exception raised for Cancel Button
End Try
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
End If
End If
End SubChecks if the property TableName in the field is pointed to the table to store de data.
Go to Example: How to binding CFL to a UDO in a customized System Form. and rate it
regards -
Change data in existing "Choose from list" matrix
Hi,
in UI GUI->order form . When add a new order, hit "TAB" to select BP from existing list. I want to use my own sql to populate the BP list (currently the GUI defaults to return all customers).
Is there a way? I mean if I just want to change data in the matrix and let B1 continue to make the "Choose from list" form (form "10001") with my own new customer list. Set BubbleEvent = true will just re-read all cards after I query my result.
any help is appriciated!Hello,
I came across the same issue with the Items Choose from List on the Sales Order screen. It is possible to load your own Choose from List form and populate the matrix using recordset objects and userdatasources. The same logic could be applied to the BP Choose from List form. The following code displays the user form and matrix items - separate code is needed to handle the selection process on this form. There maybe a faster way of acheiving this using UDTs etc but it seems to work ok.
'When user presses Tab key in Item No. column.
If pVal.EventType = et_KEY_DOWN Then
If pVal.ItemUID = "38" And pVal.ColUID = "1" And _
pVal.Before_Action = True And pVal.CharPressed = vbKeyTab Then
'Load new Choose from List form.
'This is actually an exported and edited version of the SBO form.
LoadFromXML sIIS_ITEMLIST_XML
'Populate matrix with items returned from SQL query.
'Use recordset, arrays, userdatasources.
Set oRecordSet = oCmp.GetBusinessObject(BoRecordset)
sSql = "Select OITM.ItemCode, OITM.ItemName, OITM.OnHand FROM OITM " & _
"Where Upper(Left(OITM.ItemCode,2)) = 'B1'"
oRecordSet.DoQuery sSql
nRows = oRecordSet.RecordCount
If nRows <> 0 Then
'Array declarations.
Dim ItemCode(), ItemName(), OnHand()
ReDim ItemCode(nRows - 1)
ReDim ItemName(nRows - 1)
ReDim OnHand(nRows - 1)
'Add userdatasources to form.
oForm.DataSources.UserDataSources.Add "ItemCode", dt_LONG_TEXT, 20
oForm.DataSources.UserDataSources.Add "ItemName", dt_LONG_TEXT, 100
oForm.DataSources.UserDataSources.Add "OnHand", dt_LONG_NUMBER
i = 0
'Populate arrays from recordset.
Do While oRecordSet.EOF <> True
ItemCode(i) = oRecordSet.Fields.Item(0).Value
ItemName(i) = oRecordSet.Fields.Item(1).Value
OnHand(i) = oRecordSet.Fields.Item(2).Value
oRecordSet.MoveNext
i = i + 1
Loop
'Bind data fields to form items.
Set oMatrix = oForm.Items.Item("7").Specific
Set oColumn = oMatrix.Columns.Item("ItemCode")
oColumn.DataBind.SetBound True, "", "ItemCode"
Set oMatrix = oForm.Items.Item("7").Specific
Set oColumn = oMatrix.Columns.Item("ItemName")
oColumn.DataBind.SetBound True, "", "ItemName"
Set oMatrix = oForm.Items.Item("7").Specific
Set oColumn = oMatrix.Columns.Item("OnHand")
oColumn.DataBind.SetBound True, "", "OnHand"
'Get data from datasources.
Dim oUItemCode As SAPbouiCOM.UserDataSource
Dim oUItemName As SAPbouiCOM.UserDataSource
Dim oUOnHand As SAPbouiCOM.UserDataSource
Set oUItemCode = oForm.DataSources.UserDataSources.Item("ItemCode")
Set oUItemName = oForm.DataSources.UserDataSources.Item("ItemName")
Set oUOnHand = oForm.DataSources.UserDataSources.Item("OnHand")
oMatrix.Clear
'For each returned record in recordset then
'add row to matrix and populate it from
'userdatasource.
For i = 1 To nRows
oMatrix.AddRow
oUItemCode.Value = ItemCode(i - 1)
oUItemName.Value = ItemName(i - 1)
oUOnHand.Value = OnHand(i - 1)
oMatrix.SetLineData
Next i
End If
'Show form. This also sets focus to edittext field.
oForm.Visible = True
'Don't display standard SBO item list form.
BubbleEvent = False
End If
End If
Regards,
Andrew. -
Hi
I have a matrix containing numerous columns, one of which is a combo type column and one which is an edit box column containing a choose from list linking to the Item Master.
What I need to happen is if the user selects a particular option from the combo column then the edit box column cell associated with that row will no longer allow the user to use the choosefromlist function and will not validate the value entered with an item. So basically I need to temporarily remove the choosefromlist functionality from this particular cell.
The way I though of doing this was simply using a SAPbouiCOM.EditBox in order to select the particular cell and then try to set the .ChooseFromListUID property to "", however this does not work.
Is there any way that this can be done?
Thanks a lot
Steve
Edited by: Steven Tryner on Jun 9, 2009 4:41 PMYeah I tried implementing this method into my code however the problem I had was stopping the cell from being automatically being validated against an Item, as it does with a choosefromlist. So if the text entered into the cell is not an Item the user can't navigate to any other cell until a valid itemcode is entered.
Is there any way around this?
Thanks -
Choose from List-CFL button is not visible
Hi Experts,
I am using SAP B1 8.8 PL 05 in ramp up. I have observed that in some of the clients PCs in Sales Order window I am not able to see the Choose from list button / CFL button for selecting Customer Or say Item.
This happens only in some Client PCs, where as in other clients PCs it works fine.
BR
Samir GandhiHi Rashid,
I did that. Now the indicator is displayed, but still I am not able to see the customer / item list.
BR
Samir Gandhi -
Removing Duplicates from a choose from list
Hi All,
I have a choose from list of obj 73 )Catalog Numbers (Table OSCN)
I also added conditions in the CFL that it only shows the Substitute for the CardType = 'S' (Supllier) Business Partners.
But I want to remove all the duplicate Substitutes from the CFL so that only distinct Catalog Numbers shows in the CFL.
// Adding 2 CFL, one for the button and one for the edit text.
oCFLCreationParams.MultiSelection = false;
oCFLCreationParams.ObjectType = "73";
oCFLCreationParams.UniqueID = "CFL1";
oCFL = oCFLs.Add(oCFLCreationParams);
//Adding Conditions to CFL1
oCons = oCFL.GetConditions();
oCon = oCons.Add();
oCon.Alias = "Substitute";
SAPbobsCOM.Recordset oSuppliers = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
oSuppliers.DoQuery("Select Distinct t1.Substitute From OSCN t1 Join OCRD t2 on t1.CardCode = t2.CardCode Where t2.CardType = 'S' Group By t1.Substitute");
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
while (!oSuppliers.EoF)
oCon.CondVal = oSuppliers.Fields.Item(0).Value.ToString();
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;
oCon = oCons.Add();
oCon.Alias = "Substitute";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oSuppliers.MoveNext();
oCFL.SetConditions(oCons);
Please advise....
Kind Regards,
Brenden DraperHi Brenden,
what you are trying to archieve won't work. Simply because CFL is getting all row data from OSCN and ItemCode or CardCode can differ for a specific substitute.
For example.
ItemCode,CardCode,Substitute
ItemA,BP1,sub1
ItemA,BP2,sub1
Would be 2 resultlines both with sub1 as substitute.
SQL equivalent :
Select Distinct t0.* from oscn t0 inner join OCRD t1 on t0.CardCode = t1.CardCode where t1.CardType = 'S'
My advise would be to open a simple form with a grid and datatable bound.
Some lines of coding and you get all you need.
regards,
Maik
Maybe you are looking for
-
Time Machine Backing Itself up On Time Capsule
I'd posted this in the Mtn Lion discussion area, but figured I'd see if I got any thoughts from the Time Capsule Area... I have two separate computers exhibiting the same behavior: When I use a USB external drive on either computer for a backup disk,
-
How can I join 24bit tracks without ripping from CD?
I've begun to upgrade my library to 24 bit audio, and many of the albums I want to upgrade have tracks which should be "joined." But if I buy, say, Pink Floyd's Dark Side Of The Moon from HDTracks, and want to have each side play as one continuous t
-
Bookmarks panel is broken, how to fix?
After I've restarted my FireFox the bookmarks panel appears to be broken: it doesnt contain anything and I can't drag and drop something on it. There's some screenshots: i.imgur.com/hlJ3UKf.png http://i.imgur.com/YMHtFrq.png
-
From hdd to ssd: what about os and all data?
Hello everybody. I know there are a lot of discussion about it and i read lots of them, But maybe because english is not my first language, i have some problems in understanding the right things to do. Also, i am pretty new with mac world as i just h
-
Mail upgrade crashes in Mountain Lion
I cannot get Mail to upgrade after ML install? Suggestions?