web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Potential customer contact person in quote

(0) ShareShare
ReportReport
Posted on by 125

Hi all,

I have a requirement where I need to ask the user to select contact person if potential customer selected is an account on Quote form.

The printed quote needs to have potential customer as (Account name or contact name) and Contact person as contact person of the account.

Is this possible?

Thanks,

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Potential customer contact person in quote

    Hi Aarnav,

    Some details need to be confirmed:

    1. Is the Contact Person your custom field?

    2. The user should select the contact which is related to the account.(Not all contacts, right?)

  • Aarnav Profile Picture
    125 on at
    RE: Potential customer contact person in quote

    Hi Steve,

    Contact person doesn't exist yet. Having this information is a requirement. I was wondering if Dynamics already has OOB feature to store contact person.

    I am now thinking of creating a new custom field to store contact person in Quote eneity.

    Yes, your question #2 is correct. I believe this can be achived using business rule.

    Thanks

  • Aarnav Profile Picture
    125 on at
    RE: Potential customer contact person in quote

    Hi Steve,

    How can we find out if user selected Account or contact as potential customer?

  • Suggested answer
    Aarnav Profile Picture
    125 on at
    RE: Potential customer contact person in quote

    I managed to fullfil the requirement by creating a lookup (type contact) field in Quote enity and using Javascript. I am calling tthe function on form load and potential customer (costomerid) on change.

    function ShowHideContactPersonField(executionContext) {
    var formContext = executionContext.getFormContext(); // get formContext

    var lookup = new Array();
    lookup = formContext.getAttribute("customerid").getValue();
    if (lookup != null) {
    var id = lookup[0].id;
    var entityType = lookup[0].entityType;
    }

    if (entityType == "account") {
    //show contact person field
    Xrm.Page.getControl("bp_contact_person").setVisible(true);
    } else {
    Xrm.Page.getControl("bp_contact_person").setVisible(false);
    formContext.getAttribute("bp_contact_person").setValue(null);
    }

    }

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at
    RE: Potential customer contact person in quote

    Hello Aarnav,

    Still little confusion, can you clear the below points.

    1. End user can select the account or contact on the same lookup correct? that means it is multi entity lookup?

    2. And if user is selecting the account then you will show the contact person field on the form correct ? else you will hide the field because in the main field user has selected the contact rather than the account ?

    Thank you,

    Amit Katariya

  • Aarnav Profile Picture
    125 on at
    RE: Potential customer contact person in quote

    Yes that's exactly what my code does

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at
    RE: Potential customer contact person in quote

    so what you want to implement ? if your code is working then

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Potential customer contact person in quote

    Hi Aarnav,

    Although there is a contact field on the Quote entity, but it could not be added to the form. 

    pastedimage1652321781125v1.png

    So you need to create a new lookup field related to Contact entity.

    pastedimage1652321992863v2.png

    Then add to the Quote form:

    pastedimage1652322203018v3.png

    About how to find out if user selected Account or contact as potential customer, you could achieve this by JS code in which you could get lookup field's entity type and set Contact Person field required.

    Reference:

    https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/formcontext-data-entity/getentityreference

    https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/attributes/setrequiredlevel

     

    About how to only select the related contacts, you could set 'Related Records Filtering' to do this.

    pastedimage1652335011979v5.png

    Reference:

    Special field properties in Dynamics 365 Customer Engagement (on-premises) | Microsoft Docs

    How to Filter Lookups Without Custom Code in Dynamics 365 Customer Engagement (arbelatech.com)

  • Aarnav Profile Picture
    125 on at
    RE: Potential customer contact person in quote

    Hi Steve,

    This is what exactly I have done. Please see my reply above.

    I am marking your answer and accepted answer because you guided me to that direction.

  • Gus Profile Picture
    218 on at
    RE: Potential customer contact person in quote

    Just setting up quotes - orders - invoices from oppty and I have no issue adding custom field and mapping from oppty to quote - quote to order - order to invoice.  However, the contact, account info is not clear which way D365 wants us to handle to me.  Really I just want it to work out of box or as close knowing future updates may fix these things so I am thinking I want Potential Customer to always be contact - reason is that I believe this is the default field pulled when you email a quote.

    I have a question on optimal setup to link accounts, contacts to quote from opportunity.
    Potential customer just seems strange to use at all but I believe it is what is pulled by default when sending a quote via email. 

    1. If logic is correct, how best to make potential customer always the contact  (e.g. is that sound to force this field to be only one or other so we can always get both?)
    2. Add custom lookup for the account is this mapping oppty to quote I believe and then it will fill upon quote creation. 

    3. I do want both contact and account on the quote XML pdf so I assume that the custom account field will show up, I have potential contact already as a field

    4. Reporting consideration - I just want to be able to run reports on quotes, orders, invoices relating account and/or contact - do I need to map all through like I did with custom fields or relationships exist? I haven't seen if there is any relations needed for reporting quotes, orders or invoices relating to the oppty contact or account to consider or if that will work in reports, etc.


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 235

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 175

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 156 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans