• maninder singh 50
  • NEWBIE
  • 85 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 11
    Replies
I am using the Schema Sobject describe command of SFDX CLI (Salesforce CLI) to get picklist values for a custom object picklist field in my org. Link: https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_schema.htm#cli_reference_force_schema 

The issue here is that instead of showing the Picklist values the command outputs picklistValues: [Array] 
Below is an example of the output JSON i have for a field which is a picklist. Is this expected and how do we get the picklist values from SFDX CLI ? If I i use Force CLI it works fine for Sobject describe command.
{ aggregatable: true,
       aiPredictionField: false,
       autoNumber: false,
       byteLength: 765,
       calculated: false,
       calculatedFormula: null,
       cascadeDelete: false,
       caseSensitive: false,
       compoundFieldName: null,
       controllerName: 'REX_PS_Category__c',
       createable: true,
       custom: true,
       defaultValue: null,
       defaultValueFormula: null,
       defaultedOnCreate: false,
       dependentPicklist: true,
       deprecatedAndHidden: false,
       digits: 0,
       displayLocationInDecimal: false,
       encrypted: false,
       externalId: false,
       extraTypeInfo: null,
       filterable: true,
       filteredLookupInfo: null,
       formulaTreatNullNumberAsZero: false,
       groupable: true,
       highScaleNumber: false,
       htmlFormatted: false,
       idLookup: false,
       inlineHelpText: null,
       label: 'Location Agreed',
       length: 255,
       mask: null,
       maskType: null,
       name: 'REX_Location_Agreed__c',
       nameField: false,
       namePointing: false,
       nillable: true,
       permissionable: true,
       picklistValues: [Array],
       polymorphicForeignKey: false,
       precision: 0,
       queryByDistance: false,
       referenceTargetField: null,
       referenceTo: [],
       relationshipName: null,
       relationshipOrder: null,
       restrictedDelete: false,
       restrictedPicklist: true,
       scale: 0,
       searchPrefilterable: false,
       soapType: 'xsd:string',
       sortable: true,
       type: 'picklist',
       unique: false,
       updateable: true,
       writeRequiresMasterRead: false },

 
we have an API user setup for integration purpose. In the data model we have Product (Master) and "Product Condition" (Child) objects with MD relation. We have granted Read, Create, Edit and View All access for Product, to this user using permission set. The OWD for Product is Private and for "Product Condition" is Controlled by Parent. 

The API user is not able to query for "Product Condition" from workbench. As per my understanding since the user has access to Master object the child object will inherit the sharing settings of master which is Product here. Can someone help why this setting does not work ? 
When attempting to create my Apex trigger for this Trailhead development exercise, I receive about 20 errors similar to Unexpected token '<'. , Unexpected token 'and'. etc.

trigger AccountAddressTrigger on Account (before insert, before update) {
  List<Account> acc = [Select id from account where Id in :trigger.new and BillingPostalCode!= null and Match_Billing_Address__c == true];
       for(Account a: acc)
    {
      a.ShippingPostalCode = a.BillingPostalCode;        
    }  
}

If i use below query there are no errors.
List<Account> acc = [Select id, Match_Billing_Address__c from account where Id in :trigger.new and BillingPostalCode!= null];

So, there is something wrong with the other Match_Billing_Address__c field and I validated that the API name is correct. I know there are other solutions available for same challenge but please help in debugging this.
 
In the below 2 queries Account is the parent and Opportunity is the related record. This is a standard relation which exists in the Org.

Query 1: [SELECT Id,(SELECT Id FROM Opportunities) FROM Account WHERE Id IN :Trigger.New] 
In Query 1 I understand that Opportunities is the Relationship API Name for Opportunity Object , so we have used this to get child records.
.
Query 2: [SELECT Id FROM Account WHERE Id IN (SELECT AccountId FROM Opportunity) AND Id IN :Trigger.old]
Here in Query 2 why have  we used  Opportunity (Opportunity object API name) instead of Opportunities (Relationship API Name) though we are still accessing child records?

Please correct if my understanding for Query 1 is wrong.
I have retrieved metadata from my Sandbox using the project manifest, but am unable to deploy any custom field changes. I receive the following error when running "Deploy source to org":
An error was encountered during conflict detection. MetadataTransferError: Metadata API request failed: Component conversion failed: Method not implemented

Deploys work without issue using the CLI directly.
I am trying to get the data PDF file from REST API, while storing it into the attachment object as PDF it is showing the empty PDF pages, kidnly help me to solve this issue. 

Note:- Encodeutil decode and encode not wokring while attachment creating converting the response,getBody() into attachment. 
 
string url = AWSUtility.viewS3Object('a1h0n00000187sc');
system.debug('The url is:' + url);

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint(url);
request.setMethod('GET');
request.setHeader('Content-Type', 'application/pdf'); 
request.setHeader('Content-Encoding', 'UTF-8');
//req.setHeader('Content-Disposition', 'attachment; filename=' + fileName);
//req.setHeader('Connection', 'keep-alive');

HttpResponse response = http.send(request);
system.debug('The response is :' +response.getBody());
attachment att = new attachment();
att.parentId = 'a1h2g000000I1IN';
att.Name = 'Testing Raja2.pdf';
att.contentType = 'application/pdf'; 

att.body = blob.valueof(response.getBody());

//att.body = EncodingUtil.Base64Decode(response.getBody());
//att.body = EncodingUtil.base64Decode(response.getBody());
//att.body = EncodingUtil.base64Decode(blob.valueof(response.getBody()));
//att.body = EncodingUtil.base64Encode(blob.valueof(response.getBody()));
insert att;  (// attachment is getting created but, all empty pages only).

 
I am working on an implementation of salesforce community (of type visualforce page and custom tab). To comply with GDPR guidelines i need to build a cookie consent mechanism.

Now salesforce community cloud itself sets multiple cookies in the user's browser. Most of these are required but some are functional. The following url show the details of cookies used

https://help.salesforce.com/articleView?id=000351913&type=1&mode=1

I want to know that is there any API provided by salesforce to control the functional cookies so that they are not set in the user's browser, or any other way to avoid these cookies.

Thanks in advance

Sandeep
I am using the Schema Sobject describe command of SFDX CLI (Salesforce CLI) to get picklist values for a custom object picklist field in my org. Link: https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_schema.htm#cli_reference_force_schema 

The issue here is that instead of showing the Picklist values the command outputs picklistValues: [Array] 
Below is an example of the output JSON i have for a field which is a picklist. Is this expected and how do we get the picklist values from SFDX CLI ? If I i use Force CLI it works fine for Sobject describe command.
{ aggregatable: true,
       aiPredictionField: false,
       autoNumber: false,
       byteLength: 765,
       calculated: false,
       calculatedFormula: null,
       cascadeDelete: false,
       caseSensitive: false,
       compoundFieldName: null,
       controllerName: 'REX_PS_Category__c',
       createable: true,
       custom: true,
       defaultValue: null,
       defaultValueFormula: null,
       defaultedOnCreate: false,
       dependentPicklist: true,
       deprecatedAndHidden: false,
       digits: 0,
       displayLocationInDecimal: false,
       encrypted: false,
       externalId: false,
       extraTypeInfo: null,
       filterable: true,
       filteredLookupInfo: null,
       formulaTreatNullNumberAsZero: false,
       groupable: true,
       highScaleNumber: false,
       htmlFormatted: false,
       idLookup: false,
       inlineHelpText: null,
       label: 'Location Agreed',
       length: 255,
       mask: null,
       maskType: null,
       name: 'REX_Location_Agreed__c',
       nameField: false,
       namePointing: false,
       nillable: true,
       permissionable: true,
       picklistValues: [Array],
       polymorphicForeignKey: false,
       precision: 0,
       queryByDistance: false,
       referenceTargetField: null,
       referenceTo: [],
       relationshipName: null,
       relationshipOrder: null,
       restrictedDelete: false,
       restrictedPicklist: true,
       scale: 0,
       searchPrefilterable: false,
       soapType: 'xsd:string',
       sortable: true,
       type: 'picklist',
       unique: false,
       updateable: true,
       writeRequiresMasterRead: false },

 
In the below 2 queries Account is the parent and Opportunity is the related record. This is a standard relation which exists in the Org.

Query 1: [SELECT Id,(SELECT Id FROM Opportunities) FROM Account WHERE Id IN :Trigger.New] 
In Query 1 I understand that Opportunities is the Relationship API Name for Opportunity Object , so we have used this to get child records.
.
Query 2: [SELECT Id FROM Account WHERE Id IN (SELECT AccountId FROM Opportunity) AND Id IN :Trigger.old]
Here in Query 2 why have  we used  Opportunity (Opportunity object API name) instead of Opportunities (Relationship API Name) though we are still accessing child records?

Please correct if my understanding for Query 1 is wrong.
Hi,

I have a condition , where in I have picklist values maintained in both Thai as well as English. Now i have to export picklist values to excel sheet. 

How do I make sure, that only thai picklist values get exported ?
Hi Guys,

I'm using salesforce api to get all contacts from a list view.
I can also use limit & offset aswell but my problem is I could not found a way to count all contacts within a list view.

I use the following endpoint services/data/v36.0/sobjects/Contact/listviews/ 

Is there any way to count the result so I can pass the limit & offset for next query ?

Thanks
Sohel Amin
Hi I am looking for a easy way to print or export a large Field Dependency matrix in excel. I am new to saleforce please guide me with complete details.
  • January 30, 2014
  • Like
  • 0
I want to extract the valid Picklist values for table Account field Industry for comparison to the values currently used. How can I extract these values? Are they stored in a table that I can download?
  • September 25, 2007
  • Like
  • 0