Create a business rule in MDM 2012 that tests the Sum of attributes of an entity - business-intelligence

I have created an entity on MDM 2012 and I like to create a business rule that tests if the SUM of 3 attributes is 100.
I didn't find a way on the Action Panel to use arithmetic operators or simply a SUM function.

Not sure we can perform this directly or not but yes we can use custom user defined script to validate Sum of attribute values=100 or anything
try follow these steps -
Step#1
Creating a business rule with custom extensions in MDS; for that create a user define function in SQL to validate sum of 3 or 4 parameter is 100 or not
e.g.
make sure function created under USR schema and RETURNS BIT
Step #2
Create Business Rule & select function created in step#1 as Operator
Make sure to click somewhere inside the parameter box. This will change the layout and allow you to assign an attribute to the parameter of the user defined script.
Step #3
What to do if condition met or not met
like
Reference Business Rules Extension in MDS

Related

Add or Edit relation fields in Content Manager of Strapi

I am building a simple recipe website by Strapi. Now I want to make one Recipe has so many Ingredient. Therefore, there are two collections, They are in Many way relationship (Since I don't need to point back or link back to Recipe)
However, in Content Manager, I have to create some Ingredient items before creating one Recipe.
Is it possible to create or edit Ingredient while create Recipe in the same page?
Yes, this is possible using components in strapi. So basically, you'll need to create a Recipe collection and Ingredient component, and link to the component to Recipe collection as a repeatable component. So this way when you create a Recipe entry, you'll be able to add/edit the ingredients entries on the fly.
Have a look at this link to learn how to create a component.
Once you've created the component, follow the steps below to link it to the Recipe collection:
Edit the Recipe collection and add an existing component.
Set the component as a Repeating component.
Your model configuration should look similar to this.
Save the changes to the Recipe collection and then try creating an entry. You'll be presented with the following user interface that lets you edit/add ingredients on the fly.
Publish the entries and hit the find API will the populate key in URL like so:
http://localhost:1337/api/receipes?populate=ingredients

Tableau action filter not working issue

As per my experience - In tableau for action filter to work the fields should meet two criteria.
1. Field should be a dimension.
2. Field has to be from same data sources. Blending and action filter dont work together.
Am I correct in saying that?
Yes, you are correct that is generally the rule of thumb. But, there are a couple of workarounds, however.
Method 1: Create a custom parameter and use it in a calculated field
Method 2: Create a control view for the field you want to filter on, and apply a filter action to that view on the dashboard
This is a link to a knowledge base article that details both methods mentioned.

How can I prevent users from editing the OpportunityLineItem records in Salesforce.com?

I need a validation rule that prevents certain users from editing the OpportunityLineItem records.
I'm assuming that I will need to compare the LastModifiedDate value.
Any help is greatly appreciated.
Cheers!
Friday
You might want to look at the special fields available in formulas that begin with dollar sign. Roughly speaking they depend on who is looking at the data and aren't related to the record itself. They contain basic running user's info, his session id etc.
Example validation rule could look like that:
OR($Profile.Name = 'Marketing User',
$UserRole.Name = 'IT',
$User.Title = 'Contractor'
)
This should get you started if you can easily distinguish your "certain users" by Role, Profile or for example some checkbox you'd put on the User record that would be editable only by sysadmins.
If your logic is more complex (dependent on being a member of some group for example) - you'll have to write a trigger I believe.
Keep in mind that validation rules don't fire on record delete! If this is a concern there are 2 ways to solve it:
sane way: to remove the right to delete Opportunities (because Opp. Products "inherit" this permission from Opportunities) from most Profiles and then apply it to selected users with Permission Set
hacky way: delete of product will cause some rollup recalculations on the Opportunity (for example Amount field). So build a similar rule to the one you'll have on Opp. Line Items and attach && ISCHANGED(Amount) to it.

ASP.NET MVC 3 Pattern for dynamic validation attributes including client side

My validation requirements for a the fields in a form are contained in an external table so that they can be updated without altering and rebuilding the code.
I have approximatley 100 fields with a mixture of validation requirements - range, required, regular expression and dependency on other fields. One example is date range validation. A date of birth field requires a date range which is between -10 years and -50 years of the current date.
I have read around the subject but have not identified a pattern for the complete solution.
I am using Visual Studio 2010 with MVC 3 and Entity Framework.
Any help with this would be gratefully received. Thanks in advance.
In a simple level I think you can still use the built-in Data-Annotations validation attributes to does the validation and for that you should map the validation rules stored in the table to the attributes.
I think all you have to do is create a custom model validation provider by inheriting the class ModelValidatorProvider. This class contains a single method called GetValidators that returns the collection validators for that model.
You have to implement the GetValidators method and in there you have to make a database call to get the validation rules for the model from the database (or from cache?) and convert them into ModelValidators. You could still use the built-in DataAnnotationsModelValidator to do the validations.
I would suggest you to look into the source code of DataAnnotationsModelValidatorProvider that will give you all the information. In that class what they are doing is basically iterating all the validation attributes applied to the model properties and converting them into ModelValidators through adapters and factories. In your case instead of attributes they are stored as records in tables and I don't think much work will be there.

Autonumbering in new entity

I have an custom entity which needs to have a case number for an XRM Application, can I generate a case number from the Service -> Case.
If this is not possible, how can I do this with a plugin, I've looked at the crmnumbering.codeplex.com but this doesn't support 2011, anybody outthere have a solution or should I rewrite it myself?
thanks
I've ran into this same type of issue (I need a custom # for an entity). Here's how you can do it:
Create an Entity called "Counter"
Add a field called "new_customnumber", make it a string or a number depending on what you want
Create a new record for that entity with whatever you want in the new_customnumber field (let's say "10000")
Create a plugin (EntityNumberGenerator) that goes out and grabs that record (you'll probably want to set the security on this record/entity really tight so no one can mess with the numbers)
On Create of the "custom entity" fire the plugin. Grab the value in new_customnumber save it to the "custom entity" (let's say in a "case" field) increment the new_customnumber and save it to the Counter entity.
Warning, I'm not sure how this is with concurrency. Meaning I'm not sure if 2 custom entities being created at the same time can grab the same number (I haven't ran into an issue yet). I haven't figured out a way to "lock" a field I've retrieved in a plugin (I'm not sure it's possible).
You will be unable to create a custom number for custom entities from the normal area you set a case number.
Look at the CRM2011sdk\sdk\samplecode\cs\plug-ins\accountnumberplugin.cs plugin. It's really similar to what you want.
Ry
I haven't seen one for 2011 yet. Probably easiest to write it yourself.
I've always created a database with a table with a single column which is an IDENTITY column. Write an SP to insert, save the IDENTITY value to a variable, and DELETE the row all within a transaction. Return the variable. Makes for a quick and easy plug-in and this takes care of any concurrency issues.
The performance is fast and the impact to your SQL server is minimal.

Resources