Options

Problems with subform

ConsilioConsilio Member Posts: 7
In a form we have created a subform. The data is this subform is accessed via a view in SQL server. With linked object control we can access the data in a this form and show us all the data.
However we only see one item when we link the form with this "view created subform".. To link the data from the form with the subform we use in the subform properties the attribute subformlink the following code: "Buy-from Vendor No_=FIELD(No.)"

Anyone an idea?

Comments

  • Options
    kinekine Member Posts: 12,562
    And are you sure, that there are more lines which are in this filter?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    ConsilioConsilio Member Posts: 7
    Yes I am.. when I open the subform there are more results. If I don't fill in "Buy-from Vendor No_=FIELD(No.)" in the subformlink atrribute it shows all the results
  • Options
    kinekine Member Posts: 12,562
    Ok, and if you see all results and set filter to "Buy-from Vendor No_" to value you have on the form, you see more records or only one too???
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    ConsilioConsilio Member Posts: 7
    Yes, only one :(
  • Options
    kinekine Member Posts: 12,562
    It means, that there is only one record within filter.... other records have some difference in the field... (check them for spaces etc.)

    Your code is ok, data are not "correct" (or as expected)... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    ConsilioConsilio Member Posts: 7
    Data is correct.. because when I delete that row which first shown in the form via my view made in SQL server, I see the next row in the form but again only one item and no more :?
  • Options
    kinekine Member Posts: 12,562
    Have you some other C/AL code on the subform (for example in OnNextRecord etc.)?

    Can you send me text file with the object (subform and form)?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    ConsilioConsilio Member Posts: 7
    No no extra code.. Just made with the object designer and linked with the subformlink



    Form Code


    Documentation()

    Form - OnInit()

    Form - OnOpenForm()

    Form - OnCloseForm()

    Form - OnQueryCloseForm() : Boolean

    Form - OnActivateForm()

    Form - OnDeactivateForm()

    Form - OnFindRecord(Which : Text[1024]) : Boolean

    Form - OnNextRecord(Steps : Integer) : Integer

    Form - OnAfterGetRecord()

    Form - OnAfterGetCurrRecord()

    Form - OnBeforePutRecord()

    Form - OnNewRecord(BelowxRec : Boolean)

    Form - OnInsertRecord(BelowxRec : Boolean) : Boolean

    Form - OnModifyRecord() : Boolean

    Form - OnDeleteRecord() : Boolean

    Form - OnTimer()

    Form - OnCreateHyperlink(VAR URL : Text[1024])

    Form - OnHyperlink(URL : Text[1024])


    Subform


    Documentation()

    Form - OnInit()

    Form - OnOpenForm()

    Form - OnCloseForm()

    Form - OnQueryCloseForm() : Boolean

    Form - OnActivateForm()

    Form - OnDeactivateForm()

    Form - OnFindRecord(Which : Text[1024]) : Boolean

    Form - OnNextRecord(Steps : Integer) : Integer

    Form - OnAfterGetRecord()

    Form - OnAfterGetCurrRecord()

    Form - OnBeforePutRecord()

    Form - OnNewRecord(BelowxRec : Boolean)

    Form - OnInsertRecord(BelowxRec : Boolean) : Boolean

    Form - OnModifyRecord() : Boolean

    Form - OnDeleteRecord() : Boolean

    Form - OnTimer()

    Form - OnCreateHyperlink(VAR URL : Text[1024])

    Form - OnHyperlink(URL : Text[1024])
  • Options
    kinekine Member Posts: 12,562
    May be problem of the view or error on the MS SQL server. I know cases, when record is not found correctly with filters etc... may be that it is example. Please try run this SQL query (original value is 0):

    UPDATE [$ndo$dbproperty] SET diagnostics = 131072


    in many cases it helps us, but it is only shot in the dark...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    ConsilioConsilio Member Posts: 7
    The view is correct.. If I open te subform alone it shows me the results. If I put it as a subform in a form and link it shows me only one record.. ](*,)
  • Options
    kinekine Member Posts: 12,562
    Recap:

    If you run the subform alone and set the filter manually you have only one record?

    If you run the subform without filter, you have more records with same values in the filtered field?

    If you run the subform as part of the form and it is linked as you wrote, only one record is shown?

    Can you post example of the records with same values in the filtered field?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.