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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans