jawhar_m
jawhar_m

Reputation: 145

Relation between CompanyInfo and LogisticsElectronicAddress

I want to make a query to get the information of an actual company and put it in a report. I need to get the full name of company, address, phone number and fax.

I tried to get some information about my company from the table "CompanyInfo" but we don't have a field to get phone or fax. I tried a display method, but the method returned nothing!

I want to make a relation between "CompanyInfo" and "LogisticsElectronicAddress" (I can find phone or fax from LogisticsElectronicAddress.Locator where LogisticsElectronicAddress.Type == phone (or fax)).

Can someone please help me to make a display method or query to get what I want?

Upvotes: 1

Views: 3069

Answers (1)

Jan B. Kjeldsen
Jan B. Kjeldsen

Reputation: 18051

Don't make it harder:

Str phone = CompanyInfo::find().phone();
Str address = CompanyInfo::find().postalAddress().Address;
Str zip = CompanyInfo::find().postalAddress().ZipCode;

Will find the current phone number, address and zip code of the current company.

If phone is blank then the phone number is not current. Make sure the phone number is marked "Primary" and that it is valid (in a valid time range as indicated by the ValidFrom and ValidTo fields.

In AX 2012 from "Legal entities", "Contact information", choose "More options" and "Advanced" to see the date rages.

Same thing with the address info.

Upvotes: 4

Related Questions