Announcements
No record found.
When say x or y values are opted on A lookup field on the web page form than B field should be required. How can we achieve this using ASP code
*This post is locked for comments
Hello sandy,
You can use business rule for making field required on your condition.
Please check below link for creating business rule
www.powerobjects.com/.../become-pseudo-developer-business-rules-crm-2013
Best Regards,
Shahbaaz
Hi Sandy,
Are you looking for suggestion on Dynamics 365/CRM or asp.net? If DYnamics 365/CRM then use business rules.
Refer this.
www.crmsoftwareblog.com/.../microsoft-dynamics-crm-business-rules-needs-required-fields
Hope this helps.
if you are trying to do this by ASP code then i don't think this is possible, instead you can write java script code.
looking for ASP.net
i think you posted the same question yesterday also right? can you brief about your requirement so we can provide you solution.
Sorry but this forum if for DYnamics 365/CRM. You can post your questions on ASP.Net forum to get the relevant suggestions-
https://forums.asp.net/
www.c-sharpcorner.com/forums
I apologize i have confused with requirements my requirement is to make field mandatory on web form hosted on server when other input field value is selected. It it can be done with javascript please help me out.
Please check below code
// keep this funciton on lookup on change event
function onchangeeventoflookup() {
//get the lookup value namevar lookup = Xrm.Page.getAttribute.("schemanameoffield").getValue(); if(lookup != null && lookup[0] != null) { var name = Xrm.Page.getAttribute.("schemanameoffield").getValue()[0].name;
if(name=="test") {
Xrm.Page.getAttribute("schemanameoffield").setRequiredLevel("required");
}
else
{
Xrm.Page.getAttribute("schemanameoffield").setRequiredLevel("none");
} }
Make sure you provide proper schema name of lookup field as well as schema name of field that you want to make mandatory.
If you find it helpful, please mark my answer as verified.
Thanks,
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
ScottDurow 2
GJones 1