I am looking to do my first bit of form scripting, I need to update the name field on the project relationship form to be the Opportunity + " - " + Account
Now I have gone into form properties and tried to modify an example helloWorld function -
Function helloWorld() { var varMyAccountValue = Xrm.Page.getAttribute(“Account”).getValue() ; var varMyOpportunityValue = Xrm.Page.getAttribute(“Opportunity”).getValue() ; var varMyOpportunityAccountValue = varMyOpportunityValue + " - " + varMyAccountValue alert("Details " + varMyOpportunityAccountValue ); }
Then in the Field Properties for Account I have added the helloWorld.
Now if I try to preview it doesn't appear to have worked as nothing happens but when I close the form, I receive an error message:
CrmScriptErrorReport><ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>The value of the property 'helloWorld' is null or undefined, not a Function object</Message>
<Line>298</Line>
Can anyone point me in the direction of where I am going wrong?
Matt