Can't get data from the task object of salesforce to display in visualforce page - pdf

I am trying to render as a pdf the comments that are associated with a task. I have created a custom button but when I try to get the data to display there is nothing but the field name and I need the text that is stored.
Here is my code:
<apex:page standardController="Task" renderAs="PDF">
<apex:pageBlock id="thePageBlock">
<apex:pageblocktable value="{!task}" var="AC" id="acTable">
<apex:column value="{!AC.description}"/>
</apex:Pageblocktable>
</apex:pageBlock>
</apex:page>
I did not create a controller class and have no idea how to do this. Basically I store a sent email in the comments and want to print it so if that field can show as a pdf I would be set.

modify permissions for field & object on profile & object level.

Related

Create telegram bot Keyboard from JSON file depending on user menu selection

I am creating a telegram bot that requires a dynamic menu to be created depending on the user's previous menu selection. The dynamic menu should pull from a json file and a specific key:value. Required keyboard is the KeyboardButton and NOT an InlineKeyboardButton.
Example: User is presented with a menu that is A-F, G-L, M-R, and S-Z. When they select the button A-F I am looking for a dynamic menu to be built from the json file where Name is sorted from A-F. The user would then select a name from the new menu and information would be presented associated with that name.
I am lost on the dynamic menu portion for the af_menu_keyboard. Other menus are no problem and can retrieve what I need from that json file.
Anyone know how to achieve this?
result = os.popen("curl https://api.mainnet.klever.finance.....")
details = json.load(result)
def messageHandler(update: Update, context: CallbackContext):
if "A-F" in update.message.text:
update.message.reply_text(node_menu_message()),
reply_markup=af_menu_keyboard():
if "Back" in update.message.text:
update.message.reply_text(main_menu_message(),
reply_markup=main_menu_keyboard())
def first_menu_keyboard():
buttons = [[KeyboardButton("A-F"), KeyboardButton("G-L"), KeyboardButton("M-R")],
[KeyboardButton("S-Z"),KeyboardButton("Back", calback_data='main')]]
return ReplyKeyboardMarkup(buttons,resize_keyboard=True)
def af_menu_keyboard():
buttons = **** Create menu with multiple values from the API JSON file above ****
return ReplyKeyboardMarkup(buttons,resize_keyboard=True)

change input field data in vue js

I've signup form. In input field when I used to write previous username then it gives me available username list which is coming from API.
My question is that how to change input field data when I used to click available username in vue js?
I'm thinking you want to do something like...
User types in a username, somewhere in the UI you show a list of available usernames, user clicks preferred username, input box is updated with selected username.
Without seeing any of your code it's difficult to give you an specific answer, however, what I would do is:
Create the input box. Bind this to an object in your script:
HTML:
<input v-model="username"/>
Script: username: string = ""; availableUsernames: [""];
Create a button next to the input box, when it's pressed it calls your API and returns the available usernames and applies to to availableUsernames.
The available usernames are returned as an array and the array is displayed on your UI as a list.
When you click on an object in the list on your UI, this calls a function which updates the username property. e.g.:
<li v-for="u in usernames"><a #click="applyUsername(u.description)">
applyUsername(description: String){ this.username = description }

Can we set the element ID for component created in the code like the ID in application model (e4xmi)?

I created a RCP app with a part. In the part, I created a TreeViewer. Can I set an ID for this viewer so that others plugins can find this viewer by ID? How can we acquire this?
No, you can't do this.
The contents of a part are not in the application model and can't have model ids.
You have to use the findPart method of EPartService to find the part and then call some method that you write in the part object to get the viewer.
MPart part = partService.findPart("part id");
MyPartClass myclass = (MyPartClass)part.getObject();
TreeViewer viewer = myclass.getViewer();

Variable in html code

I'm super new to html
All I need is the code for a field where a User can type his Staff Number and then a button which takes him to a URL that is made up of his Staff Number somewhere in the path.
Eg:
The User enters '123' in the text field and when clicking the 'Submit' button must be taken to this document:
www.mysite.com/Staff123.pdf
Not sure about the syntax but with an example I would be able to edit to suit what I need if I can get the code to create both the text field as well as the button.
Thanks a lot
You need to create a form in html. Basically, a form is a block which let user input some values (text, password, email, date, integer, file, ...) and that send these values, once submitted through a submit button, to a certain file that will process these datas.
A classic example is the login form that you can see on nearly each site you know.
It could be like that:
<form action="processing_script.php" method="post">
<input type="email" name="user_mail" placeholder="Please enter your mail here">
<input type="password" name="user_password" placeholder="Please enter your password here">
<input type="submit" value="Click here to send the form">
</form>
You can see some attributes used in this example, I will describe each of them:
action attribute for form tag: it's the script that will receive and process the values from this form.
method attribute for form tag: it's the way that values will be sended to the destination script. It can be etheir "post" or "get". The post method will send the values through http headers, so it's hidden for users (but it can be seen with tools like Wireshark). The get method will send values through the adress bar like this (this is the url you see once you submitted the form): http://yourWebsite.com/processing_script.php?user_mail=johndoe#liamg.com&user_password=mYp#$$W0rD
type attribute for form tag: it depends on the type of data you want the user to inquire. Your web browser will use this attribute to determine which way he will show the input to the user. For example, user will see a little calendar widget if you wrote type="date". The browser will also do some basic verification on the data type when the user will click the submit button (in fact, the browser will not let someone validate the form if for example the input type is "email" and the value entered by the user is "zertredfgt#" or "erfthrefbgthre", but it will pass if the mail is "johndoe#liamg.com"). Type can be email, text, date, password, file, submit, and some others.
name attribute for input tag: it's the name of the variable that will be used in the destination script to access to the value entered by user in the field of the form.
placeholder attribute for input tag: it's the text shown in the fields when they're still empty. The text is not in black, it's some kind of grey.
The last thing to explain is the :
it's displayed as a button, and the text on it comes from the value attribute.
In your case, I think you only need to use some JavaScript:
Create a JavaScript method that will redirect you to the right pdf url based on what is entered in a text input.
Create a small form, without action or method fields.
Create an input type text (for the staff number) with a good attribute name like this: name="staffNumber".
Create a button (not a submit button) like this:
To redirect to a specific url in JavaScript, you want to read this: How do I redirect to another webpage?
To read the value from an input in JavaScript, you can proceed like that:
...
var staff_number = getElementsByName("staffNumber")[0].value;
...
To create the full url of the right PDF, just use the concatenation operator (it's + in JavaScript), so something like that should work:
...
var base_url = "http://youWebsite.com/Staff";
var file_extension = ".pdf";
var full_url = base_url + staff_number.toString() + file_extension;
...
(the .toString() is a method that ensure it's processed as a string, to concatenate and avoid some strange addition that could occur I guess)
I think you've got everything you need to create exactly what you need.
Please keep us up to date when you've tried !

Save a string with a photo and return them

I have a label on top of the image view.
Every time some one pushes the button the label is filled with a string that comes from a server.
I have a button that calls the picker to select a photo from the picker but the label obviously keeps empty..
How can i make sure the string will be saved with the photo and when i call it back with the picker it fills the label again...
I need some tips/help...
i am using ASIHTTPREQUEST asynchronical call to fill the label...so it does not hang up...thats best practice right ? or should i use nsurl and nsstring with format ?
you may use imageview's tag and store each string with tag of image view.
Somethings are not clear here :-
1>from the client sid eyou can send a request to server with the image that has been changed and get the corresponding string(in a table probably you have have to store string for each image).
2>You might use a dictionary to store key(string) for every corresponding imageName and store it in a dictionary and if you want persistent storage you may use coredata or sqlite.
To ensure that both the image and string are shown at same time you can show an activityIndicator.