• SFDC coder
  • NEWBIE
  • 270 Points
  • Member since 2013
  • Capgemini

  • Chatter
    Feed
  • 1
    Best Answers
  • 10
    Likes Received
  • 1
    Likes Given
  • 85
    Questions
  • 146
    Replies

Hi every one,
I need to create an interface to integrate a serie of Account’ data and Product’s data between Salesforce CRM and one management system.
I would predict 2 bidirectional flow that allow me to align the information from one system to another. For example: I could create a new Account in my management system and replicate a sub set of its data in the Salesforce CRM and viceversa, all in real time.
I think the use of WSs are as indicated.  
Do someone developed such integration? It could give me some useful tip to approach correctly the topic?

Thanks
Daniela
I have a use case where in i need to develop a reusable lightning component but with dynamic fields to display
For eg: the lookup component should display A,B,C fields in one part and
X,Y,Z fields on another part in the same application
how can i achieve this using one component only?

Any help would be appreciated
 
Hello Experts ,

We have an mobile application that uses salesforce SDK and is connected with salesforce. In a given scenario, mobile applicaiton syncs a child and parent one after the other. This was working fine untill now. They used to sync a parent using a temporary id which they self created and using that self created id they associated the child. However this flow has stopped working now all of a sudden and it gives an error like ParentObj__c: id vlaue of incorect type. 

Can anyone please advise?

Thanks in advance
Hello Experts,

Currently i am involved in an instnace migration activity, where in we are trying to move chatter groups from one salesforce org to another. Till now i have manager to move the chatter group, its memebers, posts,comments etc but not sure about how to move the CHATTER FILES, PLUS THE POSTS MADE WITH FILES FROM ONE ORG TO ANOTHER. Can anyone please advise what needs to be done here?.

Any help is appreciated.
Thanks in advance!!.
Hi All,

This question may sound a bit stupid but i was very confused with the concept hence thought of posting here.

In an integration, how to we identify if its an http implementation or an https implementation.
As per my undertanding,
1. If the target endpoint starts with https and you are able to hit that url using required certificates from salesforce, it can be considered as an https implementation
2.At the other end, say for example i am implementing an integration between SAP and salesforce and SAP has set the transport protocol in their configuration as http with target url set to that of salesforce as "https//test.salesforce.com" and require self signed certificate from salesforce to be used while making outbound calls, in that case can this be considered as an https implementation?

Hope my understanding is correct.

Thanks in advance
Hello Experts,

We have a integration between salesforce and SAP via SAP PI. The external system is using HTTPS protocol and has asked if any other set up is required to have a secure connection while triggering outbound messages from SAP to salesforce.

This is when certificates come to my mind. We have both inbound as well as outbound integration between the systems.
I would want to know if:
1.While sending outbound messages from salesforce the certificate generated and provided by the external system has to be used in SOAP callouts. Correct?
2.When the external system sends outbound messages from SAP to salesforce, we need to generate and provide them CA signed certificate,which they will sign and send back to us. We then upload it in salesforce and the external system uses it while sending outbound messages from SAP to salesforce? Is my assumption correct?
3. Also i wish to know the difference between self signed and CA signed certificates and why should we not use self signed instead of CA signed?

Any help is appreciated

Regards,
SFDC coder
Hello All,

I need to translate the standard tabs which are Today and Feed that appear in salesforce 1.
However when i navigate to Customiz--> rename tabs and label i cant find these 2 tabs present there.

Is it even possible to translate these tabs?

Thanks in advance
hello All,

I need to display a lookup field in VF page on salesforce 1. I have used apex:inputfield tag for the same however it refers to the old salesforce styling and i am looking out for  Salesforce1 lookup design.

Can anyone please suggest?

I had a look at the link below but couldn't understand how to take it forward and implement in VF page

Any help would be appreciated
 
Hello All,

I have a custom button of type Detail Page Button 
Content Source is : URL
Code :/apex/EventOrderLink_SF1?id={!Event.Id}

The VF page EventOrderLink_SF1 is also marked as Available for Salesforce mobile apps and Lightning Pages.
Also  i have added this to the event layout section named Salesforce1 and Lightning Experience Actions.

Still when i log into the salesforce 1 i cannot see the button on the layout. Any suggestions?

Thanks in advance..
 
Hello All,

i have an approval process configured wherein i am trying to check if current users role is not equal to Manager then go to next step. However when i try to submit a record with this condition, it still goes within that step where i want it to be skipped.

Can anyone please help?

Thanks
Hello All,

My team is facing some issues while performing an upsert from the mobile app. Issue pops up when they are trying to perform an upsert and trying to update an existing record. They face an erorr as:

Cannot update XYZ field. Reason being its a master field. But while performing an upsert they pass on all the parameters and hence facing this issue
.

Any ideas on how this can be solved?

Regards,
Hi all,

I have six queries and i would want to retrieve the data by merging those queries into a single one . How can this be done?

retrieveUserProfile  -> SELECT Mobile_Configuration_Profile__r.Name, Mobile_Configuration_Profile__r.API_Access__c FROM UserToMobileLink__c WHERE User__c = 'userId’
 
retrieveCurrentUserDetails -> select  Languages__c, User_Sales_Org__c from User where Id = ‘userId’
 
retrieveLocaleObject -> Select Name, Translated_Text__c from Translations__c where Language__c = 'userLocale'
 
retrieveUserProfileSpecification -> select Id, Name, Tab__c ,Create__c, Delete__c,Update__c, SOQL_Data_Filter__c from Mobile_Configuration_Item__c where Mobile_Configuration_Profile__r.Name = 'profileName’ ORDER BY Id.
 
Hello All,

There are no classes and triggers on the production org and am moving the apex code for the first time. The deployment is constantly failing even if the code coverage is 79% in the sandbox. The reason is shown as code coverage in production is 66 %

I checked my classes and i haven't mentioned see all dtaa tru anywhere in the test class
Can anyone please help me solve this issue?
hi all,

One of my teams is using salesforce mobile sdk to retrieve data from SFDC and to show the same in the mobile app.But they get 500 records per object. Is that possible to get more data?

The mobile SDK takes care of fetching the data from salesforce to app.they  just pass table name and the query.

Any help would be appreciated

Thanks
hi all,

One of my teams is using salesforce mobile sdk to retrieve data from SFDC and to show the same in the mobile app.But they get 500 records per object. Is that possible to get more data?

The mobile SDK takes care of fetching the data from salesforce to app.they  just pass table name and the query.

Any help would be appreciated

Thanks
 
Hi all,

I have an VF email template where in i receive an attachment.
My email encoding setting and  email template properties is set to unicode utf 
I am able to get the email in correctly but in pdf's the field containing korean charactes get displayed as" () "

What can be the issue?
 
Hi All,

I have a VF page where i am trying to display formula fields as output fields.
After inputing some values that causes the formula fields to evaluate, when i click on my custom button the page reloads but the value isn't refreshed. Once i press F5 to refresh the page, only then it shows the new value. how do i solve this? below is my piece of code
 
<apex:page>
<apex:form >    
  <apex:pageBlock tabStyle="Contract_Line_Item__c">
  <apex:pageBlockButtons >  
  <apex:commandButton value="Save" action="{!save}"/>
  </apex:pageBlockButtons>
 
<apex:pageBlock title="Actuals for Year 1" id="block1" >
     <apex:pageBlockSection columns="1" collapsible="true" title="Year 1" >
     
     <apex:pageBlockTable value="{!cliLstToDisplay}" var="cliItem1" id="ptable">
       
      <apex:column headerValue="Product" >
      <apex:outputField value="{!formula field}"/>
      </apex:column>
....
....
          </apex:pageBlockTable>
     </apex:pageBlockSection>     
    </apex:pageBlock>
</apex:form>
</apex:page>

Any help is appreciated
Hello All,

I have 3 sections on my page where in on page load i want
- my first pageblock section to collapse down
-whereas 2 and  3  should not collapse until a user manually collapses it

How do i achieve this?

Any help would be appreciated
Hello All,

Am getting an error while retreiving the package from salesforce using the ANT tool as:
C:\Program Files\sample\build.xml:26: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
This is the line no.26 of my build.xml

<target name="retrieveUnpackaged">
      <mkdir dir="retrieveUnpackaged"/>
      <!-- Retrieve the contents into another directory -->
 Line26--   <sf:retrieve username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" line 26-- retrieveTarget="retrieveUnpackaged" unpackaged="C:\Program Files\sample\unpackaged\package.xml"/>
    </target>


What could be the issue?
Please help as soon as possible.
Thanks in advance
 
Hello,

I have a VF page say for eg: Page1 ,a text field T1 and a custom button btn1.
-User enters some text in T1 and navigates away by clicking on button btn1
-There after user is redirectted to Page Page2 and after he clicks on button btn2
-he again comes back to Page Page1.

Now the challenge is when he comes back to Page1, the text he entered in textfield T1 is lost. So how do i reatain this value for the end user?

I have separate controller for page2.So is that possible to retain such values even if my pages dont share the same controller?
Also i cant use passing params through url,since in my real scenario i have to deal with lists instead of a text field,

Any help would be highly appreciated
Thanks..
hi All,

i am facing some weird error with javascript custom button.I have javascript custom button that works for some record whereas for some it gives an error as "Unexpected identifier". However when i try to investigate this further, i see some issue with this particular statement highlighted below:-

if({!Account.Order_Block__c}==true || {!Account.Order_Block_on_sales_area__c}==true)
{
var x=confirm("{!Order__c.Business_Partner__c}"+' Business Partner is blocked for Order entry. Are you sure you want to continue?'); 
}

when the above statement doesnt work for some records, i have to modify it as under
var x=confirm('{!Order__c.Business_Partner__c} Business Partner is blocked for Order entry. Are you sure you want to continue?'); 
It seems to be a very lame solution to every now and then change the code with the previous version .Is there a permanent solution for this one?

Any help is appreciated
Hello Experts,

We have a integration between salesforce and SAP via SAP PI. The external system is using HTTPS protocol and has asked if any other set up is required to have a secure connection while triggering outbound messages from SAP to salesforce.

This is when certificates come to my mind. We have both inbound as well as outbound integration between the systems.
I would want to know if:
1.While sending outbound messages from salesforce the certificate generated and provided by the external system has to be used in SOAP callouts. Correct?
2.When the external system sends outbound messages from SAP to salesforce, we need to generate and provide them CA signed certificate,which they will sign and send back to us. We then upload it in salesforce and the external system uses it while sending outbound messages from SAP to salesforce? Is my assumption correct?
3. Also i wish to know the difference between self signed and CA signed certificates and why should we not use self signed instead of CA signed?

Any help is appreciated

Regards,
SFDC coder
hi all,
i need to get the ids of all the contacts associated to an event.
i.e the contacts that we add into the name field.
However,when i query the whoId field,i just get the primary contact id and not all the other assciated contact ids.

can anyone please help?
hi all,

i am trying to execute upsert call from enterprise wsdl via SOAP UI tool
below is my soap request.

Problem: i am unable to specify the object type.
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:enterprise.soap.sforce.com" 
xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
     
      <urn:SessionHeader>
         <urn:sessionId>XXXXXXXXXXXXXXX</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:upsert>
         <urn:externalIDFieldName>Product_Id__c</urn:externalIDFieldName>
         <!--Zero or more repetitions:-->
         <urn:sObjects urn:type="Product__c">
            <!--Zero or more repetitions:-->
          <Product_Id__c>456721</Product_Id__c>
          <Name>My test</Name>
          <Product_Brand__c>HIGHLAND PARK</Product_Brand__c>
         </urn:sObjects>
      </urn:upsert>
   </soapenv:Body>
</soapenv:Envelope>
When i run this request i get the below response
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>sf:INVALID_TYPE</faultcode>
         <faultstring>INVALID_TYPE: Must send a concrete entity type.</faultstring>
         <detail>
            <sf:InvalidSObjectFault xsi:type="sf:InvalidSObjectFault">
               <sf:exceptionCode>INVALID_TYPE</sf:exceptionCode>
               <sf:exceptionMessage>Must send a concrete entity type.</sf:exceptionMessage>
               <sf:row>-1</sf:row>
               <sf:column>-1</sf:column>
            </sf:InvalidSObjectFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
i then added the namespace to my request 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 and the upsert was successfull.Is this a correct way to add the namespace explicitly?
If i send such a wsdl to third party it would eventually fail 
hi all,

I would like to know the procedure of how to register for develoepr  summer maintenance exam.
i logged in to my developer account and followed the path
Register for a new exam--->developer exam--->
however i am unable to proced further as i get a pop up saying that you have already passed this exam.But i have only passed the Spring exam and i now i want to give my summer release exam


Someone please help

 
hi all,

i have a functionality wherein the pageblock table data is sorted when an appropriate column header is clicked.
Even though this functionality seems to be working fine,
it takes a lot of time to display the result on the VF page

Can anyone help me to make the records display faster on VF page?

below is my method i.e invoked whenever a column header is clicked

public PageReference doSorting()
    {
        wrapperLst.clear();
        sortOrder= sortOrder.equals('asc') ? 'desc' : 'asc';
        System.debug('***** sort order is'+sortOrder);
        List<Product__c> prodlst=runQuery();
        if(prodlst.isEmpty()==false)
        {
            for(Product__c pnew2: prodlst)
            {
                        OrderWrapper ow2=new OrderWrapper();
                        ow2.prodItem=pnew2;
                        ow2.oliItem=new Order_Line_Item__c();
                        ow2.isChecked=false;
                        wrapperLst.add(ow2);
           }
        }
        return null;
    }
    
    public  List<Product__c> runQuery()
    {
         sortedProds.clear();
         sortedProds=Database.Query('select id,name,Product_Brand__c,Product_Category__c from         Product__c Order by '+sortParam+' '+sortOrder);
         return sortedProds;
    }




Hi all,

i am trying to align my command button in center but its not working i have used all the css properties like align and float in my output panel but still its not working

<apex:page controller="VistAudit_VFC" action="{!createData}">
 <apex:form >
  <apex:outputLabel value="Audit Visit" style="font-family:Times New Roman;font-size:15px">
 </apex:outputLabel><br></br>
 
<apex:outputPanel style="float:centre">
 <apex:commandButton value="Save" action="{!save}"/>
 </apex:outputPanel>

</apex:page>

any help would be appreciated

thanks
Hi all,

While exploring the salesforce features i came across supoort process
  1. Support processes are used to add or remove the status values of cases
  2. After a support process has been created its assigned to a record type
Now my confusion  is ,why  are we  using support processes to add/remove the picklist values? as It can also be achieved when creating record types.
Record types allow us to customize the picklist values then why wud we use this solution process feature?

hi all,

I am unable to understand the behaviour of the feature login hour restrictions.
If a users profile can login from 4pm to 5pm and a user logs in at 4.30 pm then what happens at 5.01pm?

Some have said that it automatically logs out,
some assume that the session goes on but he can only view.Once he tries for any DML operation,hez logged out

Can anyone help me out on this?

Thanks
Hi Everyone,

I'm passing a salesforce record that includes date fields to a Lightning compnent's helper class.  The page renders a Lightning datatable and displays the results as expected.  However, the page loads and runs very slow.  Looking at the console logs i can see a huge count of warnings, which i believe is the culprit.  The message that pops up for these logs is as follows:

"<lightning-formatted-date-time> The value attribute accepts either a Date object, a timestamp, or a valid ISO8601 formatted string with timezone offset. but we are getting the object value "Invalid Date" instead."

The Helper class defines the columns and teh formatting as:
{label: 'Ordered Date',     fieldName: 'Ordered_Date__c',           type: 'date', typeAttributes:{year: 'numeric', month:'numeric',day:'numeric'} }
The component utilises the datatable and renders the data correctly but very slow.  Here is the use of the datatable:
<lightning:datatable aura:id="datatable" data="{! v.data }" columns="{! v.columns }" >
The v.data receives the List<Object> from apex and the v.columns is defined in the helper.js class.

I'm guessing it's some issue with how JS and Apex communicate dates but i'm very new to JS so cannot figure out what the issue could be.  Very sorry if teh question is not detailed abundantly.  If someone can give some guidance it would be great, as i really want to rid this error.  It takes too long to load the page with anything more than a a hundred records.

Thanks
Aamir
  • April 02, 2021
  • Like
  • 0
I have a use case where in i need to develop a reusable lightning component but with dynamic fields to display
For eg: the lookup component should display A,B,C fields in one part and
X,Y,Z fields on another part in the same application
how can i achieve this using one component only?

Any help would be appreciated
 
We are currently trying to consume a soap web service exposed on a CastIron.
This WebService has a security certificate which does not allow us to communicate.
The certificate is signed by Symantec.
When there is no certificate active for the endpoint we consume, it works with no problem.

But when the certificate is active, while there is no problem calling the service from SOAPUI, when calling from SF we are receiving the following error message:
11:24:30.0 (325656624)|EXCEPTION_THROWN|[23]|System.CalloutException: IO Exception: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 11:24:30.0 (537301785)|FATAL_ERROR|System.CalloutException: IO Exception: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

We are wondering if there is any extra configuration required we are missing. So far we have:
1. Add the remote site configuration where the endpoint is.
2. We use the correct endpoint URL, pointing to the https and 443 port.

We have done nothing about the certificate on SF side.
We do not understand if there is any configuation required concerning the intermediate certificate.
It is not clear to us if there is any further configuration required.

Please let me know what is missing or any documentation which explains very well what is required.
This is the documentation we have been using so far:
https://krishhari.wordpress.com/2012/02/06/making-authenticated-web-service-callouts-from-salesforce-to-ibm-cast-iron-using-sslcertificatespart-ii/
https://krishhari.wordpress.com/2012/02/06/making-authenticated-web-service-callouts-from-salesforce-to-ibm-cast-iron-using-sslcertificatespart-ii/

 
Dear all, Need your help urgently on below issue.
I have an object " Quotation" and we need to send quotation emaail template to Thai and English customers. The need is the picklist values like gender, marital status etc should be in Thai when the email goes to thai customer. It can be detected by the field " Preferred language" with values as " TH" or " EN". From " Translation Workbench" i can change the english picklist values to Thai.
But now the issue is , the users should always see the values in english while inputting. and in our database ( report etc), its always show english, as we need a consistent value ( e.g Male only not the Thai version of Male) its only when the quotation template goes to the customer it will change either to Thai or EN as per their preferred language. So, the Thai version picklist need to get stored somwhere in teh bckend.
If anybody can suggest how can i achieve this ? Thanks
Hi all,
I know we can access Custom Labels in Apex and VF.
But, Can we Update the value of a Custom Label through Apex Controller?


If So, How?

With Thanks.
Hi all,

I have requirement where I have to open a contact record after invoking the rest api but before returning the response.

My rest api class is:-
@RestResource(urlMapping='/Account/*')
global with sharing class RESTAgentController {

 @HttpPost
    global static String doPost(String customerId,String cus_context,String ContactNo) 
    {
        String customer_Id= customerId;
        String context= cus_context;
        String cus_ContactNo= ContactNo;       
        String agent_num='434343434';
        return agent_num;
    }    
}

The vf and the controller for opening the contact record are:-

Visualforce Page:-
<apex:page Controller="autoContactController" action="{!redirect}" > </apex:page>

Apex controller:-

public with sharing class autoContactController{
    
    public PageReference redirect() { 
        String phone = ApexPages.currentPage().getParameters().get('phone');
        String contactId = '0032800000ZW42T';
        PageReference pr = new PageReference('https://ap2.salesforce.com/console#%2F'+contactId);
        return pr; 
    }
}

Can anyone please help??????
Hello Experts ,

We have an mobile application that uses salesforce SDK and is connected with salesforce. In a given scenario, mobile applicaiton syncs a child and parent one after the other. This was working fine untill now. They used to sync a parent using a temporary id which they self created and using that self created id they associated the child. However this flow has stopped working now all of a sudden and it gives an error like ParentObj__c: id vlaue of incorect type. 

Can anyone please advise?

Thanks in advance

Hi every one,
I need to create an interface to integrate a serie of Account’ data and Product’s data between Salesforce CRM and one management system.
I would predict 2 bidirectional flow that allow me to align the information from one system to another. For example: I could create a new Account in my management system and replicate a sub set of its data in the Salesforce CRM and viceversa, all in real time.
I think the use of WSs are as indicated.  
Do someone developed such integration? It could give me some useful tip to approach correctly the topic?

Thanks
Daniela
Hello Experts,

We have a integration between salesforce and SAP via SAP PI. The external system is using HTTPS protocol and has asked if any other set up is required to have a secure connection while triggering outbound messages from SAP to salesforce.

This is when certificates come to my mind. We have both inbound as well as outbound integration between the systems.
I would want to know if:
1.While sending outbound messages from salesforce the certificate generated and provided by the external system has to be used in SOAP callouts. Correct?
2.When the external system sends outbound messages from SAP to salesforce, we need to generate and provide them CA signed certificate,which they will sign and send back to us. We then upload it in salesforce and the external system uses it while sending outbound messages from SAP to salesforce? Is my assumption correct?
3. Also i wish to know the difference between self signed and CA signed certificates and why should we not use self signed instead of CA signed?

Any help is appreciated

Regards,
SFDC coder
hello All,

I need to display a lookup field in VF page on salesforce 1. I have used apex:inputfield tag for the same however it refers to the old salesforce styling and i am looking out for  Salesforce1 lookup design.

Can anyone please suggest?

I had a look at the link below but couldn't understand how to take it forward and implement in VF page

Any help would be appreciated
 
Hello All,

I have a custom button of type Detail Page Button 
Content Source is : URL
Code :/apex/EventOrderLink_SF1?id={!Event.Id}

The VF page EventOrderLink_SF1 is also marked as Available for Salesforce mobile apps and Lightning Pages.
Also  i have added this to the event layout section named Salesforce1 and Lightning Experience Actions.

Still when i log into the salesforce 1 i cannot see the button on the layout. Any suggestions?

Thanks in advance..
 
Hi all,

I have six queries and i would want to retrieve the data by merging those queries into a single one . How can this be done?

retrieveUserProfile  -> SELECT Mobile_Configuration_Profile__r.Name, Mobile_Configuration_Profile__r.API_Access__c FROM UserToMobileLink__c WHERE User__c = 'userId’
 
retrieveCurrentUserDetails -> select  Languages__c, User_Sales_Org__c from User where Id = ‘userId’
 
retrieveLocaleObject -> Select Name, Translated_Text__c from Translations__c where Language__c = 'userLocale'
 
retrieveUserProfileSpecification -> select Id, Name, Tab__c ,Create__c, Delete__c,Update__c, SOQL_Data_Filter__c from Mobile_Configuration_Item__c where Mobile_Configuration_Profile__r.Name = 'profileName’ ORDER BY Id.
 
Hello All,

There are no classes and triggers on the production org and am moving the apex code for the first time. The deployment is constantly failing even if the code coverage is 79% in the sandbox. The reason is shown as code coverage in production is 66 %

I checked my classes and i haven't mentioned see all dtaa tru anywhere in the test class
Can anyone please help me solve this issue?
hi all,

While my SAP colleage was trying to do a SOAP call from XI Server,an error pops up as below:

'com.sap.aii.af.ra.ms.api.RecoverableException: unable to create a socket: java.io.IOException: unable to create a socket'. Cause Exception: 'unable to create a socket

can anyone please help me out on this?
is there a need to open up any firewall?if yes then how?

Please assist ASAP
 

Posting this in order to help others who, months from now, might Google "OP_WITH_INVALID_USER_TYPE_EXCEPTION" and find this explanation.

 

We wrote an Apex trigger on the User object, to insert a custom object record anytime a user updates their Chatter status.  This was done to fulfill a client's requirement to audit all Chatter activity.

 

The trigger worked fine, until one day the client signed up some Chatter Free users.  When such a user tried to update their status, they got a pop-up with an OP_WITH_INVALID_USER_TYPE_EXCEPTION error.

 

We scratched our collective heads for awhile.  After all, Apex triggers run in "system mode," right?  That is supposed to mean that "object and field-level permissions of the current user are ignored."  And yet this trigger seemed like it was running in "user mode," enforcing restrictions based on who the current user was.

 

The root cause turned out to be that a Chatter Free user cannot be the owner of a custom object record, and SFDC by default sets the current user as a new record's first owner.  We discovered this when we realized, via experiment, that Apex triggers fired as the result of actions by Chatter Free users could definitely update an existing record, but were having problems creating records.

 

So the simple solution was to explicitly set the owner of the new record to some fully-licensed user prior to inserting it.