• Mikal Hanson
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

So, I know that this is a subject that's been beaten to death on these forums by now, but everything that I've read (and I've read EVERYTHING here) doesn't seem to be solving my issue.

In our dev org, portal users keep hitting the insufficient access on cross reference id error, which also prevented us from properly testing our portal users in context. Now, before you ask, we're basing our security access on another org that is the foundation of ours.

The cross reference id issue points to the Account object through a Related Account field, but the portal user has ALL necessary object and field access to match that of the org we're following, and the sharing settings match as well (Account set to Private).

The problem is, when trying to view the first page where Account is needed, the portal user gets bumped to an error page and hit with an insufficient privilege issue, and now I'm stuck wondering what else I missed.

-the portal user profile is an exact match
-the sharing settings are a match (no sharing rules at all)
-our role hierarchy is an exact match
-our record types and record type access are an exact match

After all this, I'm honestly wondering what I could be missing. If anyone has further ideas, I'd really appreciate it, as we've been stuck with this issue for weeks, and the only work-around so far was to temprorarily set Accounts to "Public Read/Write", which of course fixed the issue, but we absolutely cannot have that in production.

Hey there, everyone.

I've been stuck on a single assignment for a very long time, and it's no longer productive for me to struggle at it alone.

I'm trying to create a REST method that takes in two parameters (a temperature and a type(F or C)) and returns the appropriate converted temperature based on what is entered. As an example, if someone enters (32.0 F) as parameters, it should spit out (0.0), whereas if someone enters (100.0 C), you should get (212.0).

I know that I need to create a wrapper class to handle both data types and receive an output, but all posts that I've seen refer only to handling lists of objects, and I can't figure out how to convert that logic into what I need.

I would prefer detailed explanation so that I can see how the code truly works, as opposed to just getting the solution, as I feel like this topic would help a lot of people understand the construction of wrapper classes.
@RestResource(urlMapping='/RestTemp/v2/*')

global with sharing class RestTempV2 {
    @HttpPost
    global static Result PostTempv2(Decimal temp, String type){
        if(type =='F'){
        	Decimal cs = (temp - 32) * 5/9;      
        	Result r = new Result(String.valueOf(cs.setScale(2)));
        	return r;
        } else if(type =='C'){
        	Decimal fh = (temp * 9/5) + 32;
            Result r = new Result(String.valueOf(fh.setScale(2)));
            return r;
        } else if(type == null){
            Decimal cs = (temp - 32) * 5/9;      
        	Result r = new Result(String.valueOf(cs.setScale(2)));
        	return r;
        } else {
            system.debug('Please use a valid temperature type, either F or C.');
        }
    }
}
global class TempWrapper{
    global static Result PostF2Cv2(Decimal fh){        
        Decimal cs = (fh - 32) * 5/9;       
        Result r = new Result(String.valueOf(cs.setScale(2)));
        return r;
    }
    global static Result PostC2Fv2(Decimal cs){
        Decimal fh = (cs * 9/5) + 32;
        Result r = new Result(String.valueOf(fh.setScale(2)));
        return r;
    }    
    
    
}
I know my code is improper. This is why I'm asking for help.

Thank you all!

 

Hi,

 

I want to fetch the list of label names for all the fields of an Object....I got some code to get field labels of an Object 

 

i.e. <apex:column title=”{!$ObjectType.OpportunityLineItem.fields.Quantity.label}” headerValue=”{!$ObjectType.OpportunityLineItem.fields.Quantity.label}” width=”50px”>

 

But I want to get the list of all field labels by Apex..

I got the API name of all fields like this 

 

 String type='Account';

Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Schema.SObjectType leadSchema = schemaMap.get(type);
Map<String, Schema.SObjectField> fieldMap = leadSchema.getDescribe().fields.getMap();


for (String fieldName: fieldMap.keySet()) {

System.debug('##Field API Name='+fieldName);// list of all field API name
}

 

 

 

But I need to get the label name..

 

Please help

  • January 20, 2012
  • Like
  • 1