Hi,
I have the following requirement from a potential client in the service management module:-
1) Case can only be raised by a contact (not customer/account as per default)
2) Case can be regarding an account but not raised by an account (so a contact raises a case and might say it is regarding account B. We should be able to show that on the case record and be able to see all recent cases against the account as well as the contact.)
3) The contact raising the issue might not be related to the account at all.
How do i do this? Case management has customer field as mandatory and if you choose an account, you can't choose a contact not related to the account. I am at a bit of a loss on how to configure this and is there would be repercussions.
Thanks!
J
Works like a charm. Thank you!
Oops. I forget to mention that while registering the method, you need to pass execution context. refer the second point in the below thread-
docs.microsoft.com/.../walkthrough-write-your-first-client-script
Hope this helps.
Hi Ravi,
Thanks for this. I get an error msg when i try to use your script. I created an onload control that calls setcustomerfieldtocontactinly function
I am not a coder and this is the first time i have dealt with scripts so any help would be appreciated.
Thanks!
J
As an alternate solution, you can restrict the customer lookup to display only contact record (not account) so this way you could still use the system as is (you need to create separate Account field for your 2nd requirement though).
You can refer the below scripts for either copy or setting default to contact-
==============================
function setCustomerFieldToContactOnly(executionContext) {
var formContext = executionContext.getFormContext(); // get formContext
formContext.getControl("customerid").setEntityTypes(["contact"]);
}
================
Hope this helps
Hi,
1) You cannot remove Customer field as it is sytem required however you can write a javscript to copy the value from Contact field to Customer field. You can then hide the customer field and make Contact field as required.
2) For this, you can create a new lookup field "Account". This should help you achieve your requirement.
3) By doing the above 2, you will not face this issue
Hope this helps.
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,900 Super User 2024 Season 2
Martin Dráb 229,297 Most Valuable Professional
nmaenpaa 101,156