[SOLVED] Error on compile of code form, Creating linked target form

Goal is to create a link from another form that passes a value to a form field in an add (insert) mode to add a new record that is linked within the innoDB database. This field on the target form is a Foreign Key so it must match a key field on the master database (the form ‘parent’).

I do not wish to do this as a master-child layout but desire to pass the ‘key’ from the ‘parent’ form as a global variable and populate a form field within the target form with this value in insert mode and set and then set this field to read-only (or label).

On the target form I have done all the layout and have added the following to test the start of the programmatic approach. So according to instructions/videos - I used sc macros shown below, and according to the vidoes, instructions we must put the code in the event ‘onApplicationInit’ of the target form. The code is only 2 lines and I get an error on compile.

** Start Code **

sc_apl_conf(“form_XAPI_addr_region_add”, “start”, “new”);
sc_field_readonly({FK_country_id}, ‘on’);

** End Code **

The tutorials show no parenthesis around form name ( see here http://www.scriptcase.net/blog/using-the-sc_redir-and-sc_apl_conf-macros/ )

but the video and the web help does…

Any ideas on the error, and any ideas on creating this link?

SOLVED - You must use parenthesis - as the tutorial is in error. You must use on * single record form * the ‘onApplicationInit’ as described above - using the macros as described above.
I added 3 more steps…

Step 1
I pre-filled the value of the field in the attibutes of the field as descibed here: http://www.scriptcase.net/docs/en_us/form-applications/form/fields/text as initial value -> defined value and set to [glo_var_county_id]. **SAVE **

Step 2
I configure the global variable defined above as in and post …find these settings in Application->Global Variable…as described here : http://www.scriptcase.net/docs/en_us/grid-applications/application/global-variables SAVE

Step 3
Set link in parent form to pass parameter (field) to global variable.

Now on to text concatenation. Hope this helps someone else.