How to Validate following field using presave function? - sharepoint

I'm trying to validate "Email" and "Approval" Field to have information before user submits it. How can I use presave function to check for the validation?
Here is my SP form
Thank you

Have you consider to use list validation?
Fake formula:
=IF([Field]="condition",IF(AND(NOT(ISBLANK([Email]),NOT(ISBLANK([Approval])),TRUE,FALSE),TRUE)
If list validation can't meet your requirement, then, you may consider to use PreSaveAction

Related

What is custom asynchronous validation function in strongloop?

Can you please explain the meaning and use of validateAsync function of strongloop.enter link description here
It's used to validate the name property on the User model in the example. It checks if the provided name is equal to "bad" and returns an error if it is. The example also shows you how to validate using the async and sync styles.

Is there a way to create a composite primary key on a NetSuite custom record?

Is there a way to create a composite primary key on a NetSuite custom record?
I know that is possible to simulate the behavior on an user event script, but I'm looking for the best practice approach here. Maybe a way to define it using SuiteBuilder.
I also know I could trick the "externalid" field to achieve the same results, but is not the real purpose of this field. The concatenation would be a problem too.
Thanks in advance!
The NetSuite team contacted me, it turns out it is not possible to define a composite key on SuiteBuilder.
Anyway, the result can be achieved in other ways, like merging all the values in one big string, or creating an user event script to validate the fields before save.

How to create Projection based on other content type value in Orchard

I am trying to use Projection Query in orchard to filter my Projection based on the current Page. Right now I have a contentItem with a field called PageName which I am trying to match the value of. Can this be achieved using projections? I know that Tokens doesn't work in this scenario. What would be the best step of achieving what I am trying to do?
The tokens is well suited for this scenario.
Get current content item by token:
{Request.Content}
Get field by token:
{Content.Fields.YourPartName.PageName}
By combining these two tokens you can get what you need:
{Request.Content.Fields.YourPartName.PageName}
You can find token 1 and 2 in the drop-down list of tokens when you edit query filter.

Sails model validation only when updating and not while creating

While using sails validation I need some fields only to get validated while updating and not during creation. The scenario is that when the user is getting creating the i am just taking username and password and later I ask for all the remaining data for the user and I need to apply some validation rules only during updation and not creation.
I know I can do some manual validation using lifecycle callback beforeUpdate but then I wont be using sails validation which I think is not the proper way.
How can tell the model that these rules need to be applied only during updation?
what rules specifically? One thing you can do is give the rules a true/false check to see if the record has as an Id. If it does, then its an update, if it does not, then its a create.
favorite_color : {
required : function(){
return 'id' in this // ID should be your primary key field.
}
}
I will say it would be nice if you could specify when validations occur, but currently you can not.
You may split DB entity into two separate entities and use two models. First model will require username and password and second model will require other fields.

Hide value on Jersey GET method

Using Jersey's GET, is it possible to return an entity with only some fields? so others will not be displayed to the user? E.g. if I have an entity with personal information, can I return only the information which is not private as passwords?
You should hide this field manually in control layer. Or you can code some DTOs, This is better to .

Resources