function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SarikaPSarikaP 

I want to write a script on visualforce page where if an Opportunity is created with a specific billing country an alert popup should appear

Hello,

Here it is:

 if({!CONTAINS("AUSTRALIA:FIJI", UPPER(Opportunity.Account.BillingCountry ))} || ({!Opportunity.end_user_account__r.BillingCountry } != null && {!CONTAINS("AUSTRALIA:FIJI", UPPER(Opportunity.end_user_account__r.BillingCountry ) )}))
  {window.alert("Test message"}
  }

Its not working. Above script states that for any opportunity having Account Country or End User Account Country (End User Account is a lookup Account field at Opportunity level) Australia or Fiji, alert pop up should appear.
In addition to this, it should popup only if the opportunity is just created.

Thanks
ShirishaShirisha (Salesforce Developers) 
Hi Sarika,

Greetings!

Can you please find the sample code in the below document and make changes to the business logic:

https://developer.salesforce.com/forums/?id=906F000000097X9IAI

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
 
SarikaPSarikaP
Thanks Shrisha. But what I am trying to add is script in javascript itself, so the above will not help.