How to get a field from another table ?

Hi All,

I’m writing following code in OnPresection of Customer’s body. I’m using Customer table as the only data item for my report. In this
glacc is the record type of G/L Entry table & glaaccname is of data type code.

IF glacc.GET(glacc.“G/L Account No.”) THEN
glaccname := glacc.“G/L Account No.”;

But it’s not giving me the G/L account No. [:S]

… Kindly help .

Cheers,

Navitech

How is “glacc” initialized previously? I think you never never assigned a record to “glacc”

Hi,

It’s not initialized then can u kindly guide me what code i should be writing to get the result ?

Thanks in advance ,

Navitech

Hi,

Can u plz guide me on this ?

What do You want to achieve?

You say that the report only uses Customer as DataItem, and “G/L entry”-record as variable.

The only direct connection between these tables, is “Source No.” on the “G/L entry”.

IF glacc.GET(glacc.“G/L Account No.”) THEN
glaccname := glacc.“G/L Account No.”;

I think you have yourself in a bit of confusion here.

You say GLAcc is “G/L Entry”, the primary key for this table is “Entry No.” but you are trying to move the pointer to it based on the “G/L Account No.”, so as it stands I doubt the code you have is going to give you the results you are looking for.

Also, althought it is your choice, I don’t recommend your naming convention, GLAcc should really be used to reference the G/L Account table, and GLEntry for the G/L Entry table.

Can you give us a little more detail of what you are trying to achieve and we’ll see if we can help.

/TH

Hi Navitech,

Going through your post, I was not able to understand, what are you actually trying to acheive from writing the code on the presection of the Customer dataitem. Is your customer table customized to hold a G/L account no. of each customer? And the code is not going to help you in fetching the record as the GL entry as the PK as entry no. and the GET function will not work in this situation.

It would be really great if you can tell us the exact requirement so that we all can help you out.

I’m pretty sure thats what I already said, your not trying to improve your points are you? [;)]

/TH

Hi All,

thx a lot for the posts …i’ve managed to solve the issue [:P] … The current issue however is that i wanna know that what all things( Meaning where does the information flow when i post & choose Receive ?) get hit during a Purchase Order posting in these scenarios : (a) Receive (b) Invoice & (c) Receive & Invoice .

Wating for your replies Xperts …

Cheers,

Navitech

Hey Navitech,

This has been asked before, and it depends on what details you are looking for. If your looking for a Entity Type diagram have a look at this post

Entity Diagram

But if its a precursor to a development you are planning that if you let us know what your trying to acheive we might be able to offer more specific information.

/TH

Hi Tony,

Please take a look at this post Posting rules for the beginners forum. Specifically;

  • Feel free to answer a question even if its already answered, all ideas will help the original poster and you to learn Navision

We really do want to encourage beginners to post as much as possible in The Beginners Forum, even if they are duplicating, since they will learn by writing down their idea.

Diptish, its great to see how fast you have gone from asking questions to answering questions. Keep up the great work, and I hope you can use this site to greatly enhance your Navision knowledge, whilst at the same time becoming a great communiteer. [Y]

I took that to mean a different approach not exactly the same one reworded!

But if that’s the rules thats the rules.

/TH

Basically that moderator guy is just doing his job [;)], … let me word it more in my voice.

When Erik first created The NAV Beginners forum, we discussed the pros and cons a lot. The main reason for this forum, was to have an area somewhere between Break Space and the End User forum, where people could basically get started with Navision Questions, but most importantly it was designed as an area where new users could start posting answers, with out an fear, and just throw their shyness away. You an I probably can’t remember back to those first few posts where we answered a question, and then waited in intrepidation in case we were wrong.

So the idea was that users could consider this forum as something like a Cronus forum, and if they were wrong, then just move on no damage done. Normally I would let it go, but in this case, Diptish is a new user that went very quickly from getting information from the Community, to giving back very fast. And that is the hardest step in any community like this. I just want to encourage Diptish, and all the others out there.

You, as a highly respected long term Navisioner and Communiteer, can feel some pride in the fact that Diptish has obviously learn’t from you and is giving back.

Tony keep up the great work, and Diptish we hope to see a lot form you in the future.