New answers tagged

0

Custom Settings you can retrieve via SOQL (or use standard Custom Setting methods) and make any changes directly in Apex using DML. You should consider using Metadata API for retrieving and updating the following: Custom Label, Remote Site Settings, Named Credential and Custom Metadata. There is Apex Wrapper Salesforce Metadata API, which simplifies work ...


1

In your named credential, configure the 'Allow Merge Fields in HTTP Body` option then look at this example ...or you can go an easier route and call Tooling API via REST.


0

The tooling API works great in Sandboxes and Dev orgs, but not in Enterprise orgs. I described how to do it with the SOAP API under another question Dynamic Trigger Creation From Managed Package


0

When you are making call outs from lightning context, the session Id you get doesn't have the scope or enough permission to make a callout to apis of Salesforce. You can do it in this way 1) a.Create a connected app and register your own domain, and give auth provider as Salesforce b. Create a named credential, and and register your Salesforce domain ...


0

From lightning session, you cannot invoke callout directly. You need named credential for that. req.setEndpoint(URL.getSalesforceBaseUrl().toExternalForm()+'/services/data/v39.0/tooling/sobjects/GlobalValueSet/(Here is GlobalPickListId)?_HttpMethod=PATCH'); Create named credential for endpoint and use it. -----added------- Go to setup > Named credential ...


0

You can get it from the Tooling API itself. The Tooling API field you want is EntityDefinition.DurableId: SELECT DurableId FROM EntityDefinition WHERE QualifiedApiName = 'Full_Name_of_Field__c'


-1

You can just add id field in your query. example: [SELECT ID, Email from Account] It is a unique record id and can be queried just by calling ID field in your query


0

Just got to know we can query like this. Got the result using this- SELECT DurableId FROM EntityDefinition WHERE QualifiedApiName = 'CustomObject__c'


0

S Kawasaki, You can queried for you custom object using SOQL: List<MyCustomObject__c> customObjs = [SELECT Id, Name, CustomField__c FROM MyCustomObject__c]; Hope this helps!


0

Not sure what you meant by getting Id from object name. Here is small notes on Ids and object API names. You can get object API name by using Id. You can say myId.getSobjectType(). If you want to know all the objects' Ids then use SOQL [SELECT Id FROM ObjectName].


0

yes instead of getting the id of the object and redirecting the page to create a custom field, you can create a field using Tooling api itself. I have written a lightning component to create custom object fields for any object (Whichever is accessible to create custom fields). Let me know if you need the code.


1

you may try to use the following SOQL Query to get the Id: Id myCustomObjectId = [SELECT CustomObjectId FROM CustomObjectUserLicenseMetrics WHERE CustomObjectName ='MyCustomObjectName' limit 1].id; hope it helps


Top 50 recent answers are included