• Bv1 Triggers
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi,

I want to get community URL from apex class.
Is there anyway to get it?

I have been try the following, but I can't get absolute URL.

test -1- the following source only work when debug in developer console.
Network myNetwork = [SELECT Id FROM Network WHERE Name ='myCommunityName' ];
ConnectApi.Community  myCommunity = ConnectApi.Communities.getCommunity(myNetwork.id);
System.debug('MyDebug : ' + myCommunity.siteUrl);

test -2- the following result have extra word /login.
Network myNetwork = [SELECT Id FROM Network WHERE Name ='myCommunityName' ];
System.debug('MyDebug: ' + Network.getLoginUrl(myNetwork.id);

we are strugglisng for almost 2 days to accomplish the below request.

 

we have a video to post on our portal , so end user can see it on click.

we have been provided with a html code, which plays perfect, we are not sure how to embed this in visualforce or for that matter any where in salesforce, from where we can get an url and can be posted as a link.

 

Please help...

 

can i play some thing like below from salesforce

<html>
<body>

<video width="320" height="240" controls="controls" autoplay="autoplay">
  <source src="movie.ogg" type="video/ogg">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.webm" type="video/webm">
<object data="movie.mp4" width="320" height="240">
  <embed width="320" height="240" src="movie.swf">
</object>
</video>

</body>
</html>

 

  • October 22, 2012
  • Like
  • 0

I did a custom page where I can insert an attachment related to a custom object.
The problem is related to the delete button. I can't do it because the page goes crash with this error:
 
"apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute"
 
I think that the problem is related to reRender="form" in page. Someone have been never developed a custom delete button?
 
Thanks for any suggest or idea


[CODE]
<apex:page Controller="ControllerTEST"  showHeader="false">
    <apex:sectionHeader title="File" subtitle="User manage" help="/help/doc/user_ed.jsp?loc=help"></apex:sectionHeader>
<apex:form id="form">
    <apex:pageBlock title="Your files">
       <apex:pageBlockTable value="{!QFile}" var="att" rendered="{!NOT(ISNULL(QFile))}">
                <apex:column >
                    <a href="javascript&colon;if (window.confirm('Are you sure?')) DeleteFile('{!att.Id}');" style="font-weight:bold">Del</a>
                </apex:column>
                <apex:column headerValue="Action">
               <apex:outputLink value="{!URLFOR($Action.Filement.Download, att.Id)}" target="_blank">View</apex:outputLink>
            </apex:column>
                <apex:column title="ID" value="{!att.id}"/>
                <apex:column title="File Name" value="{!att.Name}"/>
                <apex:column title="Description" value="{!att.Description}"/>
                <apex:column title="Lenght (inbytes)" value="{!att.BodyLength}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
       <!-- <apex:actionFunction action="{!DeleteFile}" name="DeleteFile" reRender="form" > -->
        <apex:actionFunction action="{!DeleteFile}" name="DeleteFile" reRender="form">
            <apex:param name="SelectedFileId" value="" assignTo="{!SelectedFileId}"/>
        </apex:actionFunction>       
    </apex:form>
</apex:page>
[/CODE]