CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Swedish Personal identity number (Sweden) Personnummer - Field with validation
Pages: [1]

Author Topic: Swedish Personal identity number (Sweden) Personnummer - Field with validation  (Read 8084 times)

haggan

  • Guest
Swedish Personal identity number (Sweden) Personnummer - Field with validation
August 22, 2007, 03:48:32 am
My question is related to the Swedish personnummer (Personal identity number), that is a important number in sweden. But the question could be more general in the way that I want to create my own data field but it need to have a validation, that validate in my case that the Personnummer is correct.


Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Swedish Personal identity number (Sweden) Personnummer - Field with validati
August 22, 2007, 01:22:04 pm
If "Swedish personnummer (Personal identity number)"  is unique you can use "external identifier" field (External Id in Contact form).

kurund
Found this reply helpful? Support CiviCRM

haggan

  • Guest
Re: Swedish Personal identity number (Sweden) Personnummer - Field with validati
August 22, 2007, 02:23:27 pm
Yes that is possible(it is unique), I also could define a custom number field or date. the Personnummer is on the form YYYYMMDD-XXXX. The problem is that I havent figured out how to create a module/plugin? or something like that not  sure what it is called in civiCRM, that validate the number. I want user to write their Personal identity number when appling for membership and registering on a drupal site.

The algorithm for the validation is easy implemented in PHP but I havent figured out where to put it. aka custom Validation of custom fields. or validation of external identifier.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Swedish Personal identity number (Sweden) Personnummer - Field with validati
August 22, 2007, 02:54:52 pm

You cannot add a validation rule to a custom field in the current version of CiviCRM. However this is a good idea, and we will potentially add it in a 2.x release. Would be great for you to submit a patch that does the needful, once we roll out the new custom field design

alternatively you can extend the code and add a rule to external_identifier in the xml schema files etc, which then get triggered automtically for profiles. You need to be a competent php5 programmer to do so, and we can assist you on IRC with this

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

haggan

  • Guest
Re: Swedish Personal identity number (Sweden) Personnummer - Field with validati
August 30, 2007, 12:34:45 am
I am a bit stuck, Dont really know where to start. I have read all the development blogs. Is there a some sort of guide like drupal module guide for CiviCRM?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Swedish Personal identity number (Sweden) Personnummer - Field with validati
August 30, 2007, 12:53:11 am

Can u get on IRC and ping either dlobo or kurund

one of us will be able to help you out.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

haggan

  • Guest
Re: Swedish Personal identity number (Sweden) Personnummer - Field with validati
August 30, 2007, 01:14:50 am
I got another Ideéa Personnr is just an extended date of birth so perhaps thats a better ideéa to extend date of birth with the trailing uniqe numbers. I have been looking in the sql and there is a validation table and a validation_id in the civicrm_custom_field. Is this for use in the future?

I also have notice a strange thing that I think is related to date print out. I have created custom field for a test in my drupal both of Number and Alphanumeric data type and field typ is text.
Then i input a dummy number 190712032456  the numbers is showing up and looking nice every where in civicrm. But I have added them to a profile that shows up in the User account page. But on that page the number is totaly different 2147483647.

I have tested some more and I see a connection with the number lenght.  1907120324 seemse to show up correct but if I ad one digit (19071203241) it shows up as 2147483647.

I have Drupal 5.2 and CiviCRM 1.8.beta.10790

I will try contact you later on IRC
« Last Edit: August 30, 2007, 01:22:09 am by haggan »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Swedish Personal identity number (Sweden) Personnummer - Field with validati
February 27, 2008, 01:33:04 pm

wim posted an issue regarding this and it is now fixed in 2.0 :)

http://issues.civicrm.org/jira/browse/CRM-2750

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Status of the custom datatype validation rule ?
February 27, 2008, 11:23:35 pm
Has it already found its way on 2.0 ?

Otherwise, still sound like a nice idea indeed (suggestion: putting a place where we can share custom datatype, eg an IBAN validator)
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Swedish Personal identity number (Sweden) Personnummer - Field with validati
February 27, 2008, 11:47:24 pm

part of 2.0 :)

http://issues.civicrm.org/jira/browse/CRM-2480
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Swedish Personal identity number (Sweden) Personnummer - Field with validation

This forum was archived on 2017-11-26.