Add instance help
I'm trying to create a document that has 4 seperate tables in that the user will enter information for various materials. I have created a button to add another row in each of the 4 tables using the following JavaScript code:
frmCredit4._Item.addInstance(1);
frmCredit5._Item.addInstance(1);
frmCredit6._Item.addInstance(1);
frmCredit7._Item.addInstance(1);
xfa.form.recalculate(true);
All of the works fine so far, but I need to have the first column repeat in each of the 4 tables, which is where I get stuck. I tried setting the binding to global, but that makes whatever was entered in the first row of the first table repeat in all of the other rows of all of the tables, which of course won't work because I need different data in each of the rows of the first column. Any suggestions?
Thanks,
Michael
Your requirement is tricky and very challenging (I like the stuff). Check the attachment here is what I have done.........
1. Set the Binding to Normal
2. Added FormCalc code to the "exit" event of the Table1:Column1:txtMaterialComp
Here is the script
var partLeft
var partRight
partLeft = Substr($.somExpression, 1, 69) //69 is the length of the characters before '5' in the SOMexpression of the field
partRight = Substr($.somExpression, 71, 200) //71 is the starting position for the right part and 200 is to get the chars till the end....or you can have 500
//xfa.host.messageBox(Concat(partLeft,5,partRight))
var transferTo5
transferTo5 = Concat(partLeft,5,partRight," = ", """", $.rawValue, """")
//xfa.host.messageBox(transferTo5)
eval(transferTo5)
This script will dynamically access the instance number and then sets the value in the specified relative field.
Hope you can take it from here and add additional script to populate rest of the tables as you need.
Good luck,
Similar Messages
-
I'm can't figure out how to add a new record with add instance, see below for basic code. The second one works but I can't re-create it. I'm guessing something basic that I am over looking.
I also can't figure out how to attached my pdf's so you have to download from my website.
Thanks,
Jay
http://www.atg.state.vt.us/assets/files/Adding%20a%20row%20-%20does%20not%20work.pdf (does not work - need help)
http://www.atg.state.vt.us/assets/files/Adding%20a%20row%20-%20works.pdf (this one works - I didn't create it)It looks as if you have saved the form as an Acrobat 7 STATIC form....you
need to save it as a DYNAMIC form. You will find that option in the file
types in the save as dialogue. I resaved it locally and your form works.
Hope this helps -
Calculation in an add instance
I am trying to use an if statement in an addinstance of an interactive form. Based on the results of one field in the addinstance, I want to sum a different field from the add instance. So, the customer can add any number of rows and choose from a drop down (coded 1-4) the position of the person. If that position is 1 or 2, I want to sum the salary field in a calculation box. If the position is 3, then I want to sum the salary(ies) in a second calcuation box, and if the position is 4, then I want to sum the salaries in a third calculation field. My code for one of the the calculation field looks like this:
form1.#subform[8].#subform[9].details.total.conditions.#subform[0].numTotal[
1]::calculate - (FormCalc, client)
if (detail[*].PTFT < 3) then
Sum(detail[*].salary)
endif
The other two fields are the same except that they change "<3" to "==3" or "==4".
The problem is that it does not sum the second or third calcuation field. Only my first calcuation field will work.
Since it is a rather simple if statement, I think that the problem may be in the subforms, possibly?
Please see my form at http://www.units.muohio.edu/lifelonglearning/forms/zzztest.pdf
Thanks in advance for any help you can lend.Ok I had a look at your form (nice form by the way ...good job). The expression you are using to determine the number of instances is not correct....as well when you sum the salaries it is the details subform that has th eiccurance numbers so that needs the * notation. Here is the 1st calc modified
if (details._detail.count < 3) then
Sum(detail[*
].salary)
endif
You also have the same code on the layout ready and the calc event. No need for both ...just leave it on the calc event and when the user enters the amounts the totals will update.
You are also getting an error when the row initialize .....a partNoScript is being called becuase of script behind the Name field (itis called txtPartNo in your form). My guess is that you copied this from the Purchase Order sample and forgot to remove the scritp from the Initialize and the change event. This field was originally a DD field and that is what was used to populate it.
Hope that helps
Paul -
Add instance on Read only field issue
I have a subform with two fields , one a date field to capture current system date and time and another is a Text field for some comments.
Then there are two buttons ,one for Adding the instance for these two fields and another is a Save button which makes these two fields
The requirement is that once both the fields are filled with data and i click on save button, the fields should become read only ,however when i click on the add instance button the instance is added successfully but the save button click is not making the new instance read only.
The Code for Add Instance Button is :
"New1.FileNote.instanceManager.addInstance(true);
xfa.form.recalculate(true);"
The code for Save button to make the fields read only is :
New1.FileNote.DateTimeField101.access = "readOnly";
New1.FileNote.TextField37.access = "readOnly";
Please guide me as I am totally blank on how to code the same..Have a rough logic of using a for loop with index of the Add Instance but not getting the way out for the code.
Thanks a lot for any help and guidance.Hi Steve,
Thanks for your reply..I made it happen using the for loop with Index and resolve node. However there is another issue which occured after that..I have a date/time field in that repeating subform instance.
The run time property is set to Current Date/Time. Now the issue is whenever i click on save, form.recalculate instance changes the existing time value in the previous subbform instance as well
Is there a way to retain the existing value in the field of the previous instance ??
Regards
Kapil -
Add Instance Subform content to textbox
Hi all,
There is sth I would like to do.
I have a form which has a text field that is in a subform where you can add instances. No problem with pages etc.
Now, I have created a text field where I would like all entries to be repeated as plain text possibly separated by rows.
For example:
Textbox in Subform: Eggs
Textbox 2 in Subform (after clicking the add instance button): Butter
Text box at the end should either say:
Eggs, Butter
or
Eggs
Butter
Does anyone have an idea on how I can achieve this?
Thanks a lot,
LarissaHi Paul,
Actually I have several requirements. I have attached the pdf as this seems easier at this point.
At the beginning of the pdf, I have the marks in three boxes. I would like to concatenate them with a comma between the different entries into a text field that users can then copy paste into the next form.
Let’s say in the first box you put:
A
B
C
In the second,
D
E
I would like to have a text box that comes out as: A,B,C,D,E
Second problem I am facing with this task is at the countries.
I have a country online selection and a second country selection.
Ideally I would like to have just one box with all countries and be able to tell the pdf that certain countries have the characteristic “Online”.
Thus if the client clicks on “Add” I would have two list boxes: One for Online and one for Rest. Depending on what the characteristic of the country it would either go into the Online or the Other.
Any ideas on my problematic.
I was thinking working with numbers and maybe telling the system that if it is under 100, move to Box 1, if it is over 100, move to Box 2.
Thanks for your help.
Kind regards,
Larissa -
Adding add instance into calculation
I am trying to get fields from add instance/subform fields to calculate with the rest of the form fields. The problem I am having is once I "add instance" the field is no longer part of the calculation. I have tried using:// Verify at least one instance of the midtr3a field exists.
if
(exists(location.yes900.admids.midtr3a) == 1) then
Sum(location.yes900.admids[
*].midtr3a)
endif
would appreciate any help on this.
Thanks KI think you do not have to check for whether the field exists or not..Because when you use the "Sum" function, it will check if the field is present and if it has value or not.
You may directly try the following int he script..
Sum(location.yes900.admids[*].midtr3a
Also in your Exists function, you are checking "exists(location.yes900.admids.midtr3a)".. This will only check for the first instance of the field.
Thanks
Srini -
I am working on a flash file AS2 that contains some combo
boxes.
When I start the program I can right click on a button and
add instance code ie current selection is the button.
After working on the file for a while I can't do this.
When I right click on new buttons and objects and select
actions the current selection shows as the frame not the
object I want to add code too.
This is very frustrating as I basically can't add instance
code.
Any help would be greatly appreciated
AlfredI think the problem was the pin current script button. Some
how I clicked this and no matter what I right clicked on it would
always take be to the last script I used before I hit the button.
Thanks for your prompt response.
Alfred -
In the first image below the user can click on "AC" to add additional lines for comments. When they have completed that they will click on "Add Line" to add a new instance of that line. In the 2nd image the 2nd line is overwritting the additional comments add to the 1st line. How do I position line two and additional lines to occur at the bottom of the additional comments (1 comment or 5+)
Also I need two more buttons
1. Will add line and copy the contents of the line above
` 2. Move line - Up and Down button that will allow the user to reorder the entries.
Thanks in advance for your help!Hi,
The example has several tables, the last two have add, remove buttons, as well as move button and button to add rows directly underneath (add instance and move it in one click).
There is an example I did here for someone. https://acrobat.com/#d=HD6XJ1qofZDf713Yq1P43g. From memory the add instance script also copied the rawValue of the "Send to" object to the "Reviewer" object in the new instance. This should give you a direction.
When it comes to LiveCycle Designer there is no single source with all of the information. Some of the Adobe resources are extremely valuable, but do not make for light reading.
A good book to start out with is JP Terry's book on LC Designer, which is excellent - "Creating Dynamic Forms with Adobe LiveCycle Designer".
We have some solutions and blog posts on our website http://www.assuredynamics.com. We are trying to make some of examples more instructional. Also if you go to the blog on our site you will see some other blogs that we strongly recommend.
There is also a range of online resources. You may find these resources helpful:
http://www.adobe.com/go/learn_lc_scriptingBasics
http://www.adobe.com/go/learn_lc_scriptingReference
http://www.adobe.com/go/learn_lc_formCalc
http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Reference.pdf
http://www.adobe.com/devnet/acrobat/pdfs/lc_migrating_acrobat_xmlform. pdf
And a very handy resource (and while it is for version 6 it is still very good because of the way it is laid out):http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf
The help file also helps with syntax and LC Designer comes with templates/examples.
Lastly, check out the Developer's Network on http://www.adobe.com/devnet/livecycle/
Also a book that doesn't deal with scripting at all but is very good on form layout is "Forms that Work" by Caroline Jarrett and Gerry Gaffney.
The Adobe "PDF Forms Bible" is okay, but mainly focuses on AcroForms.
Windjack Solutions have a subscription based service for solutions and scripts at http://www.pdfscripting.com. It has a lot of AcroForm script that can be amended to suit LC Designer and a growing library of LC Designer solutions.
Hope that helps,
Niall -
How to add search help to a field in MARA table
Hi,
According to my requirement,I need to add search help to one of the field in MARA.It is checkbox now and it has to be changed to drop down.
How to do this please help.hi u can use HELP-REQUEST option at selection screen or VALUE-REQUEST
The addition on Value-REQUEST displays the pushbuttuon for F4 help for the corresponding field.
The value selection is controlled by interactive events.
pradeep -
How to add F4 help for the custom field of a custom table
Hi All,
How to add F4 help to the custom table field? in the table maintainance when user clicks on F4 i want to provide possible values for this field I am trying to write the code in the screen of table maintainace like the following
PROCESS ON VALUE-REQUEST.
FIELD ZTEST_MAH_F4-KUNNR MODULE zVALUE_kunnr .
But when i am double clicking on module it's giving options to create include program but after that it's giving user is currently editing the table i am not getting this can some body clarify my doubt it's gr8 if some body give some examp code
Thanks&Regards
maheshHi,
Create a subroutine under the event and call the following FM
1. Select all the related data into an itab, for ex i_kunnr
2. CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'KUNNR'
PVALKEY = ' '
dynpprog = sy-repid
dynpnr = '1000'
dynprofield = <selection screen field>
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = <b>i_kunnr</b>
FIELD_TAB =
return_tab = < return table >
DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3 -
hi how can i add search help .
when i am giving a parameter of type BSART it takes the in built search help
but i want only those values to appear in F4 help which have diff values in category but i want only with catogory "F".
thanks in advance
naval bhattHi,
You have a Function module <b>HELP_VALUES_BSART</b>
or
You need to use AT SELECTION-SCREEN ON VALUE-REQUEST FOR <FIELD>.in this one use the Function module F4IF_INT_TABLE_VALUE_REQUEST.
Look at the below linkhttp://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm
Regards
Sudheer -
Add instance in a subform which also can be doubled
Hi,
I have a subform X which can be doubled by a click on the button. In that subform X there is another subform Y which also can be multiplied to a maximum of 3.
Now when I add a subform X and i want to add some subforms Y. The form will only add the subform Y in the first subform X and not in the second one.
This is the script I use:
for subform x
if(Incitant52.subFoireAcheteur.all.length < 2){;
Incitant52.subFoireAcheteur.instanceManager.addInstance(true);
and for subform y
if(Incitant52.subFoireAcheteur.subAcheteur.all.length < 3){;
Incitant52.subFoireAcheteur.subAcheteur.instanceManager.addInstance(true);To add instances to the second occurance of subform x you will need to address it with subformx[1].
Note that the [ ] brackets are not valid in javascript so your expression should look something like this:
xfa.resolveNode("Incitant52.subFoireAcheteur.subformx[1]").instanceManager.addInstance(1) -
How to Add F4 Help To a Screen Field In a Module Pool Program
Hi Friends,
1. How to Add F4 Help To a Screen Field In a Module Pool Program?
2. How to select a single cell in ALV report output for interactive reporting ?
Kindly give code example.
regards,
PradeepHi,
Try using the fm 'F4IF_INT_TABLE_VALUE_REQUEST'.
Refer the link below for selecting single cell.
alv
Reward points if useful.
Regards
Rose -
CLM How to add search-help for extension field(New Company Field) in MA.
Hi all,
Based on demand,I need to extend a new field(Company) in Master Agreement.
But I do not know how to add search-help for this field,just like User Accont page.
Anyone can help me ?thank you very muck.
Regards,
JackyChengHello Jacky,
To combine all the answers above and have a topic-based reply please go through the below steps:
#1. Inactivate the current extension field Company (I see it is actually a String value and this is not what you want to have)
#2. Go to Setup -> System Setup -> Extension Reference Types
Check if you already have a Company reference type
If not, create a new Extension Reference Type for Class Company. Fill in all required information.
#3. Create a new Extension Attribute
Select Data Type: Object Reference
Now you can add the Company type as reference
Regards,
Bogdan Toma -
How to add F1 help for a field on ALV grid
Hi All,
When we execute a program, the output is displayed using ALV grid.
on the ALV grid, if we press F1 on a field, it should popup the help document.
How to add F1 help for a field on ALV grid.
Thank you all in advance.fill field LVC_S_FCAT-ROLLNAME of your fieldcatalog in method SET_TABLE_FOR_FIRST_DISPLAY
A.
Maybe you are looking for
-
Error while connecting to Planning web 4.0.1
Hi, I have restored the data from original db to newly created database, also I have changed the id for user 50001. Hyperion Planning: 4.0.1 Weblogic: 8.1 SQL Server Now when I try to connect to Hyperion Planning, Am getting following error while try
-
Hard case vs Rubberized hard case for Macbook Pro?
I'm looking at cases for my MBP 13" and was wondering which is prefereable - hard or rubberized? Also, are there any particular models that you all reccommend? As for keyboard skins, which is the best (affordable) one? I type fast & hard and want to
-
Why is my iPhone screen not turning off?
Why is my iPhone screen not turning off?
-
Spilled water on Laptop- it works only when power cord NOT plugged in.
HP Pavilion dv2000 laptop I spilled plenty of water on the right side where the power cord is. I removed that and took the battery out. (12 cell i think) Dried out the laptop for about a day or so. The laptop is fine except when I'm trying to charge
-
What happened to speeddial? I have a laptop but cannot find this feature.
cannot find any reference to speed dial so I can use on my new computer.