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
Bhoomi PatilBhoomi Patil 

how to create JavaScript onclick custom button which displays Waring message 'as no invoice attached ' which allows user choice to either ignore the warning and click OK

Hi,
I am wiritng code for custom button JavaScript Onclick funcitonality.
Scernario :when i click Custom button,  it should display warning message as 'No Inovice is created' provided when invoice is not created in   Quick action of this page'. Than  user is given two choices , Pop up mesage opens 
i) user can ignore the above message  and Click ignore  and then  clik the final  submit button on the page.
ii) user shd click Ok  and create the Invocie number from the quick action and then click the final  submit button.
So far i was able to create lighetning component 'Submit Button' with aura component. 
Note:Enter funtionality shd work on lighetning page only.

the above funtionality in classic am aware .But using javascript functionality on lighetihng is something very new to me.
Any help would be appreciated.

 

Thanks in advance

 

Timothy Gentet O'BrienTimothy Gentet O'Brien
You cannot use Javascript buttons with Lightning, you would be better off creating a Visual Workflow, which you can then call using a Quick Action. You can also tirgger the Flow using a URL Button as well.

In the Flow you would need to run a "Fast Lookup" to query if there are any Invoices that have been created. You would then use a "Decision" to check and see if the Fast Lookup has returned any data, if it has not display a "Screen" which has the warning on it, on the Screen I would recommend putting a checkbox on it to say they confirm they want to continue in the absense of an Invoice, then you can continue to do whatever you like after that.