Business rule default value for domain based attribute

Unanswered Business rule default value for domain based attribute

  • 23 aprilie 2012 08:59
     
     

    Hello,

    I'm just dipping my toes into MDS to see what it can and can't do. Is it possible to create a Business Rule that sets a default value for a domain based attribute of an entity?

    I have two entities - Users and Validation Status.

    Validation Status has 4 members - New(1), Pending(2), Rejected(3) and Approved(4)

    Users has a domain based attribute (also called Validation Status) based on the entity above.

    I would like to create a simple business rule to set the Validation Status of a new member of the Users entity to New(1).

    This does not work. When the the new Users member is created the Validation Status attribute is blank.

    I have no other business rules so priority isn't an issue. I am able to successfully create a default for a normal free-form attribute.

    Is there anything I am missing or is it just not possible?

    Many thanks for any illumination you can provide,

    Ash

Toate mesajele

  • 30 aprilie 2012 07:44
     
     

    Hi Ash

    After you create and save business rules on an entity you must also publish them. Once you have saved the rule, click the back button (looks like a green arrow pointing to the left) to go back to the list of business rules on that entity. The rule you just created should show up with a status of Activation Pending (or something of the sort). Click the second button above the list of rules to publish your new rule. Be sure to not provide a value for ValidationStatus when saving a new member in the Users entity. The value should be defaulted when business rules are run after you click OK.

    Arun


    Arunjeet Singh (Microsoft SQL Server Master Data Services)

  • 30 aprilie 2012 07:49
     
     

    Hello Arun,

    Thanks for the reply.

    I should have said that I did publish the business rule and entered a new member in the Users entity, inly completing the Name and Code attributes i.e. leaving the Validation Status blank.

    I tried this several times (delting the rule, recreating it and publishing it anew) and have not been able to get it to work.

    From your reply it seems that what I am trying to do is possible (as it should be!). So clearly I amd oing something wrong. Any other bright ideas?

    Thanks for your time,

    Ash


    Ash

  • 30 aprilie 2012 13:52
     
     

    Ash,

    In your business rule condition section, try putting something in there that will evaluate to 'True'.  something like 'ValidationStatus = null' or something like that.  It looks like your current condition statement is empty which may contribute to your issue.

     

    Gene

  • 30 aprilie 2012 14:40
     
     

    Hello Gene,

    Thanks for your reply. I've tried the amendment you suggest as this:

    Unfortunately this doesn't work either. Please let me know if this is not what you meant or if I have done something wrong.

    Thanks so much for your time,

    Ash


    Ash

  • 30 aprilie 2012 21:47
     
     

    This is strange. I see no reason why what you were trying to do in the first place shouldn't work. Could you:

    1. Confirm that you are using SQL Server MDS 2012

    2. Remove the rule

    3. Turn on trace logging (http://support.microsoft.com/kb/2423478).

    4. Create the rule and publish it

    5. Try creating a new member with an empty validation status

    6. And then put up the log or send it to me.


    Arunjeet Singh (Microsoft SQL Server Master Data Services)

  • 1 mai 2012 08:51
     
     

    Hello Arun,

    Thanks again for your reply.

    I am using SQL Server MDS 2008 R2. I should have said this in my initial post. Is that the issue?

    I followed your advice and have created an MDS Trace file. How can I either post the file to this forum (I searched the wiki but could find no advice on this) or e-mail you (can't seem to find your address)?

    Thanks so much,

    Ash


    Ash