• chioikbh
  • NEWBIE
  • 0 Points
  • Member since 2013

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

I have query a query on User object

 

List us = [Select AvatarId__c, CommunityNickname from User where Id = :id];

 

I am 100% sure it should return a record and it did when I run as my 'System administrator' profile. But if I run this line as portal profile, then it can't find the matched User who has another non-portal profile at all. So I get us.size() is 0.

 

Does anyone here can point what's the problem? For me, it looks like the portal profile doesn't have permission on users with other profile, but how can I solve this?

 

Thank you very much for the kind help.

 

Regards

Wen

Hi, I have an outputlink, and I would like to implement the function that everytime when the link is clicked, then it always opens the redirect visualforce page in the same window or tab. The problem is that the redirect link is not static one like google.dk, it should has paramete cus which defines a specific customer.

 

I have tried to use window.open(url, target) like the following, but it doesn't work.

<apex:outputLink onlick="window.open('/apex/XX?

&cus={!account.Customer_No__c}', 'sametab')" target="sametab" styleClass="viewLink">click me< /apex:outputLink>

 

I hope you can help me. Thanks in advance.

Hi,

 

I have a complex commandButton for voting idea. The function is everytime I click it, it votes for an idea in the controller, and in the front end I would like to popup a windows showing it is successful vote or any error. If it is success, then I hope the idea's likes point is refreshed partially and get increased.

 

The pop up windows is get rerendered and works well, but not the singleIdeaPanel which I would like to rerender, so the likes number is get increased.

 

Thanks in advance for the kind help

 

My code:

<apex:form >

    <apex:outputPanel id="jspanelLV">

      <script> 

          function onControllerReturn() {

            alert('{!listViewMessage}')

          }

      </script>  

  </apex:outputPanel>

 

 

<apex:outputPanellayout="block"class="list_item"id="singleIdeaPanel">

<

apex:commandButtononclick="voteJS('{!JSENCODE(visualData.recordId.value)}');" reRender="jspanelLV, singleIdeaPanel"styleClass="{!IF(visualData.canVote,'icon icon_like small','icon icon_like small is-liked')}"rendered="{!$ObjectType.Idea.createable}"/>

{!visualData.likes.value}

</apex:outputPanel>

 

<

apex:actionstatusid="voteStatusLV"onstop="onControllerReturn();">

  

</apex:actionstatus>

 

<apex:actionFunctionaction="{!vote}"name="voteJS"reRender="singleIdeaPanel, jspanelLV"status="voteStatusLV">

          

<apex:paramname="IdeaId"assignTo="{!voteIdeaId}"value=""/>              

      

</apex:actionFunction>

I have query a query on User object

 

List us = [Select AvatarId__c, CommunityNickname from User where Id = :id];

 

I am 100% sure it should return a record and it did when I run as my 'System administrator' profile. But if I run this line as portal profile, then it can't find the matched User who has another non-portal profile at all. So I get us.size() is 0.

 

Does anyone here can point what's the problem? For me, it looks like the portal profile doesn't have permission on users with other profile, but how can I solve this?

 

Thank you very much for the kind help.

 

Regards

Wen

 

String AppNumber = lastApp.Name
Map<String, String> value = new Map<String, String>();
  value.put('{#AppNumber}', AppNumber);

 Agreement template = new Agreementtemplate();
                template.init(lastProg.Thank_You_Page__c, lastProg.Id, 'Prog__c', value);

 

 

 

Hi,

 

I created the workflow rule when the new case comment is inserted.

 

The following is the rule criteria.

"Case Comment: PublishedEQUALSTrue"

 

and the workflow action is to send the email notification.

 

But when the new case comment is inserted, It does not send email

 

Can anyone help to solve this problem?

 

Thanks and Regards.,

Ambiga

 

Hi, I have an outputlink, and I would like to implement the function that everytime when the link is clicked, then it always opens the redirect visualforce page in the same window or tab. The problem is that the redirect link is not static one like google.dk, it should has paramete cus which defines a specific customer.

 

I have tried to use window.open(url, target) like the following, but it doesn't work.

<apex:outputLink onlick="window.open('/apex/XX?

&cus={!account.Customer_No__c}', 'sametab')" target="sametab" styleClass="viewLink">click me< /apex:outputLink>

 

I hope you can help me. Thanks in advance.

Hi,

 

I have a complex commandButton for voting idea. The function is everytime I click it, it votes for an idea in the controller, and in the front end I would like to popup a windows showing it is successful vote or any error. If it is success, then I hope the idea's likes point is refreshed partially and get increased.

 

The pop up windows is get rerendered and works well, but not the singleIdeaPanel which I would like to rerender, so the likes number is get increased.

 

Thanks in advance for the kind help

 

My code:

<apex:form >

    <apex:outputPanel id="jspanelLV">

      <script> 

          function onControllerReturn() {

            alert('{!listViewMessage}')

          }

      </script>  

  </apex:outputPanel>

 

 

<apex:outputPanellayout="block"class="list_item"id="singleIdeaPanel">

<

apex:commandButtononclick="voteJS('{!JSENCODE(visualData.recordId.value)}');" reRender="jspanelLV, singleIdeaPanel"styleClass="{!IF(visualData.canVote,'icon icon_like small','icon icon_like small is-liked')}"rendered="{!$ObjectType.Idea.createable}"/>

{!visualData.likes.value}

</apex:outputPanel>

 

<

apex:actionstatusid="voteStatusLV"onstop="onControllerReturn();">

  

</apex:actionstatus>

 

<apex:actionFunctionaction="{!vote}"name="voteJS"reRender="singleIdeaPanel, jspanelLV"status="voteStatusLV">

          

<apex:paramname="IdeaId"assignTo="{!voteIdeaId}"value=""/>              

      

</apex:actionFunction>

        I designed a visual force page to display list of opportunity attachments. It's displaying opporunities with remove link also. Written onclick event of remove link. Onclick of the link, javascript function is calling and displaying alert of attachment id. Used <apex:actionFunction> for this and defined oncomplete attribute also, in that  alert is given. This alert also displaying onclick of remove link but deleteAttachment() apex method is not calling(It contains logic to delete attachment). Please guide me if any thing wrong in code.

 

Visual force page:

 

<apex:page controller="SendController">

 

<script>
function deleteAttach(attachmentId) {
alert('Entered Javascript With Id' + attachmentId) ;
deleteAttachment(attachmentId);
}
</script>


<apex:form enctype="multipart/form-data" id="frm">
<apex:actionFunction name="deleteAttachment" action="{!deleteAttachment}" oncomplete="alert('ok');">
<apex:param name="attachmentId" assignTo="{!attachmentId}" value=""/>
</apex:actionFunction>

-------------

 

<apex:repeat value="{!attResults}" var="attResult">
<apex:outputLink value="{!URLFOR($Action.Attachment.Download, attResult.id)}" target="_blank">
{!attResult.name}
</apex:outputLink>
&nbsp;&nbsp;&nbsp;
<apex:outputLink onclick="deleteAttach('{!attResult.id}');" >
Remove
</apex:outputLink>
<br/>
</apex:repeat>

-----

 

</apex:form>

</apex:page>

 

 

Apex class:

 

public class SendController {  

 

public List<Attachment> attResults {get; set;}

 

public SendController() {
System.debug('Inside SendWithSutiSign constructor');

attResults = [select Id, Name from Attachment Where ParentId = :id];         

}

 

public String attachmentId {get; set;}
public void deleteAttachment() {
System.debug('Inside deleteAttachment method');
try {
System.debug('Attachment Id1=>' + attachmentId);
System.debug('Attachment Id1=>' + Apexpages.currentPage().getParameters().get('firstParam'));
Attachment attc = [select Id, Name from Attachment Where Id = :attachmentId];
delete attc;
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Attachment deleted successfully'));

//Get attachment list of opportunity
attResults = [select Id, Name from Attachment Where ParentId = :id];
} catch (DMLException e) {
System.debug('Exception in deleteAttachment method');
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error deleteing attachment'));
}
}

}

 

 

Thanks in advance.

  • May 22, 2013
  • Like
  • 0

hi,

i have a question can anyone please help.

how to convert instance of string to instance of schema.sobjectfield in salesforce.

Is there any method for it?

Please give a small example of the method.

 

Thanks