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,
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156