Netsuite Advanced PDF/HTML add custom column if value - html

I need help with adding a custom column with id 'item.custcol_new_unit_price'.
If there is a value for this column on any item, I need this column to appear on the printed form. I would think it would be something like this:
<td align="right" colspan="4"><#if item.custcol_new_unit_price>${item.custcol_new_unit_price}</#if></td>
Any assistance would be helpful. Thank you!

Try:
<td align="right" colspan="4"><#if item.custcol_new_unit_price?has_content>${item.custcol_new_unit_price}</#if></td>
Source: http://freemarker.org/docs/ref_builtins_expert.html

Is this field being displayed in the UI? If you want a custom field to be available in Advanced PDF/HTML Templates, it needs to be checked to "Show" in the Screen Fields tab when you customize the form. If you don't want the field visible in the UI, you can usually trick the system to hide it by making the Label empty.

Related

Visualforce / Apex: Access two objects with one controller

I'm forcing the problem that I have to set up a visualforce page rendered as pdf, which outputs a automatically generated invoice. Because of intern workflows this page has to be set up to the Opportunity object.
Most of the fields used are taken from the Opportunity object itself and work fine.
But I also need access to the OpportunityLineItem fields to display the products on the invoice.
How can this be realized? Do I have to write a controller extension in apex or is it possible without?
As an alternative, would this eventually be possible with cross formula fields referring from Opportunity to OpportunityLineItem? I tried this, but could not find any possibility to select OpportunityLineItem in a formula field in the Opportunity object.
Any help is much appreciated. Thanks!!
Below is a sample page accessing the OpportunityLineItems for a given Opportunity using the standard controller ammended from this doc reference.
<apex:page standardController="Opportunity">
<table border="0" >
<tr>
<th>Description</th><th>Quantity</th>
<th>Unit Price</th><th>Name</th>
</tr>
<apex:repeat var="oli" value="{!Opportunity.OpportunityLineItems}">
<tr>
<td>{!oli.Description}</td>
<td>{!oli.quantity}</td>
<td>{!oli.unitprice}</td>
<td>{!oli.Name}</td>
</tr>
</apex:repeat>
</table>
</apex:page>
With respect to formula fields, you cannot access child fields in a formula on the parent for the simple reason that it is a one to many relationship. The parent Opportunity would not know which of the children to lookup to.
The best you can do is make a regular (text or whatever) field, run a Process Builder triggered by a change to the relevant field(s) on the parent (opportunity) and trigger a Flow to loop over the children (LineItems) and make the changes to the parent based on some condition you specify.

Magento 1.9 Transactional Email Variable Edit

So ive tried for 2 months to find the source of my headache to no avail.
Within magentos default transactional emails is for example the "Wishlist" Email, triggered on user input to fill with the specified list of products in the users wishlist and email said list in a grid layout to a recipient of choice.
My problem is this, the HTML for the email specifies only Var_items and Var_grid as the variables that get and input the products into the table. The styling for this table seems to have a fixed pixel size and when inserted into dynamically sized emails it messes them up considerably, my simple goal is to change the styling of these grids to better reflect the emails, but i cannot find it anywhere.
Does anyone have any idea where i should look and what im looking for? Thank you kindly in advance for your assistance. I dont know where else to turn at this point.
Cheers!
Template for wishlist items is located at
/app/design/frontend/base/default/template/wishlist/email/items.phtml
take a look at block class Mage_Wishlist_Block_Share_Email_Items
Default template has some fixed values indeed. But you can replace it in your custom theme.
<table cellspacing="0" cellpadding="0" border="0" width="650">
<tr>

Highlight the newly added row in clr-datagrid

I have used clarity UI in my project and i have come across an issue where i want to select the row which is currently added to the clr-datagrid table .I've used clr-DgSelected directive and it gives me a select checkbox which i don't need and if i use [(clrDgSingleSelected)]="selectedUser" this will give me a radio option and it lets me to select the particular column with the radio option checked but the problem is not the radio button or checkbox i just want to highlight the newly added row how i can achieve this.
Any help would be appreciated Thank You
Since Clarity doesn't have the concept of a newly added row, you need to add that concept yourself. Each record could have a isNew or showHighlight property that would allow you to add a CSS class that will highlight it
<clr-dg-row *ngFor="let user of users" [class.highlight]="user.isNew">
<clr-dg-cell>{{user.id}}</clr-dg-cell>
<clr-dg-cell>{{user.name}}</clr-dg-cell>
<clr-dg-cell>{{user.creation | date}}</clr-dg-cell>
<clr-dg-cell>{{user.color}}</clr-dg-cell>
</clr-dg-row>

Database design for a form builder in MYSQL

Currently I am working on a form builder,
the user can add input box with different name into the form.
Notice that the form will be stored as HTML code, so the only concern is the input box name storage and submit form value
Now I have draft a table like this
form
-----
id
inputs
------
form_id
name
values
-------
input_id
value
One problem I can think of is the data type of value,
the above design works only if the value is text / textarea
How to handle if the input box is file upload / radio / select?
so are there are Any better design,
thanks a lot for helping.
you have to store element type also. according to the element type,find out which html element it is and render this
You will need an extra table for radio and select, since it has multiple rows for one <input> field.
Don't forget about optional things like id=, name=, style=, class=, etc.
I predict that your finished product will be as clumsy to use as typing the form elements by hand.

how to align checkboxes to the left of a table in html

I have a table representing data in a database and I'd like there to be checkboxes to the left so that the user can do operations on the selected items (ie delete, modify). My question is, how can I align the checkboxes to be to the left of the table?
<table border="2">
<tr>
<th>A bunch of headers</th>
</tr>
<tr>
<td>A row of items</td>
</tr>
A lot more rows
</table>
Pretty straitforward, I have no idea how to proceed with checkboxes, I tried to put a form around the table but that didn't work.
You can add a column that contains checkboxes only. Using td elements, they will be left-aligned by default.
However, checkboxes should be used to provide a control for selecting or not selecting some parameters, not for triggering actions. Consider using e.g. button elements for actions.
Use CSS to align them.
margin-left:100px;
float:left;
You could just create an "actions" column which you insert as the first column in your table that contains the checkboxes. That way all checkboxes are kept separate from the contents which makes formatting and manipulation via javascript easier.
Alternatively if you must use a form for each row you could do something like:
<td><input type="checkbox" /><span>Data...</span></td>
... but if you go the second route you loose the power of tables** & may as well go for a div only solution.
** for displaying tabular data; before someone shoots me down for table vs div for layouts.