• Ad Cad
  • NEWBIE
  • 10 Points
  • Member since 2018

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

Error screenshotWhen a community web page opens the ‘Page Unavailable’ error above appears.

The List<ANY> that it’s trying to process when it expects a Map<String, ANY> contains this:

[
    {
        "message": "This feature is not currently enabled for this user type or org: [Theming]",
        "errorCode": "FUNCTIONALITY_NOT_ENABLED"
    }
]

This comes from a callout to:
https://<mysforg>.my.salesforce.com/services/data/v48.0/ui-api/themes/active

The User that makes the call is a Community user. If a System Admin makes the same call, the correct data is returned.

My question: Where do I enable ‘Theming’? That exact error message returns zero Google results, and I can’t find anything in the Profile related to Theming.

Thanks!

  • March 23, 2023
  • Like
  • 0

Hi,

I have a trigger that,amongst other things, adds a User to a Public Group. To achieve this, and not get a 'Mixed DML' error, the code to add the User to the Public Group is wrapped up in an @future method, so it executes in its own transaction.

Now, a new requirement has come along that requires a lot of records to be updated, and so this trigger - and the @future method - will get called thousands of times. I've wrapped all this up in a Batch class to achieve this.

But, calling an @future method from a Batch (effectively, calling an Async method from another Async method) is not permitted.

I tried, in the Trigger, detecting the process was being called from a batch and then using a not-@future method - but, of course, that fails again with a 'Mixed DML' error.

Any suggestions as to how I can get around this? Please don't get too focussed on this particular scenario, as I have a few similar ones, and what I'd really like is a general solution to this.

Thanks for your suggestions!

  • February 06, 2023
  • Like
  • 0

Error screenshotWhen a community web page opens the ‘Page Unavailable’ error above appears.

The List<ANY> that it’s trying to process when it expects a Map<String, ANY> contains this:

[
    {
        "message": "This feature is not currently enabled for this user type or org: [Theming]",
        "errorCode": "FUNCTIONALITY_NOT_ENABLED"
    }
]

This comes from a callout to:
https://<mysforg>.my.salesforce.com/services/data/v48.0/ui-api/themes/active

The User that makes the call is a Community user. If a System Admin makes the same call, the correct data is returned.

My question: Where do I enable ‘Theming’? That exact error message returns zero Google results, and I can’t find anything in the Profile related to Theming.

Thanks!

  • March 23, 2023
  • Like
  • 0
if(!conList.isEmpty()){
            Database.SaveResult[] srList = Database.insert(conList, false);
            
            
            system.debug('srList'+srList);
            integer size=srList.size();
             system.debug('srList size'+size);
               List<Database.SaveResult> Result=srList;
                //Failed Records
                failedconlist=new List<contact>();
                for (Integer i = 0; i<srList.size(); i++) {
                Database.SaveResult s = Result[i];
                contact origRecord = conList[i];
                system.debug('origRecord'+origRecord);
       
                 if(!s.isSuccess()){
                 failedconlist.add(origRecord);
                  // List<Database.Error> err= s.getErrors();
                    ErrorLog__c log=new ErrorLog__c();
                    log.AccountId__c= origRecord.Accountid;
                    
                    log.AccountName__c=origRecord.Account.Name; 
                    
                    for(Database.Error err : s.getErrors()) {
                    // log.ErrorStatusCode__c=err.getStatusCode();   
                    // log.ErrorMessage__c=err.getMessage();
                   // log.ErrorFields__c=err.getFields();
                    }
                    logList.add(log); 
                } 
            }

Hello Experts ,
i have batch class which will insert thousand's of records .so if some records fail  i am trying to insert into error log object .
Help Needed :
1.while i am creating these records into custom object i am not able to insert error messages from DataBase.saveresult .
2.After inserting how to re-process them other than manual process .

Below is my sample code :
when i try to assign errormessage or statuscode to text fileds to not allowing .

Please give me some sample code or suggestion .

Thankyou in advance.
 
Hi,
       Developer Console is not opening for the user with profile ' Standard User '. Any solution.

Thanks.
         

Hello,

I am trying to upsert multiple objects using API REST call /services/data/v44.0/composite/sobjects (sObject Collection) refercing the objects to External Ids, but so far, I haven't had any luck.

I am doing something like:

{
    "allOrNone": false,
    "records": [
        {
            "attributes": {
                "type": "Account"
            },
            "MyExternalID__c": "27",
            "LastName": "test-test :( test-tes",
            "PersonEmail": "email@email.com"
        }
    ]
}
 

But I get al the time this error message:

[
    {
        "success": false,
        "errors": [
            {
                "statusCode": "MISSING_ARGUMENT",
                "message": "Id not specified in an update call",
                "fields": []
            }
        ]
    }
]

Any clue?

Thanks in advance!

Hello,

How can i calculate time between last modified date and present modified date and get the time in minutes.
where can i store t, in number field or text field.

thank for suggestion
  • September 17, 2018
  • Like
  • 0
So I am needing to upload many global picklist items for conversion for our existing database key value pairs
using the following documentation https://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_forcecom_general_global_picklists.htm
Currently , when you create a picklist, you enter the values for the picklist separated by a line

so for instance, body part picklist is 

face
ears
neck

after you create the picklist, you can go in and edit each individual picklist item's "api name" , essentially making this a code for a key value pair

but if you have a list of 500 picklist values and 200 picklists that need to be created, this is almost infeasible

is there a way to on picklist creation set the key value pair rather that the value setting both the value and api name so i can do integrations more smoothly
How to Display 15 Digit ID to 18 Digit ID in Sales force
Hi Experts,
     I would like to know the exact difference between 15 and 18 digits record id. Most of us say, 15 digit(case sensitive) and 18 digit(case insensitive).

Let's consider a small example,
While if you query record from Developer Console you will get 18 digit record id. Consider the below retrieved 18 digit id,

001i000001AWbWuGTA(Retrieved from query)

If 18 digit case insensitive means,

001i000001AWbWugta (this id same to the above retrieved ID)? If yes, then if you queried record with this id means, you will get no result or no rows found..!

So if both 15 and 18 are unique means what is the real time use and difference between these two ID's.

Thanks in advance..!

Hi,

I am accessing custom setting values in my apex code and its working fine. When I am calling it through test class then No values gets in from Custom Setting. It always blank in test class. Can somebody help me to understand why custom settings values are not accessible in test class.

 

Thanks,

Vinod Kumar

new here

 

i am only seeing the first 15 digits id of a record in the url when i choose 1 record. is there a way for me to see the whole 18 digits?

 

 

  • January 04, 2012
  • Like
  • 0

Hello. I want to know how can i create a Map<String, CustomObject> where the key will not be the Id of the custom field but the Name field and without using a list and going through each record and puting in the map a pair.

If I use Map<String, CustomObject__c> myMap = new Map<String, CustomObject__c>([Select z.Name, z.Id From CustomObject__c z]); i have a map where the key is my CustomObject.Id and I want it to be CustomObject.Name.

I'm looking for a method that will have a join/implode functionality.

 

I cannot seem to find an equivalent in the docs.  Does one exist in APEX?

 

Thanks

Simply put the following formula into a formula field of type "Text":

 

Id
& MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(
    IF(FIND(MID(Id,1,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0)
    +IF(FIND(MID(Id,2,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0)
    +IF(FIND(MID(Id,3,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0)
    +IF(FIND(MID(Id,4,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0)
    +IF(FIND(MID(Id,5,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0)
    )+1,1)
& MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(
    IF(FIND(MID(Id,6,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0)
    +IF(FIND(MID(Id,7,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0)
    +IF(FIND(MID(Id,8,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0)
    +IF(FIND(MID(Id,9,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0)
    +IF(FIND(MID(Id,10,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0)
    )+1,1)
& MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(
    IF(FIND(MID(Id,11,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0)
    +IF(FIND(MID(Id,12,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0)
    +IF(FIND(MID(Id,13,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0)
    +IF(FIND(MID(Id,14,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0)
    +IF(FIND(MID(Id,15,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0)
    )+1,1)

 

This is an optimized version of the code example "BPS: 18 digit external ID within the UI" you can find on the Online Help, but unlike the example provided there, it is small enough to fit into a formula field. Also, this code doesn't contain the error found in the online help example, where the second character byte equivalent of the first 5-character chunk was "4" instead of "2". I'd be more than happy if someone could come up with an even shorter version of this formula...Still, I hope you can use this.

 

Cheers,

Erik Mittmeyer

Hey guys,

 

needed a way to convert from a 15 digit ID to an 18 digit one.

Found the javascript version for just such an action here: http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=13148

 

tried to make my own apex version but the last digit keeps coming out wrong.  Any Ideas?

 

Thank's

 

 

 

String id = '001Q0000002NXad'; //a sample id

 

String suffix = '';

for(integer i=0;i<3;i++){

Integer flags = 0;

for(integer j=0;j<5;j++){
String c = id.substring(i*5+j,i*5+j+1);

if(c >= 'A' && c <='Z'){

flags += 1 << j;
}
}

if (flags <= 25) {

suffix += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.substring(flags,flags+1);

}else suffix += '012345'.substring(flags-26,flags-26+1);
}

System.debug('15-DIGIT:'+Id);
System.debug('18-DIGIT:'+Id + suffix);

 

 

 

Message Edited by astro on 05-01-2009 10:04 PM
Message Edited by astro on 05-01-2009 10:10 PM
  • May 01, 2009
  • Like
  • 0

Hi, I am having trouble about the mapping the correct record ID. I got a 18 character case-insensitive id field value for account by using Table query, but when I want to use this 18 character to update a field in a record in a custom object (purchase requisition), it will only pick the first 15 character and update the record with a wrong account name.
How to correct this?
Thanks.