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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Fields from product in quick create

(0) ShareShare
ReportReport
Posted on by 1,299

Hi Experts,

I am trying to bring a field from the Product page into the Quick create form of the Opportunity Product page while adding products to the opportunity and dont know how. For each product we have a field named Current cost, i want the current cost to be visible based on what existing product is selected in the fly out menu of the Quick create in Unified Interface. Right now it shows the Price Per Unit and the Units by default based on whats selected in the Existing product lookup and i just want to add the current cost with it too. I understand it has to do something with Mapping but i think its not supported. Kindly help

Thanks in advance for your response.

I have the same question (0)
  • Suggested answer
    M.Azwar Alam Profile Picture
    on at

    Hi

    You can use JS to show Product cost on opportunity product form

    Mark answer as verified, if it is feasible for you

  • Davyjones Profile Picture
    1,299 on at

    Hi Muhammad,

    Thanks for your response.

    Is there any other way to bring it up with OOB customisation?

  • LuHao Profile Picture
    40,892 on at

    Hi Davyjones,

    Does the Quick create form of the Opportunity Product page refer to the new feature "Enhanced experience for adding products to opportunities" of 2020 release wave 1?

    https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-sales/enhanced-experience-adding-products

    If so, there is currently no way to customize this Quick create form. 

    If not, could you provide some screenshots?

  • Inogic Profile Picture
    703 on at

    Hi,

    In Opportunity Product form you want to see the Current Cost of Existing Product selected.

    To achieve the same using OOB method follow the steps given below:

    1) In Customization, go to Product entity and create new Quick View Form where you can add all the fields that you require i.e. in your case Current Cost.

    1Opportunity.png

    2) After this, go to Opportunity Line entity, select the Opportunity Product main form and click on Quick View Form.

    2Opportunity.png

    3) Then go to Quick View form, select Product entity for the lookup & related entity field. Now, select the Quick View Form created with all required fields, after that save & publish it.

    3Opportunity.png

    4) Now, in Opportunity Product form after selecting Existing Product you can see Current Cost as shown below, this is because of the Quick View Form we added.

    4Opportunity.png

    Thanks!

  • Davyjones Profile Picture
    1,299 on at

    Hi Lu,

    We are not in the enhanced experience yet, BTW if that the direction Microsoft is going then i think what i am trying to do here is going to be in vain.

    Hi Roohi,

    So you are suggesting to create a new quick create form and do the customization there and it will work, right?

  • Verified answer
    LuHao Profile Picture
    40,892 on at

    Hi Davyjones,

    1. Don't worry, "Enhanced experience for adding products to opportunities" is another "Add Product" button, you could still use the original button to add opportunity line product.

    pastedimage1583720664905v1.png

    2. Unfortunately, Quick View Form cannot be added to Quick Create Form.

    So we need to add a Javascript Onload event to Quick Create Form to automatically populate the "Current cost" with the value of Opportunity's "Current cost".

    This is the field of the Opportunity entity.

    pastedimage1583722859924v3.png        pastedimage1583722879583v4.png

    This is the field of the Opportunity Line entity.

    pastedimage1583722823910v2.png        pastedimage1583722903924v5.png

    This is the Javascript code.

    function CurrentCost(executionContext){
        var formContext = executionContext.getFormContext();
        
        var opportunity = formContext.getAttribute('opportunityid').getValue();
        
        if (opportunity != null) {
            var opportunityId = opportunity[0].id.replace("{","").replace("}",""); 
    
            Xrm.WebApi.retrieveRecord("opportunity", opportunityId, "?$select=new_currentcost").then(
                function success(result) {
                    formContext.getAttribute('new_productcurrentcost').setValue(result.currentcost);
                },
                function (error) {
                    console.log(error.message);
                    // handle error conditions
                }
            );
        }
    }

    This is the form event for Quick Create Form.

    pastedimage1583722978596v6.png        pastedimage1583723002838v7.png

    After setting the Javascript and OnLoad event, when we click the Add Product button of the Opportunity form, the field "Current cost" of the Quick Create Form will automatically display the value of "Current cost" of Opportunity.

    pastedimage1583723121946v8.png

  • Inogic Profile Picture
    703 on at

    Yes, it will work.

  • LuHao Profile Picture
    40,892 on at

    Hi Davyjones,

    Has your issue been resolved? Do you need more help?

    Don't forget to click Yes under "Did this answer your question?" to close this thread.

    Thanks.  :)

  • Davyjones Profile Picture
    1,299 on at

    Yes Lu,

    Thank you for your response as always you have been very helpful. I have not tried this yet, but i am sure it will work.

    Thanks again.

    Roohi,

    Apologies i misunderstood quick view form to quick view itself.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans