Hello CRM community,
I am pretty new to writing JavaScript and extending CRM. I was self learning pretty well just from other posts and the SDK but am now trying to write a piece of code to auto-populate a field based upon the input of another. I am really struggling with this. For the sake of making it easy on anyone willing to help I will use all standard fields (Relationship Type and Credit Limit) and entities.
Scenario: On the account form, I want the Relationship Type field value to auto-populate a dollar amount in the Credit Limit field
If Relationship Type = Supplier, then Credit Limit should be 0
If Relationship Type = Vendor, then Credit Limit should be 1000
If Relationship Type = Anything else in drop down list, then do nothing (I am yet to find how to tell javascript to do nothing
Below was my best attempt although I am sure it is littered with errors
function populate_credithold()
{
if (Xrm.Page.getAttribute("
{
(Xrm.Page.
}
else{
(Xrm.Page.getAttribute("
{
(Xrm.Page.getAttribute("
}
}
else{
(Xrm.Page.getAttribute("
{
(Xrm.Page.getAttribute("
}
}
}Can anyone please help a noobie JavaScript writer out?
Thank you in advance