Set Senddbdata(TRUE) without using Set_OP_ExecuteAction

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
KazunoriKasahara
Posts: 7
Joined: Tue Feb 04, 2014 3:35 pm

Set Senddbdata(TRUE) without using Set_OP_ExecuteAction

Post by KazunoriKasahara »

Hi,

Demo program LREX0303 sets Senddbdata(TRUE) using the Set_OP_ExecuteAction method to upload changed data to server when the UPLOAD button is touched.

#COM_OWNER.Set_OP_ExecuteAction Event(UPLOAD.ONCLICK) Program(LREX0303) Action(UPLOADDATA) Senddbdata(TRUE)

Our customer would like to upload data to server when a form command is touched.
If they specify "UPLOADDATA" to action name of the form command, they would like to set Senddbdata(True) under the following When (= UPLOADDATA) command.
Is it possible to set Senddbdata(True) without using Set_OP_ExecuteAction?

Case Of_Field(#COM_OWNER.RequestACTION)
When (= UPLOADDATA)
* They would like to set Senddbdata(True) here

Best Regards,
Kazunori Kasahara
Paul

Re: Set Senddbdata(TRUE) without using Set_OP_ExecuteAction

Post by Paul »

Hi Kazunori,

In short, it is not possible to do this. However, I'm told there is a work around. I will have an attemp at an example of this and post it to the forum.

Regards,
Paul
KazunoriKasahara
Posts: 7
Joined: Tue Feb 04, 2014 3:35 pm

Re: Set Senddbdata(TRUE) without using Set_OP_ExecuteAction

Post by KazunoriKasahara »

Hi Paul,

Thank you for your reply. I will be waiting for the example.

Best Regards,
Kazunori Kasahara
Paul

Re: Set Senddbdata(TRUE) without using Set_OP_ExecuteAction

Post by Paul »

Hello again Kazunori,

If you look at the shipped LongRange Offline examples there is a demonstration of a technique that is very close to what you want to do.

LREX0336 - LongRange Offline Command, displays a form command Email. Look at the schema LANSAOfflineDemo to see how the Email command is attached to the LREX0336 form view. You are probably doing something similar with your form command.

Notice the Email command, defined as a menu item, has the simbolic name cmdEmail. This is required so that the command can be referenced programatically (by LREX0314 in this case). Ensure your form command has a symbolic name defined in your schema. The symbolic name is added by editing the form command menu item.
Edit_Menu_Item.png
Edit_Menu_Item.png (28.22 KiB) Viewed 3421 times
Now look at LREX0314, the Local Objects Generator program, to see how the Email form command is referenced programatically. Note, this program is defined as the Local Object Generator in the LANSAOfflineDemo schema properties.

You will see this line;

Code: Select all

#Com_Owner.Set_Op_ExecScript Event('/System.Menus.cmdEmail.Onclick') Resource(LREX0336.js)
This line sets up an LongRange operation to run when the form command is clicked on from the LREX0336 form view.

In the case of your customer's form command, you could do something like the following;

Code: Select all

#COM_OWNER.Set_OP_ExecuteAction Event('/System.Menus.cmdUpLoad.Onclick') Program(LREX0303) Action(UPLOADDATA) Senddbdata(True)
This line could be in the Local Object Generator, as in the shipped example, or it could be in a Setup Menu Form view.

Here, I have used the symbolic command name 'cmdUpLoad' and the program name 'LREX0303'. Please substitute these with your own names.

I hope this helps.

Paul
KazunoriKasahara
Posts: 7
Joined: Tue Feb 04, 2014 3:35 pm

Re: Set Senddbdata(TRUE) without using Set_OP_ExecuteAction

Post by KazunoriKasahara »

Hi Paul,

This is exaclty what I want to do. Thank you very much!

Kazunori Kasahara
Post Reply