I would like to use a visualforce page to send the ID's of selected Invoices to an external URL when a Custom button is clicked.
I created a custom button that redirects to a visualforce page, so far so good. But when I try to write a simple visualforce page with a standard controller on Invoice, i get the error "Invoice does not exist" when trying to save the page.
Below is the page code:
<apex:page standardController="Invoice" recordSetVar="invoices">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="../../soap/ajax/48.0/connection.js" type="text/javascript"></script>
<script>
var idArray = '{!selected}'.replace("[", "").replace("]", "").replace(" ", "").split(',');
$(document).ready(function () {
if (!!idArray && idArray.length > 0 && idArray[1].length > 0) {
postData(idArray);
} else {
alert("Please select at least one record.");
}
});
function postData(idArray) {
... ajax call goes here ...
}
</script>
</apex:page>
Is it normal I can't use a standardcontroller for Invoice? The developer docs say there are standard controllers for all queryable objects:
Thanks in advance