Standard button on custom object on salesforce - salesforce

I have installed Docusign in salesforce. The button in opportunity works but my custom button on a custom object doesn't work.
My button is standard
:{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")} DocuSign_CreateEnvelope();
I have the error:
A problem with the OnClick JavaScript for this button or link was
encountered:
unterminated string literal

Try it without the ':' thus resulting in
{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")} DocuSign_CreateEnvelope();

Related

Button input type in Azure AD B2C

How to insert Userinputtype 'button' from custom policy?
and how to handle the 'button' click on that?
I want to execute a technical profile on the button click.
I saw the button type is available for user input type in below documentation,
https://github.com/Azure-Samples/active-directory-b2c-advanced-policies/blob/master/Documentation/Features%20part%206.md
You should just be able to submit it as:
<UserInputType>Button</UserInputType>
Here's a good example: https://github.com/Azure-Samples/active-directory-b2c-advanced-policies/blob/master/Migration-JIT-sample/B2C_1A_Demo_Base.xml

AngularJS: invalid input is not styled as invalid until I click on the input field and click out of it

I am setting input field to invalid from javascript like this:
$scope.formName.fieldName.$setValidity("string", false);
This is working, but it affects the view only after clicking in a input field and then clicking out of it.
How can I change it in order to see the invalid field immediatelly?
You'll need to attach an ng-change="checker(model)" to your input field. Then just apply an ng-class to it to check for formName.fieldName.$error.string (since you put string as the error key) or you can also do formName.fieldName.$invalid && !formName.fieldName.$pristine
I've attached this codepen for you to play around with and see how to apply an invalid class on the field without having to lose focus on it.
Hope that helps!

Google tag manager button reference

I'm trying to get google tag manager to track a couple of different buttons on a site. We're currently unable to change the site to aid with this, so we have to find a solution solely with tag manager.
There are several buttons on the site all with the same format as to the two below.. they all have "submit" as the type and a unique term for value so I'm trying to use the tag manager Form Listener which picks up on type="submit". Is there any variable I can use to pull the value field into my event so I can create individual goals in analytics?
etc etc
Any help is greatly appreciated.
You can use built-in variable "Click Element", then create custom JS-variable:
function(){
try{
return {{element}}.getAttribute("value"); //I am not sure now if it is {{element}} or {{Click Element}}
}catch(err){}
}
This will give you a value attribute of clicked button.
Maybe a useful link by Simo Ahava:
http://www.simoahava.com/analytics/track-form-engagement-with-google-tag-manager/#3
You can use built-in auto-event variable Element Attribute to get value. And be sure to use click tracking and not form tracking, because you want to track button clicks and not form submissions.

ui-bootstrap popover-trigger expression breaks in version 2.0.0

In ui-bootstrap 1.3.3 I had a button with a popover and the following trigger
popover-trigger="click outsideClick"
The trigger opened the popover when I clicked the button and closed it when anything else was clicked
In ui-bootstrap 2.0.0 this popover trigger fails on
Error: $parse:syntax
Syntax Error
Syntax Error: Token 'outsideClick' is an unexpected token at column 7 of the expression [click] starting at [{4}].
Trying both
popover-trigger="click" and
popover-trigger="outsideClick" seems to work but it's not the behavior I require.
Going over their latest change-log I couldn't find any mention of this. How can I correct this?
The docs say that popover-trigger accepts an expression but turns out it also accepts a string, all I had to do to properly concatenate the triggers was to apostrophe them in the expression
bad:
popover-trigger="click outsideClick"
good:
popover-trigger="'click outsideClick'"
And it all works again as it should

click method is not working properly in selenium webdriver

i am trying to Automate flipkart website in which i am trying to change address but "add new adress" is not getting clicked i have attached the snapshot
my code is like driver.findElement(By.xpath("//*[#id='ng-app']/div/div[2]/ul/li[2]/div/div[2]/div[2]/div[2]/a/span")).click();
please give the appropriate help
I doesn't look that you are clicking active element, the xpath is //*[#id='ng-app']/div/div[2]/ul/li[2]/div/div[2]/div[2]/div[2]/a/span not correct it clicks on some span.
Use Firepath https://addons.mozilla.org/en-US/firefox/addon/firepath/ to get the xpath.
To ensure that button is clickable Use isDisplayed() and isEnabled() method before clicking on "Add New Address" button, this method return boolean value.
driver.findElement(By.xpath("//*[#id='ng-app']/div/div[2]/ul/li[2]/div/div[2]/div[2]/div[2]/a/span")).isDisplayed();
driver.findElement(By.xpath("//*[#id='ng-app']/div/div[2]/ul/li[2]/div/div[2]/div[2]/div[2]/a/span")).isEnabled();
Also you can verify that element is exist on page or not using below code
if(driver.findElements(byVal).size()!=0){
// Element is present.
}
hope it may helpful to identify cause of issue, why its not clickable.
First and foremost, Use a customized Xpath instead of the one you are using which is extracted directly from the browser. If no customized Xpath can be constructed then try a customized Css or any other locator if possible.
Try to go through the following attempts in order (I hope you can grasp why this is):
1- If .click() still doesn’t work, then keep on changing the values of the attributes you are using to construct your customized xpath, cssSelector, or locator.
2- Use the Actions class.
3- Use JavaScript executioner
4- instead of click(), try using any of: .sendKeys(“\n”). Or .sendKeys(keys.ENTER) or .sendKeys(keys.RETURN)

Resources