• KoenVM
  • NEWBIE
  • 30 Points
  • Member since 2008
  • Solution Architect
  • ABSI


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 11
    Replies
As described here: https://releasenotes.docs.salesforce.com/en-us/summer15/release-notes/rn_service_emails_case_feed.htm ,
it should be possible to control the value of the "IsExternallyVisible" flag through a trigger.

We have our own logic which works well and were executing this code in the "before insert" of an EmailMessage record.
We recently noticed that even while our code sets the value in the before insert, Salesforce overrides this value later. (between the before insert and after insert)...

To fix this, I moved the code to update this field to the "after insert" logic.
But doing so, we now get an error when trying to update the EmailMessage records "Invalid operation".
I don't re-use the records comming from the Trigger.isNew cause that would cause "read only" exceptions.
What I do is like this:
EmailMessage emailToUpdate = new EmailMessage();
emailToUpdate.Id = mId;
emailToUpdate.IsExternallyVisible = value;
emailsToUpdate.add(emailToUpdate);
So I'm sure I'm only updating the IsExternallyVisible flag and not any other field that I wouldn't be allowed to...
I used this code already in execute anonymous mode to fix some emails incorrectly flagged as externally visible and this works from there.

What am I missing? Why doesn't there seem to be a proper way to control the IsExternallyVisible flag through code / trigger?...
  • November 23, 2015
  • Like
  • 0

Hi,


I have the requirement to hide users for a certain profile or role.

The users should only be able to see and edit customer portal users but not other salesforce users.

 

It does not seem to be possible at first sight.

 

Does anybody have ideas on this?

 

Best regards,

 

Koen V

  • October 06, 2011
  • Like
  • 0

Hi,

 

For a trigger, we need to check if the user running the code is the system administrator.

 

Now, we do the following:

 

Profile prof = [select Name from Profile where Id = :UserInfo.getProfileId() ];
    
    // If current user is not a System Administrator, do not allow something
    if (!'System Administrator'.equalsIgnoreCase(prof.Name)) {
        // you are not authorized
    }

 

The problem with this code is that if you have a non-english org or your user has his language set to non-english that this check will not work. (for example a French or Dutch org)

 

Is there another way to check if a profile is of type system administrator?

 

Thanks in advance for your responses.

 

Koen

Hi,

 

I found a problem today when you want to do a find from the officetoolkit.

If one of the fields from the "returning" part is a reference field, you will get an error saying invalid field.

If you run the same query from the apex explorer for example, the query works. (same query, same environment)

I now had to create some formula fields to return these fields from the references but that can't be the way it should be done.

 

Anyone know what might be causing this and how I can fix this?

 

Thanks in advance. 

 

 

  • January 22, 2009
  • Like
  • 0
Hi all,

I have a question:
For a client of us, we connect from salesforce to some webservices written on top of an SAP.
For security of this services we used a temporary generated certificate to secure this webservices and then passed these certificate credentials from salesforce to the services.
When moving to production now, we will no longer be able to use the temp certificate.
Is there a way to use some certificate from salesforce to securily call those webservices?
My guess is that this is not possible but the IT of our client is saying that this could work?

Anyone know if this is possible?

Thanks in advance!

grtz

koen
  • November 17, 2008
  • Like
  • 0
Hi All,

I have created two object one is Prospect__c and Second is Lead_status__c
Also I have created a Visual force Page for Prospect__c.

Lead Staus is the child object for Prospect__c.

I want to show Lead_status__c as a related detials under Prospect__c visualforce page.

Below is the code I have wrtten .
But it is giving error"'Lead_status__c' is not a valid child relationship name for entity Prospect "

<apex:page standardController="Prospect__c"  cache="true" extensions="Convert" >

<br/><br/>
<apex:messages style="color:red; font-weight:bold; text-align:center;"/>

<apex:relatedList list="Lead_status__c" />

<apex:form >
<apex:pageBlock title="Prospects information"  >

<apex:pageBlockButtons >
<apex:commandButton value="Delete" action="{!delete}"/>
<apex:commandButton value="Edit" action="{!edit}"/>
<apex:commandButton value="Convert" action="{!convertbutton}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Prospects Details" columns="2">
<apex:outputField value="{!Prospect__c.Salutation__c}"/>
<apex:outputField value="{!Prospect__c.First_Name__c}"/>
<apex:outputField value="{!Prospect__c.Name}"/>
<apex:outputField value="{!Prospect__c.Ownerid}"/>
<apex:outputField value="{!Prospect__c.Title__c}"/>
<apex:outputField value="{!Prospect__c.Website__c}"/>
<apex:outputField value="{!Prospect__c.Company__c}"/>
<apex:outputField value="{!Prospect__c.Rating__c}"/>
</apex:pageBlockSection>

<apex:pageBlockSection title="Address and Contact Information">
<apex:outputField value="{!Prospect__c.Street__c}"/>
<apex:outputField value="{!Prospect__c.Email__c}"/>
<apex:outputField value="{!Prospect__c.City__c}"/>
<apex:outputField value="{!Prospect__c.Phone__c}"/>
<apex:outputField value="{!Prospect__c.State__c}"/>
<apex:outputField value="{!Prospect__c.Mobile__c}"/>
<apex:outputField value="{!Prospect__c.Pin__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Lead Source Information" columns="2">
<apex:outputField value="{!Prospect__c.Lead_Source__c}"/>
<apex:outputField value="{!Prospect__c.Promotion__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Lead Processing Information" columns="2">
<apex:outputField value="{!Prospect__c.Lead_Status__c}"/>
<apex:outputField value="{!Prospect__c.Do_Not_Call__c}"/>
<apex:outputField value="{!Prospect__c.Industry__c}"/>
<apex:outputField value="{!Prospect__c.Email_Opt_Out__c}"/>
<apex:outputField value="{!Prospect__c.No_of_Employees__c}"/>
<apex:outputField value="{!Prospect__c.Annual_Revenue__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Description" columns="2">
<apex:outputField value="{!Prospect__c.Description__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:commandLink value="Redirect to Site" style="color:blue; font-weight:bold;" action="{!RedirecttoSite}"/>
</apex:form>
</apex:page>
Hi,

I am having a following scenario for which i need help on it,


I am having a visualforce workflow , where i have certain questions to be filled by the user ( like a survey) after entering all the questions when user clicks on next the thank you screen appears

my requirement is i want to populate all the questions entered in the previous page in the last  final page as a read only mode.


can i achieve it by flow itself ( if yes how can i do it)

Kindly help me on this regard

Thanks in Advance

I have an action created on a custom object that contains a picklist field.  The picklist values I have configured for the field ("Yes" and "No") do not appear in the Chatter Mobile app.  I have other identically configured picklist fields in the action that do behave normally.  Also, in SFDC the field behaves normally when logged in as the exact same user.

  • September 16, 2013
  • Like
  • 0

Need to add filter on Contact Name Lookup field on Quote to display only those Contacts linked to the Account. At present, Contact lookup on Quote shows all the Contacts. I tried to add Lookup Filter on Contact Name field but not able to add desired filter. Please suggest.

Dear all,

 

I am trying to filter Contact lookup field on Quotes and I would like to have Contact.AccountId = Quote.AccountId

Unfortunately list of fields for Quote does not present me AccountId, although Account is a standar lookup field of Quote (to Account of course)

 

Case object has the same structure (Contact and Account lookup fields) and on Case it is possible.

 

What is the difference? Can someone explain me why I cannot use Account ID on Quotes?

 

Thanks in advance.

 

Regards

 

Hi,

 

For a trigger, we need to check if the user running the code is the system administrator.

 

Now, we do the following:

 

Profile prof = [select Name from Profile where Id = :UserInfo.getProfileId() ];
    
    // If current user is not a System Administrator, do not allow something
    if (!'System Administrator'.equalsIgnoreCase(prof.Name)) {
        // you are not authorized
    }

 

The problem with this code is that if you have a non-english org or your user has his language set to non-english that this check will not work. (for example a French or Dutch org)

 

Is there another way to check if a profile is of type system administrator?

 

Thanks in advance for your responses.

 

Koen

Hi,

 

I found a problem today when you want to do a find from the officetoolkit.

If one of the fields from the "returning" part is a reference field, you will get an error saying invalid field.

If you run the same query from the apex explorer for example, the query works. (same query, same environment)

I now had to create some formula fields to return these fields from the references but that can't be the way it should be done.

 

Anyone know what might be causing this and how I can fix this?

 

Thanks in advance. 

 

 

  • January 22, 2009
  • Like
  • 0
I'd like to re-open the discussion of SortOrder on the OpportunityLineItem object. A thread from 3.5 years ago can be located here:
http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=3154

Looks like people from SF were going to look into it but obviously nothing has come to fruition. The reason I have put this in the Visualforce board is that we have have a few VF applications that could really take advantage of access to this field. Visualforce has also opened up new possibilities to UI design where the ability to manage SortOrder could be useful.

Also, no offense to salesforce.com, but the tool for sorting OpportunityLineItems is not that useful when there are multiple products with the same name. I have actually built a pretty slick sorting application but this is currently useless.

A lot of the concerns were about error handling. What happens if you have 3 line items but sort order is defined as, 1, 2, 2. Or 1, 2, 4. How about just throwing a sortOrder exception and force the developers to write good code?

Ideas? Thoughts?
http://ideas.salesforce.com/article/show/10092062/OpportunityLineItem_SortOrder_to_be_CreatableUpdatable

-Jason


Message Edited by TehNrd on 09-05-2008 01:22 PM
  • September 03, 2008
  • Like
  • 1