cancel
Showing results for 
Search instead for 
Did you mean: 

CFL not loading data

Former Member
0 Kudos
334

Hi Experts,

We are filling the form based on the entry we select from choose from list . The problem is the data should be filled automatically when we choose from list , But in our case it is not doing so at choose from list after event . Hence we are using Lost focus After event to fill the data in other form filed .But I think this is not the right way of doing this . Can you please suggest me some way of loading data on Choose from list after .

PS:- I am using Conditions in CFL . Are those creating the problem ?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Edy and Pallavi ,

Thanks for your suggestions but , the problem is not with Is_BML.ValOn ="Y" ,the error comes on

Is_BML.Checked =True . General Failure Error .Do you have idea of this error ? Whats the reason for this error ?

Regards ,

Mayank Sharma

edy_simon
Active Contributor
0 Kudos

Hi Mayank,

Instead of setting the

Is_BML.Checked =True

Set the base datasource to 'Y'

ie if the Is_BML is bound to a DBDataSource,

form.DataSources.DBDataSources.Item("@DB").SetValue("Is_BML", 0,"Y")



Regards

Edy


edy_simon
Active Contributor
0 Kudos

HI Mayank,

Conditions should not be a problem.

Do you have SAP Business One event logger installed ?

If yes, try to use this tool to see if the event is actually fired.

If it is not fired, it may be a PL bug.

If it is fired, but your program failed to catch the event, you need to look for what canceled the event in your addon.

there are many things to check, here are a few :

1. Do you use event filter ? if yes, make sure you do not filter out this event and form.

2. Did you set bubble event = false / return false on the Before Choose From List event ?

3. Is there any error while processing the Before and After event of this Choose From List ?

4. How did you generate your addon ? By B1DE ? or B1Studio ?

5. Can you show us your event handler for this event ?

Regards

Edy

Former Member
0 Kudos

HI    ,

Thanks for your suggestions . The problem now is  ,The CFL is working fine when we try to choose the item by mouse clicking . But we have to show the data population on Filling the text field and then pressing tab .In that case it is not showing anything.

Regards,

Mayank

Former Member
0 Kudos

this is the 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 = SBO_Application.Forms.Item(FormUID)

                Dim oCFL = oForm.ChooseFromLists.Item(sCFL_ID)

              

                If (oCFLEvento.BeforeAction = False) Then

                 

                Else

                 

                    Dim conds As SAPbouiCOM.Conditions = oCFL.GetConditions

                    Dim dbConnection As CRM_DevEntities1 = New CRM_DevEntities1

                    Dim cond As SAPbouiCOM.Condition

                    If (conds.Count > 0) Then

                        Return

                    End If

                    Dim cmpnyCats = (From e1 In dbConnection.C_CR_CA

                    Where e1.U_IS_SITE_ACC_REQ = "True"

                           Select e1.U_FK_CRMID).ToList

                SAPbouiCOM.BoConditionOperation.co_EQUAL, "COMPANY,cmpnyCat.ElementAt(0)", SAPbouiCOM.BoConditionRelationship.cr_AND)

                    cond = conds.Add

                    cond.BracketOpenNum = 2

                    cond.Alias = "U_CONTACT_TYPE"

                    cond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

                    cond.CondVal = "COMPANY"

                    cond.BracketCloseNum = 1

                    cond.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND

               

                   

                    For iCounter As Integer = 0 To (cmpnyCats.Count - 1)

                        If iCounter = 0 Then

                            cond = conds.Add

                            cond.BracketOpenNum = 1

                            cond.Alias = "U_XXXXX"

                            cond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

                            cond.CondVal = cmpnyCats.ElementAt(iCounter)

                            cond.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR

                        End If

                        If (iCounter = (cmpnyCats.Count - 1)) Then

                            cond = conds.Add

                            cond.Alias = "U_XXXXX"

                            cond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

                            cond.CondVal = cmpnyCats.ElementAt(iCounter)

                            cond.BracketCloseNum = 2

                        Else

                            cond = conds.Add

                            cond.Alias = "U_XXXX"

                            cond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

                            cond.CondVal = cmpnyCats.ElementAt(iCounter)

                            cond.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR

                        End If

                    Next

                    If (cmpnyCats.Count > 0) Then

                    End If

                    oCFL.SetConditions(conds)

                End If

            End If

former_member241304
Active Participant
0 Kudos

Hi Mayank Sharma,

I'm Providing one example : i need to Filter CardType of 'C'

So i will call the method like: CFLfilter(objform.uniqueid,"C")

Keep the below lines in one method:

            Dim oConds As SAPbouiCOM.Conditions

            Dim oCond As SAPbouiCOM.Condition

            Dim oCFL As SAPbouiCOM.ChooseFromList

            Dim emptyCon As New SAPbouiCOM.Conditions

            oCFL = oForms.Item(FormUID).ChooseFromLists.Item(CFL_ID)

            oCFL.SetConditions(emptyCon)

            oConds = oCFL.GetConditions()

            oCond = oConds.Add()

            oCond.Alias = "CardType"

            oCond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

            oCond.CondVal = CardType

            oCFL.SetConditions(oConds)

Try Like dis,I think it will help you.

Regards,

P.Pallavi

edy_simon
Active Contributor
0 Kudos

Hi Mayank,

I don't get your question and your code.

Are you asking how to populate another EditText after you CFL from another text?

ie. user choose a CardCode, and the CardName is auto filled ?

But then again, your code is showing the part where you set a condition to CFL,

Can you please elaborate a little more by providing example, screenshot ?

Regards

Edy

Former Member
0 Kudos

Hai,

            once ensure, did you  check the find  check box against your UDO

Former Member
0 Kudos

Hi Edy ,

We are filling the form based on the value of Legal Name CFL .What we are doing is ,filling the legal name filed and press tab .The problem with this that I have found is , It is giving 'General Failure ' error .

While filling some of the fields . We are using entity framework model to fetch data

Dim BML As String = companyCat.U_IS_BML

If (BML = "True") Then

                Is_BML.Checked = True

               Is_BML.ValOn = "Y"

             Else

                 Is_BML.ValOff = "N"

             End If

          

Hope you got the scenario . I'll provide the further details if required

Regards ,

Mayank Sharma

edy_simon
Active Contributor
0 Kudos

Hi Mayank,

On which line did you get the general failure error ?

I assume your Is_BML is declared as a CheckBox object.

You do not need to provide the Is_BML.ValOn = "Y" and Is_BML.ValOn = "N"

By default it is already 'Y' and 'N'

Just make sure that your Is_BML object is bound to a datasource.

Regards

Edy

former_member241304
Active Participant
0 Kudos

Hi Mayank Sharma,

Dim Chk as SAPbouiCOM.CheckBox=oform.items.item("UniqueID").Specific

if Chk.Checked=true

'Here write after checking the Checkbox what you need next

else

'Here write if Checkbox is not checked what you need to do next

end if

and In  above mentioned code no need s_BML.ValOn = "Y",s_BML.ValOn = "N".

just Chk.Checked=true and Chk.Checked=false