Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Skip a Web Form Step depending on some condition Dynamics Portals

Posted on by Microsoft Employee

Hi All,

I have multiple Steps in a Web Form.

First Step is to create contact.

Next Step is to create another record type.

In First Step of Contact Creation i want to check if contact email is already present in CRM then Skip this Step instead of show duplicate message and move to next step.

Can anyone suggest how to do this?

I tried it using below Jquery but was unable to get method to move to next step.

$(document).ready(function() {
	$('#NextButton').on('click', function (e) {
		alert("button was clicked");

		var emailAddress = $('#emailaddress1').val();
		if(emailAddress === null || emailAddress === ""){
			alert("Please provide an email");
		}
		else{

			var oDataUrl  = "/_odata/contacts?$filter=emailaddress1 eq '" + emailAddress + "'";
			var oDataResponse = getODataResponse(oDataUrl);
  
			if(oDataResponse != null && oDataResponse[0] != null && oDataResponse[0].emailaddress1){
				WebFormControl.MoveToNextStep();
			}
		}
	})
});

function getODataResponse(oDataUrl) {         
	var response = null;
    $.ajax({
		type: "GET",
        url: oDataUrl,
        dataType: "json",
        async: false
        }).done(function (json) {
			response = json.value;                       
            });                
		return response;
	}


*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Skip a Web Form Step depending on some condition Dynamics Portals

    Did you found any solution for your question?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Skip a Web Form Step depending on some condition Dynamics Portals

    Anyone??

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans