What are the values for the 'country' field in Active Directory? - active-directory

I have a feeling Windows expects 'country' to be an integer, with 0 meaning 'US'. If that's the case, what's the mapping between integers and ISO 2-letter country codes?active

There are three different properties that must be set in Active Directory. Each is designated in the ISO 3166 standard. The ISO website has a search tool that you can use to find the official codes. Select Country codes and hit search, then click on Officially assigned... on the left.
c — 2 digit abbreviation (e.g. US)
The country/region in the address of the user. The country/region is represented as a 2-character code based on ISO-3166.
co — Country name (e.g. United States). Microsoft got really detailed on their description for this one.
The country/region in which the user is located.
countryCode — Numeric Id (e.g. 840)
Specifies the country/region code for the user's language of choice. This value is not used by Windows 2000.
Note: If you want to clear the country field, then you need to set this value to 0. You cannot set it to null or String.Empty. It will throw a DirectoryServicesCOMException stating "The server is unwilling to process the request" when you call CommitChanges() if you try to set it to anything other than an int.
DirectoryEntry.Properties["countryCode"].Value = 0;

See this link here:
ISO 3166 Country Codes
Seems to be standard ISO 3166 country codes used in several places.
Same result from this post here: Active Directory and .NET
Point 5 reads:
5. Set user's country
To set the country property for a user
was one of the tasks that took me some
time to figure out. After some hours
of research I realized that you need
to know the ISO 3166 Codes for
countries and set three properties to
define a user's country: c, co, and
countryCode.
Best overview that includes the elusive ISO 3166 numeric codes can be found on Wikipedia - of course! (at ISO itself, you can't seem to get those lists for free - you have to pay for the privilege....)

There's two country properties, countryCode and c, both are ISO 3166 values. The former is a number and the latter a string (ISO 3166 A2).
See ISO 3166.
Also, there's the co property which is the name of country.

Related

Salesforce CASESAFEID(Id): Last 03 digits of all the record ids are coming up same

I am testing CASESAFEID(Id) function to get the 18-digit ids in my report. I created a formula field and used that field in a report. I am noticing that the last 03 characters of most of the records in this field are the same. I could not find the reason or logic for these 03 characters on google search to posting it here.
My formula field:
My report:
I am using trailhead playground for this testing.
Yes, that can happen. IDs that have uppercase letters on same positions will have same 3 "digit" suffix. You don't have to worry about that? There are some posts if you're really interested in the algorithm.
https://astadiaemea.wordpress.com/2010/06/21/15-or-18-character-ids-in-salesforce-com-%E2%80%93-do-you-know-how-useful-unique-ids-are-to-your-development-effort/
https://salesforce.stackexchange.com/questions/1653/what-are-salesforce-ids-composed-of
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/field_types.htm (scroll down to ID field type)
They're essentially a checksum-type value to ensure that valid Salesforce Ids do not differ from one another only in case. This provides safety for tools like Excel that treat abc and AbC as the same value.
The behavior you are observing is normal. There's no need to test this formula function as such; it's a standard part of the platform.

How to encode FNC1 starting character to make GS1 Datamatrix?

I have made string for GS1 Datamatrix
è010506060985000521sn1234567890ab 1002TRIAL003 17200228
ASCII 232
(01) Product Code (aka GTIN)
(21) Serial Number
ASCII 29 (aka aka Group Separator)
(10) Lot/Batch
ASCII 29 (aka aka Group Separator)
(17) Expiry Date
I am passing this string to Dev express Control – symbology as Datamatrix and compatible mode as ASCII.
This barcode scan correctly click here to view barcode as GS1 Datamatrix, but when I sent this string to our printing person in China, he did printed but when I am scanning his barcode getting error “Unknown encoding”.
I thing their system is not able to encode ASCII 232 – “è”.
Is any alternate way?
I am just replacing FNC 1 Start changer ASCII 232 to ASCII 29, is it correct way? click here to view barcode Is it GS1 Datamatrix?
(I just scan that in one mobile app in that it comes as GS1 Datamatrix but when did I scan into another app it just come as Datamatrix)
I want to achieve GS1 Datamatrix...
Thanks
this issue is totally dependant on the hardware used. The way to indicate FNC1 character may differ between printer family/type. Do you have info on which one is used in your case?
First, your printer partner should check himself the label he's creating (there is a GS1 app easy to use on smartphone to do that), so he can directly see if the expected information are present and well encoded.
Then, you should check which printer type he is using and which software is used to create the printer mask/job. I know lots of people are using NiceLabel for example, but I remember some issues can be found on the FNC1 character is you are using some recent Zebra printer for example. This is something the printer SAV can probably help with if it's something similar.
[EDIT]:In case of doubt this can help but you probably have it already.
Based on what you said, your part is acting like a scanner, so check chapter 2.2.1 => Important: In accordance with ISO/IEC 15424 - Data Carrier Identifiers (including
Symbology Identifiers), the Symbology Identifier is the first three characters transmitted by
the scanner indicating symbology type. For a GS1 DataMatrix the symbology identifier is ]d2

How to tell Watson conversation to not recognize strings as numbers

I'm facing a strange issue with IBM Watson Conversation when capturing numbers in Spanish language:
In Spanish when you write (or say), "please give me an answer" (por favor, dame una respuesta) or "I want to talk with a professional" (quiero hablar con un profesional), Watson recognize the words "una" and "un" as a number. Yes, it is a number (the number 1) but in these phrases they do not have the meaning of a number, they work as an article.
Do you know how to tell Watson to not recognize strings as numbers? I have been thinking about patterns but the numbers can have different length.
According to the Official documentation, the #sys-number system entity detects numbers that are written using either numerals or words. In either case, a numeric value is returned.
When you enable the System Entity #sys-number, this entity always tries to detect if the user typed some number, there are the recognized formats:
21
twenty one (in your case, works with un, una, etc)
3.13
You can see this table showing how to use this entity with other examples:
So, Watson will recognize these values (un, una) like one number, and currently don't have exceptions or configuration for does not recognize something, like your example, the word typed by the user.
If you want for some purpose to send to the user the 'una' or 'un'(literal format example), just add in your conversation response:
The number is #sys-number.literal
And the return in the bot will be:
The number is un?
See more about #sys-number System entity.
See more about System entities.

Detect when (Select All) is checked for multi value parameter

I have a report with a multi-valued parameter on it. I'm looking to output the selected values which is accomplished with Join(Parameters!State.Label,",")
Every solution I've found on the web indicates I should use something like the following to detect when the (Select All) "value" is selected.
E.g. expression for the text box on the header should be:
="State: " & IIF(countrows("prc_prompt_state").Equals(Parameters!State.Count),"(All)",join(Parameters!State.Label,","))
CountRows() tells me the total number of parameters available, e.g. 8 states in Australia. Parameters!State.Count is supposed to tell me how many are actually selected by the user. However this always reports the full value (8 in this case) regardless of how many are selected. This is in agreement with the official docs (https://technet.microsoft.com/en-us/library/aa337293(v=sql.100).aspx), but NOT in agreement with every single search result I come up with on how to solve this problem.
So how can I rewrite this expression so I can find out when (Select All) is/isn't checked? I'm using report builder 3, which I believe is based on the 2008 edition - we deploy to Azure, but I haven't got that far yet.
Examples of questions whose answers seem to be wrong:
Displaying Multi-Value Parameters
SSRS: Can I know if user selected "ALL" in multivalued param?
This is old, but google found it for me, and then I figured out an answer on my own that worked. (I was using a list of users.)
I created a separate dataset that returns a count of all available options in the default parameter lookup (username). Then, I assigned that as a default value to an internal parameter. (UserCount) This worked as a text expression:
=Microsoft.VisualBasic.Interaction.IIF(Parameters!username.Count = Parameters!UserCount.Value, "All Selected", Microsoft.VisualBasic.Strings.JOIN(Parameters!username.Value, ", "))

What is the best way to handle Chinese names in Salesforce?

Salesforce separates family and personal names according to western convention.
That is the first name is personal and the last is a family name. This can be changed by changing the salesforce locale (say from the US to China) so that a the first name is the familyname and the last name(s) are personal
So in the vanilla SF John Smith appears as John Smith. If you switch to the Chinese localisation it would appear as Smith John.
Equally in vanilla Lim Keat Song would appear as Keat Song Lim, but would be correct in the chinese localisation as Lim Keat Song.
My problem is that about 30% of my contacts have East Asian names and so neither localisation is entirely satisfactory.
What are the the best ways of resolving this on a standard contact object?
I've asked the question on salesforce and as far as I can see there isn't much on this on google.
I'm asking this because whilst I can solve it - probably along the lines of the SD question - it's probably a known problem and I would like to find the best solution rather than reinventing the wheel.
Just for your idea.
We add two custom fields as Formula on the Contact object.
One custom field called Last Name refer to the Standard Last Name field on the Contact,
the other called First Name refer to the Standard First Name field on the Contact.
Therefore, you don't need to do any data import to these custom fields, but only define how to display your customized Last Name and First Name fields in the Contact display.
And this layout of Last Name and First Name will not change with users' localisation setting.
This may be not a perfect way to solve this, I wish it would help.

Resources