web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Field attachment on CRM

(0) ShareShare
ReportReport
Posted on by 790

dear all

i found the following code to solve the problem of adding a field of type attachment, it is working fine, but i need to be able to show the filename next to the button after upload is successful.

can you help me?

the code is :

<html><head>

<style>
.button {
background-color: 00bfff;
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 10px;
cursor: pointer;
border-radius: 6px;
background-color: #ff0054;
}
</style>
<script>
function Addattachment()
{
var entityETC=10007; //entity code
var entityID =window.parent.Xrm.Page.data.entity.getId();//to read parent record ID
parent.Mscrm.RibbonActions.addFileToRecord(3, entityID) ;


}

</script>

<meta charset="utf-8"><meta><style type="text/css">P { margin: 0; }</style><meta><style type="text/css">P { margin: 0; }</style><meta><style type="text/css">P { margin: 0; }</style><meta></head>
<body style="overflow-wrap: break-word; word-wrap: break-word;" onfocusout="parent.setEmailRange();">
<button class="button" onclick="Addattachment()">Attach</button>
</body></html>

So i want to show the file name as in the below image :

3324.3.png

thanks,

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    sandeepc Profile Picture
    5,514 on at

    community.dynamics.com/.../206038

  • Ahmad Saud Profile Picture
    790 on at

    it is different from what i need.

    thanks,

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi Ahmad,

    You can query entity basedon the objectregarding id and fetch fiels names from notes entities and add them next the field.

    You can use Rest Builder to build your query to get field names.

    github.com/.../CRMRESTBuilder

  • Ahmad Saud Profile Picture
    790 on at

    thanks a lot Mahender for your quick and useful feedback.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans