Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solve] Validation with Business Map
#1
I did try understand how I can implement,  this important resource in coreBOS.

I try created 4 business map in demo online, at leads module

1) Checked a pick list not use a default value

<map>
 <originmodule>
   <originname>leads</originname>
 </originmodule>
 <fields>
   <field>
     <fieldname>leadsource</fieldname>
     <validations>
       <validation>
         <rule>notIn</rule>
         <restrictions>
         <restriction>--None--</restriction>
         </restrictions>
       </validation>
     </validations>
   </field>
</map>

2) Checked a phone number is only numeric

<map>
 <originmodule>
   <originname>leads</originname>
 </originmodule>
 <fields>
   <field>
     <fieldname>phone</fieldname>
     <validations>
       <validation>
         <rule>numeric</rule>
         <restrictions>
         <restriction></restriction>
         </restrictions>
       </validation>
     </validations>
   </field>
</map>

3) Checked a new date field, is after a date of modified

<map>
 <originmodule>
   <originname>leads</originname>
 </originmodule>
 <fields>
   <field>
     <fieldname>cf_846</fieldname>
     <validations>
       <validation>
         <rule>dateAfter</rule>
         <restrictions>
         <restriction>{{modifiedtime}}</restriction>
         </restrictions>
       </validation>
     </validations>
   </field>
</map>

4) Checked is a new custom field, not duplicated in data base

<map>
 <originmodule>
   <originname>leads</originname>
 </originmodule>
 <fields>
   <field>
     <fieldname>cf_847</fieldname>
     <validations>
       <validation>
         <rule>notDuplicate</rule>
         <restrictions>
         <restriction></restriction>
         </restrictions>
       </validation>
     </validations>
   </field>
</map>

But not working.

I did try read documentation again, and duplicated a demo business map, but not successful.

What I do wrong?
Ranieri
eCRM Web
Reply
#2
The first thing I do when an XML map does not work is pass it through a validation:

https://www.xmlvalidation.com

I just tried your first map: check_leadsource and got this error:

17: 3 The element type "fields" must be terminated by the matching end-tag "</fields>".

I added that and it worked
Joe
TSolucio
Reply
#3
The other ones seem to have the same problem. Please try fixing those yourself and let me know how it goes.
Joe
TSolucio
Reply
#4
Yes, I correct and all business map works fine!

By the way, the mistake in the example, in doc page ... Sad

"..."
The other is using business map validations: http://corebos.org/documentation/doku.ph...alidations
Look at the cbCalendar activitytype example
"..."

And I think better ideia, post a link for xml validade too.
Ranieri
eCRM Web
Reply
#5
I fixed the documentation error: thanks!

and added a comment on the validator:

http://corebos.org/documentation/doku.ph...s_mappings
Joe
TSolucio
Reply
#6
Leadsource system translate right to pt_br, but industry not ...

and how i can get a test more complex, for example, if country is setting to Brazil test a valid phone format in Brazil, but if not Brazil, test a valid format number for international number

And another good tool is a regex validator http://tools.lymas.com.br/regexp_br.php#

In item 3 I wish follow up not in past. There any special function or word to do that?

I try use a datemodified but not working ( I think is different format too )


Attached Files Thumbnail(s)
   
Ranieri
eCRM Web
Reply
#7
=> translation: I could not reproduce, it is working correctly for me

=> use a custom validation script

=> regexp are already supported

=> try with dateBefore/dateAfter
Joe
TSolucio
Reply
#8
@ => try with dateBefore/dateAfter

but how I set dateAfter today?

=> regexp are already supported

ok, I know, I suggest a validation site, only for testing proposes
Ranieri
eCRM Web
Reply
#9
I need two more examples

1) For I set a mandatory field, testing a value of another field - example - two custom fields, if client wish a financial for project, CNPJ ( vat number in Brazil ) is mandatory

2) Set a regex different, when testing another filed - example, regex for Brazilian phone, if country is Brazil
Ranieri
eCRM Web
Reply
#10
But the message shown in error case, not is translated for me.

This message in correct language for you, too


Attached Files Thumbnail(s)
   
Ranieri
eCRM Web
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)