• Bhavesh Rekvar
  • NEWBIE
  • 0 Points
  • Member since 2020

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

Hello,

I have tried below code as you shared but there are something error so please let me know what can i do to fix this issue.

 

@RestResource(urlMapping='/User/*')
global with sharing class UserListClass{
@HttpGet 
global static List<User> getUserList() {

Map<Id,Profile> profileIds = new Map<id,profile>([SELECT Id,UserLicenseId FROM Profile where UserLicenseId  in (SELECT Id FROM UserLicense where name ='Salesforce')]);

List<user> standardProfileUsers = [select id from user where profileId in:profileIds.Keyset()];

return standardProfileUsers;

}
}

 

Blow image is appear on error screen shot so please see this issue and what can i do to fix this issue..

 

User-added image

 

Please let me know, if we can do meeting for discussion related to saleforce apex code issue...

Hello,

I have tried below solution as you shared but getting some problem so please let me know how can fix this problem and get all users of salesforce using apex.

@RestResource(urlMapping='/User/*')
global class UserListClass{
@HttpGet global static List getUser() {

Map<Id,Profile> profileIds = new Map<id,profile>([SELECT Id,UserLicenseId FROM Profile where UserLicenseId  in (SELECT Id FROM UserLicense where name ='Salesforce')]);

List<user> standardProfileUsers = [select id from user where profileId in:profileIds.Keyset()];

return standardProfileUsers;

}
}

Appear 3 problem let me know how we can solve this issue

One more think, Could we set a meeting for some discussion related to apex code and some other things.

If it's possible to meeting setup, please let me know.

Hello Salesforce team,

I have tried this below apex code but this is for account but i don't know how we can get the all the user can you provide me whole code of get all user using apex code 

 

@RestResource(urlMapping='/AccountService/*')
global class AccountService{
@HttpGet global static List getAccounts() {
List Accounts = [SELECT Id,Name from Account LIMIT 10];
return Accounts;
}
}

Above code for get account but i need to get all added users in salesforce.

I don't know what is replace this line @RestResource(urlMapping='/AccountService/*')

Please provide me whole code of how to get all users of salesforce, Don't provide any blog and example because i have already tried it so if can possible to share whole code of get all users of salesforce.

One more think, I want talk to you, some question and queries related to salesforce so we can set a meeting or not.

If can possible so please let me know...

Hello,
I'm trying to how we can get the Salesforce user using apex code but did not getting any solution for it.

I have tried the below code but not getting the user of the salesforce.

@RestResource(urlMapping='/AccountService/*')
global class AccountService{
@HttpGet global static List getAccounts() {
List Accounts = [SELECT Id,Name from Account LIMIT 10];
return Accounts;
}
@HttpPost global static String createNewAccount(String Name){
Account a = new Account();
a.Name = Name;
insert a;
return 'Account Created';
}
@HttpDelete global static String deleteAccountById() {
RestRequest req = RestContext.request;
String Id = req.params.get('Id');
List a = [ Select ID from Account where Id= :Id];
delete a; return 'Account Deleted';
}
@HttpPut global static String updateAccount(String Id, String NewName) {
Account a = [ Select ID, Name from Account where Id= :Id];
a.Name = NewName;
update a;
return 'Account Updated';
}
}

Please review the code if any error in the code so please update the code and let me know.
I'm trying to how we can get talent LMS users in Salesforce using Apex code, but not getting any solution please let me know any solution to my question.

I have also tried below link but not getting the exact solution for it,so please provide me any solution for it.

https://help.talentlms.com/hc/en-us/articles/360014658613-How-to-integrate-Salesforce-and-TalentLMS

This link is not useful for me so please give me the best solution to this problem.

Below I have tried this code in saleforce (apex code)
public class Get_talentLMS_User {
    public static void RestServiceMethod(String sessionId){
    
     HttpRequest req = new HttpRequest();
     req.setEndpoint('https://ignatiuzardent.talentlms.com/D5ZgtG7uMIBhgrQBncL1MwStSHBUuT/v1/users');
     req.setMethod('GET'); 
     req.setHeader('Authorization', 'OAuth ' + sessionId);
     req.setHeader('Content-Type','application/json'); 
     req.setTimeout(120000);
     
      
     HttpResponse res = new HttpResponse();
     //res = http.send(req);
     
     system.debug(res);
     }
}

Please review the code if any error in the code so please update the code and let me know.

 

We have already find out the solution but did not get any solution. Please let me know how we can use the REST API in apex code... 

If you can provide basic syntax of Get, Update and Delete data using REST API in apex code (Salesforce).

Hello,

I'm trying to how we can get the Salesforce user using apex code but did not getting any solution so please reach out.

I'm tring to how we can get talent LMS user in Salesforce using Apex code, but not getting any solution please let me know any solution of my question..

Hello,

I'm trying to how we can get the Salesforce user using apex code but did not getting any solution so please reach out.

I'm tring to how we can get talent LMS user in Salesforce using Apex code, but not getting any solution please let me know any solution of my question..