• Christoph Eschweiler
  • NEWBIE
  • 30 Points
  • Member since 2014
  • Apracor GmbH


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 8
    Replies
Email-to-case is used to create a case  from the email received and

Apex email service also creates a record in slaesforce through an email

then whats the difference between the two?

Hello,

starting Summer 19 we recognized a change in APEX behaviour:

for a custom sObjectField, the getDescribe().getName() Method returns an exception for a user who does not have permission to view a related object.

We have a custom object Payment__c that is linked via lookup to a custom object "Invoice__c". The lookup field on Payment__c cannot be described by a user anymore that does not have the permission to access the Invoice__c object.

So, if I execute this as a user without access to the target object:

Payment__c.Invoice__c.getDescribe().getName()

I get an exception. We're on API 44 with all our code.

Can anybody confirm this? This seems to be a bug since no change in behaviour is documented anywhere (and should not be applied to older versions).

FYI: The same code still works as expected in orgs that are not yet on Summer 19.

Hello,
when a single record type is created for a custom object and NOT assigned to the user's profile but via a permission set that is assigned to the user, in a controller extension the record type is not being set on the object.
If the record type is assigned via profile however, the ID is properly set on the object.
According to Salesforce documentation, the latter should also be the case for assignments via permission sets.

What I'm doing:
- Create a custom object (e.g. RT_Test)
- Create a single record type for that object but don't assign it to any profile
- Create a custom tab for the object (e.g. RT Tests)
- Create a permission set that grants users access to the newly created object and record type
- Assign the permission set to a user

- Create the following Apex class:
global with sharing class DemoRTController
{
global string rtId { get; set; }

global DemoRTController(ApexPages.StandardController stdController)
{
sObject obj = stdController.getRecord();
System.debug('Object: ' + obj );
this.rtId = String.ValueOf(obj.get('RecordTypeId'));
System.debug('Object record type: ' + this.rtId);
}
}

- Create the following Visualforce page (be sure to rename RT_Test__c to your object's name):
<apex:page standardController="RT_Test__c" extensions="DemoRTController">
<apex:form >
<apex:outputText >Record Type Name: {!RT_Test__c.RecordType.Name}</apex:outputText><br />
<apex:outputText >Record Type Id: {!rtId}</apex:outputText><br />
<apex:inputField value="{!RT_Test__c.Name}"/><br />
<apex:commandButton action="{!save}" value="save" />
</apex:form>
</apex:page>

- Finaly, override the New/View/Edit pages of the custom object with that Visualforce page.

Now, to actually see the issue:
- Click tab "RT Tests", click "New", enter any string, click "Save".
- Note that record type id and record type name stay empty (record type assignment via permission set)
- Now, assign the record type to the profile directly (your profile, record type settings for object "RT Tests".
Assign "Record Type 1" to the selected record types)
- Click "Save"
- Click tab "RT Tests" again, click "New", enter any string, click "Save".
- Note that record type id and record type name are now properly set (record type assignment via profile

So my question is: Am I doing something wrong or is there an issue with Salesforce?
You got any ideas?

Hello,

starting Summer 19 we recognized a change in APEX behaviour:

for a custom sObjectField, the getDescribe().getName() Method returns an exception for a user who does not have permission to view a related object.

We have a custom object Payment__c that is linked via lookup to a custom object "Invoice__c". The lookup field on Payment__c cannot be described by a user anymore that does not have the permission to access the Invoice__c object.

So, if I execute this as a user without access to the target object:

Payment__c.Invoice__c.getDescribe().getName()

I get an exception. We're on API 44 with all our code.

Can anybody confirm this? This seems to be a bug since no change in behaviour is documented anywhere (and should not be applied to older versions).

FYI: The same code still works as expected in orgs that are not yet on Summer 19.

Hi Friends,

contact.LastName = nameParts.size() > 1 ? nameParts[nameParts.size()-1] : nameParts[0];

in the above statement, the "?" what it will check and  what it means "nameParts[nameParts.size()-1] : nameParts[0]"

it isconfusing littlebit. please any one explain abt the line.

thanks,
Krish
I want to change the display name in page layouts... Suppose the custom field name is a code (For easy mapping while importing data) and display name is in decoded form.... Can i do this??
Email-to-case is used to create a case  from the email received and

Apex email service also creates a record in slaesforce through an email

then whats the difference between the two?
Hi,

I have list<string> s1 = (abc, xyz, pqr, klm);

How to put double quotes for individual element of list.

for eg.
list<string> s2 = ("abc", "xyz", "pqr", "klm");
In my VF page i have a function that allows the user to select the lookup field that he wants and fill an input field (this action works like a charm); after that i have a command link that updates the record but im unable to get the value from the input field, the value is always null. How can i achieve this ? I have been stuck for 3 days now, i would appreciate any help. Thanks in advance.

VisualForce:
<apex:pageBlockTable id="srch_id" value="{!Piezas}" var="o">
            
            <apex:column value="{!o.Name}"> <apex:facet name="header"> </apex:facet> </apex:column>          
            <apex:column value="{!o.Producto__r.Name}"> <apex:facet name="header"> </apex:facet> </apex:column>
            <apex:column value="{!o.Bodega__c}"> <apex:facet name="header"> </apex:facet> </apex:column>
            <apex:column value="{!o.Estado__c}"> <apex:facet name="header"></apex:facet> </apex:column>
            <apex:column value="{!o.Reparaci_n_ETL__c}"> <apex:facet name="header"> </apex:facet> </apex:column>
            <apex:column headerValue="Opciones" >
          
                   ---------------------------------------------------This is the value im trying to get--------------------------------------------------
           
                  <apex:inputField id="Reparacion" value="{!PI.Reparaci_n_ETL__c}" />

           -------------------------------------------------------------------------------------------------------------------------------------------------------------
 
                    <apex:commandLink value="Agregar a Reparacion" action="{!actualizaPieza}">
                            <apex:actionSupport event="onclic"/>    
                            <apex:param name="namePieza"   assignTo="{!piezaActual}" value="{!o.Name}"  />
                            <apex:param name="rep" assignTo="{!idRep}" value="{!PI.Reparaci_n_ETL__c}"  />
                   </apex:commandLink>
                  
            </apex:column>
           
        </apex:pageBlockTable>


Controller:

public class addPiezaController {

public String order {get; set;}
public List<Pieza__c> Piezas = new List<Pieza__c>();
public String piezaActual {get; set;}
public String idRep {get; set;}

private Pieza__c PI = new Pieza__c();

public void setPI(Pieza__c value) {
    PI = value;
}

public Pieza__c getPI() {
    return PI;
}



public PageReference lol(){
System.debug(LoggingLevel.Error, 'Reparacion ID:' + PI.Reparaci_n_ETL__c);
return null;
}



public addPiezaController (){
order = '';
Piezas = null;
piezaActual = '';
}

public List<Pieza__c> getPiezas(){

Piezas = [select Name, Producto__r.Name, Bodega__c, Estado__c, Reparaci_n_ETL__c from Pieza__c where Orden__r.Name =: order ];

return Piezas;
}

public void actualizaPieza(){

//Id repID = ApexPages.currentPage().getParameters().get('idRep');
System.debug(LoggingLevel.Error, 'Reparacion lololo param:' + idRep );
System.debug(LoggingLevel.Error, 'Reparacion ID:' + PI.Reparaci_n_ETL__c);
System.debug(LoggingLevel.Error, 'Name:' + piezaActual);


Pieza__c P = [select name, Reparaci_n_ETL__c, Estado__c  from Pieza__c where name =: piezaActual];
P.Reparaci_n_ETL__c = PI.Reparaci_n_ETL__c;
P.Estado__c = 'Utilizada en reparación';

Update(P);

getPiezas();
}

}