Raj
Raj

Reputation: 343

How to identify Contact/Business type from the Customer datatype in CRM 365?

I have created 'Customer' datatype in one of our custom entity. From there if I try to query to find whether the customer is of contact/Account by using the following query,

enter image description here

   SELECT customer FROM entityname
            INNER JOIN contact ON ContactId=contact_account_customer

I am getting error saying invalid column name. I would like to know whether the relationship name to contact and account is useful to find whether customer is contact or account. If not whats the use of this relationship name?

Upvotes: 1

Views: 132

Answers (1)

Try this:

Entity Name: new_promotionaloffer
Attribute Name: new_luckycustomer

SELECT new_luckycustomer FROM new_promotionaloffer E
LEFT JOIN Contact C ON C.ContactId = E.new_contact_new_promotionaloffer_LuckyCustomer
LEFT JOIN Account A ON A.AccountId = E.new_account_new_promotionaloffer_LuckyCustomer

enter image description here

Upvotes: 1

Related Questions