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 :
thanks,
*This post is locked for comments
thanks a lot Mahender for your quick and useful feedback.
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.
it is different from what i need.
thanks,
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6