Question Status

Verified
jsshivalik asked a question on 16 Dec 2017 10:43 AM

Hi

   What the below code does . I have defined Location_Rec in C/Al Globals as Record DataType


IF Location_Rec.GET("Location Code") THEN;

I want to display Location Details of that record in Report Header.

Thanks

Reply
Suggested Answer
Shan Abeywicrema responded on 16 Dec 2017 2:03 PM

GET function is use to find values, which is based on primary key. So in your code it says find the location based on the location code.

Using IF condition we can do the error handling.

Now you can access location details, like location Name, Address what ever details in Location table (14)

For instance, In location table suppose you have four locations, Red, Green, Blue, Yellow;

In your sales order or purchase order you have selected location code as Blue.

Now with your code, it will check whether we have location code blue in the location table, if yes program will catch the record, and you can access any details related to location blue.  Location.Name ., Location.Address like wise

More Information about GET function

navsupports.com/dynamics-nav-get-function

If you think this will help you. You can mark as Verified answer.

Reply
jsshivalik responded on 17 Dec 2017 12:34 AM

Hi

   U mean to say by writing below code i can access all details of that Location

Location_Rec.GET("Location Code");

Thanks

Reply
Verified Answer
Shan Abeywicrema responded on 17 Dec 2017 12:56 AM

Yes of course. If the Location found in Location table then you can access all details related to given location.

If you think this will help you. You can mark this answer as Verified answer.

Reply
Verified Answer
Shan Abeywicrema responded on 17 Dec 2017 12:56 AM

Yes of course. If the Location found in Location table then you can access all details related to given location.

If you think this will help you. You can mark this answer as Verified answer.

Reply
Suggested Answer
Shan Abeywicrema responded on 16 Dec 2017 2:03 PM

GET function is use to find values, which is based on primary key. So in your code it says find the location based on the location code.

Using IF condition we can do the error handling.

Now you can access location details, like location Name, Address what ever details in Location table (14)

For instance, In location table suppose you have four locations, Red, Green, Blue, Yellow;

In your sales order or purchase order you have selected location code as Blue.

Now with your code, it will check whether we have location code blue in the location table, if yes program will catch the record, and you can access any details related to location blue.  Location.Name ., Location.Address like wise

More Information about GET function

navsupports.com/dynamics-nav-get-function

If you think this will help you. You can mark as Verified answer.

Reply