Reputation: 1
I've created a application for D365 in my power apps enviornment. This application is called Projects its based of a table of the same name that has a many-to-many relationship with accounts and contacts. I've also created a custom button and I want to link a process/workflow to that button that will create a quick campaign for both the accounts and contacts related to that project entity.
I'vew tried to work it out in power apps but the farthest I have gotten is having a process that does a campaign and launches a campaign activity but I do not see a way in power apps to connect that activity to a account/contact related to the project. I've also tried to use power automate but I do not think any of the dataverse options will work.
Upvotes: 0
Views: 34
Reputation: 446
You can achieve this in few steps.
Set up a button on Ribbon to initiate the process. You can use RibbonWorkbench tool by XRMToolBox to do this.
Link this button to a command with a JavaScript Library function and pass the primary Control.
function callHttpFunction(recordId) {
var formContext = primaryControl; // Using primaryControl directly as the form context
var recordId = formContext.data.entity.getId();
var url = "Replace this URL with the actual endpoint of your HTTP function";
var data = JSON.stringify({
recordId: recordId
});
var req = new XMLHttpRequest();
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/json");
req.onreadystatechange = function() {
alert("Sync started successfully.");
};
req.send(data);
}
Upvotes: 0