Hello everyone,
I have 2 forms on the 'Account' entity - Sales/Purchases. I also have a sub-grid linked with a 1:N relationship to the 'Opportunity' entity. The 'Opportunity' entity also has 2 forms - Sales/Purchases.
When I click on the 'New' ( + ) button on the sub-grid, I want to open the Quick Create form for the 'Opportunity' entity which corresponds to the currently opened form from the 'Account' entity.
Example: Customer Mike is with a currently opened form 'Sales'. When I click on the 'New' ( + ) button on the sub-grid, I want to open the 'Sales' Quick Create form for the 'Opportunity' entity.
We also have a customer Jake who is saved with the 'Purchases' form. I want to automatically open the 'Purchases' Quick Create form to create a new 'Opportunity' for Jake.
Is it possible to achieve this behaviour in a supported way in version 8 in the web (NOT Unified Interface) with JavaScript?
I am sorry if the question is confusing I tried to explain the problem in the best possible way. I am open for follow-up questions and comments.
Thank you for taking the time to read my post.
I am verifying Bipins' answer because in the end, his solution was the one we settled for.
Thank you for taking the time to read my post.
Hello Bipin,
Thank you for your suggestion.
Unfortunately, I cannot do what you suggest due to requirement restrictions.
I was thinking, maybe there is a parameter on the Quick Create form which keeps information about the navigation stack which includes its parent form? If there is something similar in the documentation I obviously cannot find it.
Hello,
You can achieve your requirement with two client API -
To get the current form selected - docs.microsoft.com/.../formcontext-ui-formselector
To open quick create form [FormId parameter can be used to open specific quick create form and entityFormOptions["useQuickCreateForm"] = true; to open quick create form] -
docs.microsoft.com/.../openform
You will need to either customize existing new+ button or hide OOB button and add your own button.
Good Luck!
Please mark my answer verified if this is helpful!
Regards,
Bipin Kumar
Follow my Blog: xrmdynamicscrm.wordpress.com/
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148