Hot answers tagged

14

Sry Found the solution to the question just after entering the Question. The correct Field that should be referenced in Visualforce page is "MailingCountryCode" instead of "MailingCountry" <apex:page standardController="Contact"> <apex:form > <apex:pageBlock mode="edit"> <apex:pageBlockSection > <apex:...


8

There are two standard composite address fields, either of which should suit your needs. BillingAddress BillingCity BillingState BillingPostalCode ShippingAddress ShippingCity ShippingState ShippingPostalCode Once your fields are on the Page Layout and you have data populated, you can get this data via a query as follows. You can apply a similar filter ...


7

BillingAddress is a complex field. If you want to find records that have no populated values, it would look like this: SELECT Id FROM Contract WHERE BillingStreet = NULL AND BillingCity = NULL AND BillingStateCode = NULL AND BillingPostalCode = NULL AND BillingCountryCode = NULL (Note: This query presumes that you're using State ...


6

The Apex field reference for Account shows it as ShippingState and doesn't expose ShippingStateCode. The API documentation exposes both: It appears Apex doesn't expose the ISO State Code for either the Shipping or Billing addresses by default. The same issue exists for the ISO Country Code. I haven't been able to find any documentation, but it might be ...


5

https://www.salesforce.com/us/developer/docs/api/Content/compound_fields_address.htm After v30 Sfdc introduced compound field.This is read only field which is available on Account object A sample SOQL will be as below SELECT Name, BillingAddress FROM Account


5

You set the individual fields, such as BillingStreet, BillingCity, BillingState, BillingPostalCode, and BillingCountry (plus the geolocation codes, as well, if you prefer). The address complex field is a convenience field derived from the parts, just as a contact or lead's "Name" field is really a concatenation of the various parts of their name (first, last,...


4

The short answer is no, what you're trying to do is not possible. The longer answer is that the BillingAddress field is a 'compound' field (introduced in API v30.0, aka the Spring '14 release), which has a bunch of limitations which are outlined in the documentation on compound fields. One of those limitations is that compound fields are read-only. If you ...


4

You've got one big OR join and that means any single criterion being fulfilled meets the entire validation criteria (hence the error). All your inner OR calls are redundant. What you would really want for a particular subgrouping is: AND( NOT(REGEX(BillingPostalCode, "<expression>")), OR( BillingCountry = "A", BillingCountry = ...


4

FYI: You can't create new state and country picklist values via Metadata API: You can’t use the Metadata API to create or delete new states or countries. https://developer.salesforce.com/docs/atlas.en-us.216.0.api_meta.meta/api_meta/meta_addresssettings.htm?search_text=AddressSettings Real bummer, forcing you to manually create dozens of values ...


4

If you have enabeled 'State and Country/Territory Picklists' in your org use the below code to get country details. Please don't add inside for loop. Schema.DescribeFieldResult fieldResult = User.Countrycode.getDescribe(); List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues(); Map<String,String> countryMap = new Map<String,String&...


4

You need to configure your state & territory picklist, then it will appear there. Please find the steps in below screenshot


3

For things like this, I use an array: String[] addr = new String[] { record.Street, record.City, record.State, record.PostalCode, record.Country }; for(Integer i = 4; i >= 0; i--) { if(addr[i] == null) { addr.remove(i); } } String theAddr = String.join(addr, ',');


3

I've had to do this. Whilst you can change most details on the Edit Profile page, your e-mail address is something you can't change. You'll need to contact them directly, you can use ktnsupport@kryteriononline.com to ask them to change those details. How do I get all of these to be updated to my personal email address (at both Salesforce & Kryterion) ...


3

I have provided a similar solution in this (SFSE) forum link. I have used googleapis as parser to parse the text area into different text fields. It is a complete example to start with. You can update further as per your requirement. Hope this helps.


3

Though billing address appears as one field on the UI it is a compound of multiple text fields You can do account a = [select id,billingstreet,billingcity,billingstate,billingPostalCode,BillingCountry from account where id=:'001d000001hKINv']; string shippingAddress = a.billingstreet+ a.billingcity + a.billingstate + a.billingPostalCode+ a.BillingCountry;...


3

You should try to use a Validation Rule. It supports Regular Expressions and therefore you find a REGEX() formula function: https://help.salesforce.com/HTViewHelpDoc?id=customize_functions_i_z.htm (scroll down a lot...) https://developer.salesforce.com/forums/ForumsMain?id=906F00000008vYrIAI Also have a look at this examples: https://help.salesforce.com/...


3

You need a junction object. However, note that junction objects are rather expensive in data storage.


3

Disclaimer: I don't have any experience working with simple-salesforce and neither I am associated with it anyway. But based on how the Address Compound Field works and just by looking at simple-salesforce docs, seems you just need to use the individual compound field names here in your request without having the ShippingAddress attribute. Your request ...


2

Create a custom formula field of type text. For example, (assuming that your custom field names match the labels you showed in the question): Address1__c + BR() + City__c + IF(City__c!=null, ',', '') + ' ' + State__c + ' ' + Zip__c The IF(City__c!=null, ',', '') part lets you skip the comma after city if the city value was null. edit: updated formula to ...


2

It's subset of fields and you don't have to group them. They're only grouped by the UI. Just as you're populating all the other fields, it's no different for the address fields. Below are the names of each field: <MailingStreet>Flinders St</MailingStreet> <MailingCity>Melbourne</MailingCity> <MailingState>VIC</MailingState&...


2

Translations are always retrieved in the user language. You can see their labels and codes with this code snippet: Schema.DescribeFieldResult fieldResult = Account.BillingCountryCode.getDescribe(); List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues(); System.debug(LoggingLevel.INFO, '>>>>> Countries'); for( ...


2

When trying: Contact c = [Select Id, MailingAddress From Contact Limit 1]; system.debug(c); system.debug(c.MailingAddress.postalcode); We get the error: Invalid foreign key relationship: Contact.MailingAddress However this works as expected: Contact c = [Select Id, MailingAddress From Contact Limit 1]; system.debug(c); system.debug( ( (Address)c....


2

Approach 1 Since Address in Compound field, you can simply fetch each Address attributes from Account object from the SOQL query and update invoice records like this: trigger udtInvAddress on Account (After Update) { List<Order2__c> invoices; if(Trigger.isAfter && Trigger.isUpdate){ invoices = [SELECT Id, Account__r....


2

Note: This is the current behavior, but not a guaranteed result Not sure if this is an anomaly or not as the sets are unordered but doing this seems to put it back in the order they were added. Also removes a loop. //Build the set of values Set<String> tmp = New Set<String>{'C','B',null,'A',null,'Z','D'}; System.debug(tmp); 19:19:42.23 (...


2

I just got a response from SFDC R&D and there is a confirmed bug with address fields in Lightning components: https://success.salesforce.com/issues_view?id=a1p3A000000EAi2


2

Check your Organization Edition, Autocomplete on Standard Addresses documentation says: Available in: Professional, Enterprise, Performance, and Unlimited editions.


2

Yes, State and StateCode are intractably linked. You can't see it in the UI, because it's just State (or Mailing State, etc). The reason why it exists at all is so that you can have a fully written out State (e.g. Colorado), while having an abbreviated form (e.g. CO) for validating addresses, sending mail, etc. You've already stated your choices here: you ...


1

It will be like this: List<String> lstStr = new List<String>(); Address addr = Account__r.ShippingAddress; if(addr.getStreet() !=null) lstStr.add(addr.getStreet()); if(addr.getCity() !=null) lstStr.add(addr.getCity()); if(addr.getState() !=null) lstStr.add(addr.getState()); if(addr.getCountry() !=null) lstStr.add(addr.getCountry()); if(addr....


1

I'd do something like this -- utilizing the AttributeValue() and concat() functions: %%[ var @firstname, @lastname, @company, @shipaddress1, @shipaddress2, @city, @state, @zipcode, @cusid set @firstname = AttributeValue("FirstName") Set @lastname = AttributeValue("LastName") Set @company = AttributeValue("Company") Set @shipaddress1 = AttributeValue("...


1

From my understanding, this is what I can suggest. Since the standard Address field is not editable, one work around for this issue is to hide the standard "Address field" using Page Layouts and create "Custom fields" depending on the information you need to capture and place them on the Lead object. For example: If you want to have individial fields to ...


Only top voted, non community-wiki answers of a minimum length are eligible