Custom value in XMLPort with Codeunit

bosarebobosarebo Member Posts: 5
edited 2012-09-24 in NAV Three Tier
Hello,

I've created a XMLPort in combination with a Codeunit and Web Service to export data from NAV.

How do I set the custom fields that don't match a value in a table?

This is my XMLport:
Node Name Node Type Source Type Data Source
BosaTech Element Text <BosaTech>
Tech Element Table <Employee>(Employee)
id Attribute Field Employee::No.
street Element Field Employee::Address
firstname Element Field Employee::First Name
fullname Element Text <fullname>

My first custom field is fullname and I want it to be Employee::First Name + Employee::Last Name.

I've tried to set it in the trigger fullname - Export::OnBeforePassVariable()

fullname := 'export' + 'foo'; // works fine but how do I access the first and last name of the current employee?


fullname := MyTech."First Name" + MyTech."Last Name" // Compiles but where do I initialize the global variable MyTech of type Record Employee???

Thanks for any hint!

Comments

  • kinekine Member Posts: 12,562
    Each "data item" have own variable in the XMLPort, like in report. Through this you can access the record from this table as usual.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • bosarebobosarebo Member Posts: 5
    Thanks for your reply. Now I understand how it works. My data item is Employee so this way I can access the record values:

    fullname := Employee."First Name" + ' ' + Employee."Last Name"

    Cheers.
    kine wrote:
    Each "data item" have own variable in the XMLPort, like in report. Through this you can access the record from this table as usual.
Sign In or Register to comment.