0

I would like to create a field on a form that users can click on to reference a sharepoint file that is in a static location. I created a script and added it to the page but I'm getting an error message. Can anyone please help?

Script:

function createUrl () {
    var VersionSpreadsheet = "https://mycompany.sharepoint.com";
    Xrm.Page.data.entity.attributes.get("new_VersionSpreadsheet").setValue(VersionSpreadsheet);
}

Error:

One of the scripts for this record has caused an error. For more details, download the log file. TypeError: Cannot read property 'setValue' of null at createUrl

1

1 Answer 1

1

The attribute names are case sensitive and it should be all lowercase. Also the shortcut and crisp version is below.

function createUrl () {
    var VersionSpreadsheet = "https://mycompany.sharepoint.com";
    Xrm.Page.getAttribute("new_versionspreadsheet").setValue(VersionSpreadsheet);
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much, I reviewed the attribute closer and found another mistake.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.