• Desk API
  • NEWBIE
  • 15 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi everyone. I am trying to develop a VisualForce page which will allow users to selectively send Case attachments to an external service. The way I'm doing this is by selecting all ContentDocumentLinks related to the Case, then displaying them in a table with a "Send" button next to each one.

I thought about using apex:actionSupport as a way to store the ID of the specific ContentDocumentLink, however the variable I'm using to store the ContentDocumentLink is NULL after clicking.

Here is the relevant portion of my VF page:
<apex:pageBlockTable value="{!cdls}" var="cdl">
    <apex:column>
        <apex:facet name="header">Documents</apex:facet>
        <apex:outputText value="{!cdl.ContentDocument.Title}"/>
        <apex:form>
            <apex:commandButton value="Send">
                <apex:actionSupport event="onclick" action="{!sendCdl}">
                    <apex:param name="cdlToSend" value="{!cdl.Id}" assignTo="{!cdlToSend}"/>
                </apex:actionSupport>
            </apex:commandButton>
        </apex:form>
    </apex:column>
</apex:pageBlockTable>

And here is the relevant portion of my controller:
public class SendToV1_Button {

    ...

    public Id cdlToSend {get; set;}

    ...

    public PageReference sendCdl() {
        System.debug(cdlToSend);
        return redirect();
    }
}

Any help would be greatly appreciated.​​​​​​​
Hi everyone. I am trying to develop a VisualForce page which will allow users to selectively send Case attachments to an external service. The way I'm doing this is by selecting all ContentDocumentLinks related to the Case, then displaying them in a table with a "Send" button next to each one.

I thought about using apex:actionSupport as a way to store the ID of the specific ContentDocumentLink, however the variable I'm using to store the ContentDocumentLink is NULL after clicking.

Here is the relevant portion of my VF page:
<apex:pageBlockTable value="{!cdls}" var="cdl">
    <apex:column>
        <apex:facet name="header">Documents</apex:facet>
        <apex:outputText value="{!cdl.ContentDocument.Title}"/>
        <apex:form>
            <apex:commandButton value="Send">
                <apex:actionSupport event="onclick" action="{!sendCdl}">
                    <apex:param name="cdlToSend" value="{!cdl.Id}" assignTo="{!cdlToSend}"/>
                </apex:actionSupport>
            </apex:commandButton>
        </apex:form>
    </apex:column>
</apex:pageBlockTable>

And here is the relevant portion of my controller:
public class SendToV1_Button {

    ...

    public Id cdlToSend {get; set;}

    ...

    public PageReference sendCdl() {
        System.debug(cdlToSend);
        return redirect();
    }
}

Any help would be greatly appreciated.​​​​​​​