Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

if conditions on website field through plugin

$
0
0

I want to check the following conditions through plugin :

1.if website field = null then insert google.com into website field

2.if website field = "google.com" then change it to yahoo.com

  if (entity.LogicalName == "account")
            {

                string web1 = "google.com";
                if (entity.Attributes["websiteurl"].Equals(web1)  )
                {
                    string web2 = "yahoo.com";
                    entity.Attributes["websiteurl"] = web2.ToString();
                }

                if (entity.Attributes["websiteurl"].Equals(null))
                {
                    string web = "google.com";
                    entity.Attributes["websiteurl"] = web.ToString();
                }

I have been using this code but its not working...


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>