cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate space between names for validation in MDM

former_member245533
Participant
0 Kudos

Dear Experts,

I have one requirement as below:

In MDM customer master, I need to write a validation for Customer master name. The requirement is to calculate the space between names which can not be less than 0 (zero) and not greater than 1 (one).

Is it possible to achieve this through validation, please guide me for this.

Regards

Shailendra

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shailandra,

If you want to validate the spaces in a Text field such as Customer Master Name, you can achieve the same with the below validation expression.

IF(HAS_ANY_VALUES(Customer Name,"  "),False)

In the above expression give double space inside the quotations ("<Space><Space>")

Now when ever their is a double space in your Customer Name, the validation will throw error.

Your question regarding the space being NOT less than "0", I do not think it is possible because the system will never know where it is required to provide a space.

Regards,

Prasad

former_member245533
Participant
0 Kudos

Hi Ganapathi,

Thanks for your reply. I have done it on Development and its working. but could you please tell me if I can add date of creation also in the same validation i.e. if record is created before 01 April 2012, then this check will not applicable. Or this check will be applicable only those codes whih are created after 31 March 2012.

Awaiting your reply

Regards

Shailendra

Former Member
0 Kudos

Hi Shailendra,

Please test the below Expression and let me know if it works.

IF(Create Date < "YYYY:MM:DD:00:00:00:000",TRUE,FALSE)

You can group both the Validation expression and run it together.

Kindly update if this works for you.

Thanks and Regards,

Prasad.

former_member245533
Participant
0 Kudos

Hi Ganapathi,

Thanks for your reply.

I have written the code as following:

IF(Create Date <"2012:04:01:00:00:00:000" AND HAS_ANY_VALUES(Name1 *, " "),TRUE,FALSE)

While changing the Name 1 in customer code by giving more space or reducing space, its not triggering the error. OK.

But while changing Name 1 in customer which are created after 01:04:2012, its giving error even I am removing space, or giving single space.

For e.g. AAAA BBBB CCCC is the name of customer. If I am writing as AAAABBBB CCCC, then its populating the error which should not be. If I am writing as AAAA BB BB CCCC, then again its populating.

Can you please help me in this case.

With Regards

Shailendra

Former Member
0 Kudos

Hi Shailendra,

Can you try writing two different validations and then group them and run the validations as a group?

IF(Create Date <"2012:04:01:00:00:00:000" AND HAS_ANY_VALUES(Name1 *, " "),TRUE,FALSE)

But while changing Name 1 in customer which are created after 01:04:2012, its giving error even I am removing space, or giving single space.

Your expression says that if the created date is before 1st April 2012, then DO NOT Throw any error, and if the record is created after 1st april, then throw error. Also if you observe, Has any values syntax in your expression says that if the name has any double space then True, meaning Do not throw error.

as said, please try by creating two seperate validations and then running them as a group, this way it will help you to understand which validation is working fine and which is not.

Rgds,

Prasad


former_member245533
Participant
0 Kudos

Dear Ganapathi,

Thanks for supporting me and suggesting me a right path to write a validation. I have written validation as per below and the requirement got full-filled.

IF(Create Date >="2012:04:01:00:00:00:000" AND HAS_ANY_VALUES(TRIM_RIGHT(Name1 *), "  "), FALSE, TRUE)

Thanks and the thread is closed now.

Regards

Shailendra

Answers (0)