Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

GetData() and SetData()

Posted on by Microsoft Employee

Hi,

As per the documents  provided by Microsoft, I tried to create a simple document type report called Sales Price with  dataitems such as 'Sales header' and 'sales Line' and 'Integer type ' .

I created the code as shown below

Shared Offset As Integer
Shared NewPage As Object

Public Function GetGroupPageNumber(NewPage As Boolean, PageNumber As Integer) As Object
If NewPage
Offset = PageNumber - 1
NewPage = False
End If
Return PageNumber - Offset
End Function

Public Function IsNewPage As Boolean
NewPage = True
Return NewPage
End Function

Shared Data1 as Object
Public Function GetData(Num as integer , Group as integer) as Object
if Group = 1 then
Return Cstr(Choose(Num, Split(Cstr(Data1),Chr(177))))
End If
End Function

Public Function SetData(NewData as Object,Group as integer)
If Group =1 and NewData >"" Then
Data1 = NewData
End If
Return True
End Function

 

Later inserted Textbox in the body with hidden property as shown below

= Code.SetData(Cstr(Fields!No.Value) + Chr(177) + Cstr(Fields!CustomerNo.Value) + Chr(177)  +      Cstr(Fields!SelltoCustomerNo.Value) + Chr(177) + Cstr(Fields!SellToAddress.Value)    +Chr(177) +Cstr(Fields!SellToCity.Value) + Chr(177) +Cstr(Fields!SellToCountry.Value),1)

 

Inserted textboxes in header for dispalying the Header data with each textboxes expression as '=Code.GetData(6,1)   etc

But  while running the report the system is dispalying only one Sales order header with no  Sales lines under it.

Why it is So? Plz check it.

Plz help.

Thanks ,

J3M 

*This post is locked for comments

  • Suggested answer
    Marcellus Profile Picture
    Marcellus 2,735 on at
    RE: GetData() and SetData()

    Hi J3M,

    You should check this tutorial: How Do I Build a document report in Microsoft Dynamics NAV 2013

    Regards,

    Marcell

  • Suggested answer
    Saurav.Dhyani Profile Picture
    Saurav.Dhyani 17,965 Super User 2024 Season 2 on at
    RE: GetData() and SetData()

    Check -

    Your Dataset by -

    1. in Request page click help - about this report.

    2. Preview report and then click on about this report.

    And check what are the values in these fields in first row of dataset. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans