Twig, how to add custom control next form widget - twig

i have an integer field containing bytes values, i want to display a custom select box (with choises 'MB', 'Gb', 'TB') next to form widget, so depending on selected choise convert the input value on bytes, (i.e. if input is 2 and selected choise is MB, convert the input as 2097152 bytes). How can i do that using twig? thanks...

Related

Multi-select fields on Generic Inquiry

How do you filter on multi-select fields on generic inquiry?
Assuming your data looks like this :
ROW VALUES
A 1,5
B 3,4,5
C 5
D 1,2,3
E 2,4
And you want too search for records where there is either 1 or 3. So it should show rows A, B & D. I'm not sure if its possible. So the alternative would be write a custom screen and manipulate via view delegate. I could be wrong though.
TIA
The PXMultiSelector editor control persists the values in string format
How to filter depends on the format. Email address for example have a pre-determined format. For those you can add a standard string filter like Field Contains c#d.com
That wouldn't work for numbers. If you search for number 1 in list 2,4,15 it would return the result because 15 contains 1. To workaround this issue you can add a custom unbound DAC field. In the DAC field property getter you can parse the value of the multi-selector field and reformat it to a pre-determined format like ,2,4,15, and filter on ,1, instead of 1.

Using DFSORT: Input Signed Packed Fields converted to OUTREC Zone Decimal Fields with Sign + or -?

I have datasets that contain multiple packed signed values. I want to convert those fields to Zoned Decimal (Display) for reporting those values in an EXCEL Spreadsheet.
I have the non-signed packed field displaying ok, but the signed negative value does not show a -, i.e. 123D ==> -123
Here's some DFSORT SYSIN:
OPTION COPY
OUTREC FIELDS=(001:001,004,PD,TO=FS,LENGTH=6,C'|',
008:005,004,PD,EDIT=(STTT,TTT.TT)
Input:02460001 (2 fields) Output: 123456|S000,000.01
135F000D
the S should be a -
In the case of negative sign, I added SIGNS=(,-). I added SIGNS=(+,-) for both signs.
OUTREC FIELDS=(001:001,004,PD,TO=FS,LENGTH=6,C'|',
008:005,004,PD,EDIT=(STTT,TTT.TT),SIGNS=(+,-)

select drop-down list by text not value

I am trying to write an Excel VBA script to navigate to a website and select from a drop-down list using the text in the list item, NOT the value of the index. By examining the HTML code, I can see that the values in the drop-down list appear to be integers with no recognizable pattern and do not appear to correlate to the text shown for the entry in the drop-down list.
<option value="246">new2</option>
<option value="245">new</option>
<option value="196">test</option>
I can successfully use the following command:
ieDoc.getElementById("viewMaintainFixedCombustible_fixedCombustible_fireZoneId").Value = 246
To select the item "new2" from the drop-down list, by sending the value 246. Or, I could send 245 to select "new". However, the elements in the list are always changing, so selecting by value (246, 245, etc.) is impractical. Thus, I am searching for a way to select an entry from the drop-down list (e.g. "new2") by sending the text name of the entry (e.g. "new2") in VBA.
Does anyone have a method for how to do this?
Try below sample code to set dropdown list by text.
Set drp =ieDoc.getElementById("<id of your dropdown>")
For x = 0 To drp.Options.Length - 1
If drp.Options(x).Text = "new2" Then
drp.selectedIndex = x
Exit For
End If
Next

Problem sorting a view based on a text field with numeric values in Lotus Notes

An existing Lotus Notes database form has a text field whic contains a numeric value. I am trying create a view to sort on this field but the result is coming up as follows
99
1000
1002
1003
101
1011
Is there any way to convert the field so I can sort numerically. Lotus Notes 6.5.
In the column formula, convert your item to a number using
#TextToNumber( itemname )
Because the text field has numeric values, they are still treated as literal string. So, the easiest way I have found to format them and avoiding #Errors' is to pad them with leading zeroes as well and continue to treat them as a string.
The good thing about this solution is that we're still dealing with strings. No mucking about with data type conversions where you may have data that cannot be converted into a number.
So put this into your column formula and set the sorting options as ascending or descending as you require:
MaxSize := 10;
len := #Length(#trim(yourField));
Pad := MaxSize - Len;
#Repeat("0";pad) + #trim(yourField);
Make sure that your "MaxSize" value is greater than the length of any value it receives. From the sample you've provided, 4 looks like it will do the trick.
(As per Ken's suggestion), if the appearance of the padded column to the user is not appealing, you can make this column a hidden, sorted column and then present the original unformatted (and unsorted) column to the user so it appears in a numerical order.

Crystal Reports: Text field flow justified around image/margin indentation

I'm creating a report that outputs a letter. The first page contains is a large left margin containing static company information. The letter output can be multiple pages, however I only want the text on the first page indented to the right away from the left margin. How can I accomplish this with one text field (the letter body is all one data field)?
Example: http://i.stack.imgur.com/E6SGr.jpg
Right-click on your text field and select 'Size & Position'. Here you can set the X and Y positions of the field, and the X value can be set conditionally. All you have to do is something like:
if pagenumber=1 then 0 else 1440
Watch out, though, the units used in the formula are twips, not the units listed as your default in the Size & Position window. FYI, 1440 twips to an inch or 20 twips to a point.

Resources