I am trying to load values into VF input box based on the account selected from popup.
<apex:pageBlockSectionItem id="pageblocksectionitem5">
<apex:outputLabel value="Account Name"></apex:outputLabel>
<apex:panelGroup style="border: 0px solid Blue;" >
<apex:outputPanel layout="inline" style="background-color:#CC0000; padding-left: 3px; position: absolute; margin-left: 0px; margin-top: 2px; margin-right: 0px; height: 20px; border: 0px Red; " ></apex:outputPanel>
<input type="text" name="AccountName" id="Input12" style="margin-left: 5px; " /><img src="/s.gif" class="lookupIcon" onClick='window.open("/apex/xyz,"width=600,height=400,left=150,top=200,toolbar=1,status =1,");'/>
</apex:panelGroup>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pageblocksectionitem3">
<apex:outputLabel value="Linea"></apex:outputLabel>
<apex:outputLabel value="{!linea}"></apex:outputLabel>
</apex:pageBlockSectionItem>
I need to populate linea from the custom field linea__c which is from Account object.. I can query to get the field value. But i need it to happen immediately after the account is selected. How can i do it?
Any pointers would be great...
Thanks
You'll need JavaScript actions... In fact probably best will be action and rerender attributes of most tags you'll see in the Visualforce Component Reference.
Please also have a look at this tutorial: http://wiki.developerforce.com/index.php/Force.com_Tutorial:_An_Introduction_to_Visualforce, especially part above the "Tutorial: Web Applications In A Jiffy". Similar thing (restructured to form new Cookbook: http://developer.force.com/cookbook/recipe/using-ajax-in-a-visualforce-page)
Last but not least - the Visualforce Developer Guide documentation PDF might be interesting for you - the chapter about "Creating a Wizard" (page 98 in the PDF) will be a nice (but a bit too full blown) example.
Related
We are new to Salesforce and we are trying to implement Quick action buttons in HTML Email templates of Salesforce.
Our scenario is -
When an opportunity is submitted for approval, we are sending an email to approvers. This email is generated using an Email Template, which has some text and a couple of links. Approvers receive this email and clicks on the reply button and then reply with 'Approved' or 'Rejected' words which are sent to Salesforce and opportunity is approved or rejected accordingly.
What we are trying to achieve? -
Instead of approvers replying by typing 'Approved' or 'Rejected' manually, we want to have Quick action buttons on the bottom of the email, upon clicking on them, it should type the text automatically as the reply. Please see the screenshot.
What we have already tried? - In our Salesforce email approval HTML template, we have added the HTML code for buttons and applied Javascript in them to create a response, the code is below. We are getting error - Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src xyz.com 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
<input type="button" style=" font: bold 11px Arial;
background-color: #4BCA81;
color: white;
padding: 5px 6px 5px 6px;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #CCCCCC;"
class="button" value="Approve" onclick="generateReply('Approved')"/>
<input type="button" style=" font: bold 11px Arial;
text-decoration: none;
background-color: #E1553C;
color: white;
padding: 5px 6px 5px 6px;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #CCCCCC;" href="https://cgdstudios2017--
pdg.lightning.force.com/apex/RejectDeal?id={!Opportunity.Id}"
class="button" value="Reject" onclick="generateReply('Rejected')"/>`
The output that we are able to generate as Email is
Please let us know if anyone has any idea about it. Thanks in advance.
Currently, I am working with a reactjs web application and it has many dropdowns throughout the application, the normal dropdown (select) approach doesn't work because the options to select are dynamically loaded from react dropdown component, but for the moment I tried to sort out by using keystroke like this:
#browser.text_field(name: "countries").set("Germany");sleep1
#browser.text_field(name: "countries").send_keys :enter
I am writing into the textfield and wait until the expected text appears then use the keystroke.
Below is the HTML, I know it doesn't help to any extent:
<div class="Select-input" style="display: inline-block;"><input name="countries" data-test-id="countries" autocomplete="0" aria-activedescendant="react-select-7--value" aria-expanded="false" aria-haspopup="false" aria-owns="" role="combobox" value="" style="box-sizing: content-box; width: 5px;"><div style="position: absolute; top: 0px; left: 0px; visibility: hidden; height: 0px; overflow: scroll; white-space: pre; font-size: 16px; font-family: "Open Sans", sans-serif; font-weight: 400; font-style: normal; letter-spacing: normal; text-transform: none;"></div></div>
However, I see this is not the best solution any suggestions or solutions would be very helpful.
You need to pass the enter key upon that option not on the text field. May be something like this.
#browser.text_field(name: "countries").set("Germany");sleep1
#browser.element(text: "Germany").send_keys :enter
You don't need to pass the enter key to be more specific, you can trigger the click instead.
#browser.text_field(name: "countries").set("Germany");sleep1
#browser.element(text: "Germany").click
I have created a feature in my application wherein one can copy contents of an existing invoice to create a fresh new invoice. All other fields are getting copied. But the field 'note to customer' isn't getting displayed somehow. I've used text angular for adding a 'note to customer'.
<div layout="row" flex>
<div flex-xl="" ng-if="documentEntity.noteToCustomer"
ng-click="noteToCustomer($event,documentEntity.noteToCustomer)"
style="border: 1px solid rgba(0, 0, 0, 0.12); background-color: #fdf7f7; padding: 15px; border-width: 2 0 1px; line-height: 26px; width: 100%; box-sizing: border-box; float: left;"
class="flex-xl" ><span ng-bind-html="documentEntity.noteToCustomer"></span></div>
</div>
What might be the issue here?
text angular directive is missing in above
<div text-angular flex-xl="" ng-if="documentEntity.noteToCustomer" ....>...</div>
add a plunker for clear understanding..
In the documentarion of textangular, something is said about using ng-bind-html. Try using ta-bing instead.
please help me that how to put star mark as mandatory field for account number,type ,industry,as mention in the given code.As I already tried but it is coming on the top of the form.please help me.I have already created style class and fields in account object .
In Visualforce if you are using apex:inputField you can use the built in required attribute to render the appropriate red bar in the HTML/CSS. Most other input controls also have the same attribute. E.g.
<apex:inputText value="{!inputValue}" id="theTextInput" required="true"/>
You can also manually include the required elements to get the same effect.
<apex:outputPanel layout="block" styleClass="requiredInput" >
<div class="requiredBlock"></div>
<apex:inputField value="{!someBinding}" label="The Label"/>
</apex:outputPanel>
Incidentally, the Salesforce Stackexchange is a great place to ask Salesforce specific questions.
Here is the CSS to change the default 'red Bar' to 'red Asterisk' in front of each required field:
.requiredInput .requiredBlock {background-color: transparent; }
.requiredInput .requiredBlock::before { display: block; content: "*"; font-size: 1.5em; font-weight: bold; color: #c00; margin-left: -4px; margin-top: -2px; }
Add the above CSS in your page.
Hope this helps :)
I have a table that has a corresponding value for each birthday - all 366 of them when Feb 29th Included. I need to make a webpage with a script that has a date field picker where it opens a result page from that date for the corresponding value. What is the easiest framework to accomplish this...I have almost zero php and js experience but feel like that may be what is necessary to build it. Any suggestions? The attached code is a very very preliminary bare bones shell page for this frontend, but I don't know where to go from here.
<!DOCTYPE html>
<html>
<style media="screen" type="text/css">
* {
padding: 0;
margin: 0;
}
body {
background-color: black;
font-size: 12pt;
font-family: "Times New Roman", serif;
font-weight: bold;
color: #fff;
vertical-align: top;
text-align: center;
margin: 0;
padding: 0;
}
h1, h2, h3{
text-align: center;
font-weight: bold;
font-family: Verdana, sans-serif;
}
img {
border-style: none;
background-color: transparent;
}
</style>
<body>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<form action="demo_form.asp">
What is your Birthday?: <input type="date" name="bday">
<input type="submit">
</form>
</body>
</html>`
You probably will need both PHP and Javascript. Unfortunately stackoverflow is not a tutorial site, so you will have to start learning both languages yourself at least upto the level where you are able to do what you want to do. http://www.w3schools.com/js/ and http://www.w3schools.com/php/ are good starting points.