Button to open 2nd window and push key into new win FK field (OpenInsight 64-bit)
At 15 NOV 2023 11:51:41PM mdaniel wrote:
Hello,
Wanting to create a button on a client form that will open a new form called projects
that has Seqkey and push Client Key into CID_FK of the projects form.
Tried various ways with quick events clicks and scripts, but no luck.
Michael Daniel
DSG LLC
318-267-4255
At 16 NOV 2023 08:50AM Brad Bishop wrote:
I would send the Client Key via an ominevent from the client form to the projects form. Then in the omnievent handler on the projects form populate the CID_FK.
bb
At 16 NOV 2023 09:05AM mdaniel wrote:
Being new to OI, is there an example of what you are speaking of?
Michael Daniel
DSG LLC
318-267-4255
At 16 NOV 2023 09:36AM Andrew McAuley wrote:
If you are wanting to accomplish this with purely quickevents and no code then I suspect you're going to need three quickevents.
Button Click Event.
[list]
Get Customer Id property
Launch form (Execute repository entry) - Customer Id will be in @RetVal so make this create param
[/list]
Window Create Event.
[list]
Set custom window property to Customer Id.
Optionally send lostfocus to key prompt to auto accept seqkey
[/list]
Window Read Event.
This QE will be happening AFTER the read has happened
[list]
Get Customer Id custom property
Set DEFPROP of FK_CUSTID to be @RetVal
Optionally send lostfocus to customer id control.
[/list]
I haven't tested this and you may need to play with "skip if null" but it should get you most of the way there. You may need to get the property that tells you this is a new record and NOT update the customer if it isn't. So skip if new record is false.
World leaders in all things RevSoft
At 16 NOV 2023 09:50AM mdaniel wrote:
Coding is fine to if it is a better way. JFI
Will try your example JIC
Michael Daniel
DSG LLC
318-267-4255
At 16 NOV 2023 10:08AM Brad Bishop wrote:
Using an OMNIEVENT
From the sending module:
retval = Send_Event('W_PROJECT','OMNIEVENT',ClientKey)
In W_PROJECT module
If Event = 'OMNIEVENT' then
retval = Set_Property(@window:'.CID_FK','TEXT',Param1)End
At 16 NOV 2023 10:41AM mdaniel wrote:
Hi, Thank you for your reply, as I am new mostly to OI
Can you elaborate some more details on where you are placing the above items :
Client Form:
Under Quickevent or event script?
Retval = Send_Event('W_PROJECT','OMNIEVENT',ClientKey)
And In the projects form where is this supposed to be placed?
If Event = 'OMNIEVENT' then
retval = Set_Property(@window:'.CID_FK','TEXT',Param1)
End
Testing all examples to learn how you all do things and now seeing there are many
different ways to achieve the same goal in OI which is outstanding!
Michael Daniel
DSG LLC
318-267-4255
At 16 NOV 2023 10:55AM mdaniel wrote:
Hi Andrew,
Under the
Button Click Event.
Get Customer Id property
Launch form (Execute repository entry) - Customer Id will be in @RetVal so make this create param
Can you detail this out with an example, thanks
Again being very new to OI vs Arev and coming from FM dev trying to shift dev platforms from FM to OI.
The examples posted in most ALL the videos are incorrect now as OI 10 has changed and been updated and the Docs,…well, they are like the videos. They both need lots of love and updates.
As I am positive things have changed in 2-3ish years.
Also can you show examples of this as well if you have the time.
Window Create Event.
Set custom window property to Customer Id.
Optionally send lostfocus to key prompt to auto accept seqkey
Window Read Event.
This QE will be happening AFTER the read has happened
Get Customer Id custom property
Set DEFPROP of FK_CUSTID to be @RetVal
Optionally send lostfocus to customer id control.
Michael Daniel
DSG LLC
318-267-4255
At 16 NOV 2023 11:05AM Brad Bishop wrote:
I place all my code in commuter modules (rather than scripts). This makes them easier to find and maintain versus having to look at each control.
There is a series of youtube videos that are an excellent starting place for those new to Open Insight ad and those looking for how to do specific tasks. That's where I'd recommend you start.
https://youtube.com/playlist?list=PL4eRKp6imSjA8Wg01-tQ5IzNbW4SRU7Vz&si=X6uG-Vo50wXLr1n9
A big thanks to Martin Phillips for creating these videos.
At 16 NOV 2023 12:22PM Andrew McAuley wrote:
As Brad has said, most people use commuter scripts in the same way they did in AREV. So one program, normally having the same name as the Window or some variant thereof, to deal with all of the events etc for the Window. The advantage of using a commuter is that it gives total control - something which with the best will in the world, quick events can't always do. Think AREV Commuter vs Catalyst calls.
I dummied up the concept I provided you with using the EXAMPLES app, using the CUSTOMERS Window and the INVOICES Window which already had some quick events in place. I added a button to the CUSTOMERS Window to create a new invoice and on the CLICK event I put this…
on the CREATE event of the INVOICES Window I put this
Note the commuter call was already there so I just set a "Custom Property" (@CLIENT) and sent the LOSTFOCUS,
Then on the READ event, I added the following
As I said, it's a little rough and ready but it gives you the idea.
World leaders in all things RevSoft
At 16 NOV 2023 12:35PM mdaniel wrote:
Thank you very much for your time and explanation with the steps.
I agree the commuter mod is the way to go to control and debug many aspects in 1 place.
Michael Daniel
DSG LLC
318-267-4255
At 16 NOV 2023 05:14PM mdaniel wrote:
Ok Andrew, Built this out and no errors, the button does open the projects window from the client
as stated. And the Seqkey is in the key field, but the Client_IDFK did not get pushed into the field
causing the xlates for the client details to pull over.
We made sure that the CIDFK is the next field after projects Seqkey field but still nothing.
Michael Daniel
DSG LLC
318-267-4255
At 16 NOV 2023 05:35PM Andrew McAuley wrote:
So now we have to start debugging. Is the custom property being set? Try using a script on the Read event. Problem is you will have to forward the event from the script to replicate the sequencing of the quick event.
So basically, in the script, forward the event, then see if you are able to extract the @client property. If you are see if you are populate the foreign key and send a lost focus. See if it works here so we can work out why it isn’t working there.
World leaders in all things RevSoft
At 16 NOV 2023 05:53PM mdaniel wrote:
Rgr will do thanks.
Michael Daniel
DSG LLC
318-267-4255
At 16 NOV 2023 05:53PM mdaniel wrote:
Michael Daniel
DSG LLC
318-267-4255
At 16 NOV 2023 08:13PM mdaniel wrote:
Andrew, I was going to use MSG to to track down the info failure.
So I thought I could use Commuter module creation and attached are the 2 errors I received
just trying to do that.
Not sure why both would error like that with the same error.
Michael Daniel
DSG LLC
318-267-4255
At 17 NOV 2023 06:08AM Andrew McAuley wrote:
Obviously this doesn't help but to preempt :).
Are we trying to debug why the quickevent isn't working or are we trying to use a commuter event? The original suggestion was that you just put code in the script event as a temporary measure. Ensure that, if you forward the event, you return 0 from the READ script or you'll run it twice.
World leaders in all things RevSoft
At 17 NOV 2023 09:37AM mdaniel wrote:
sorry it was my attempt to be proactive and try to debug why the QE was not working
To see if the val of the CID from clients was being grabbed and in Projects to see it if was being pushed.
That was my only reason for trying to use the commuter mod.
Michael Daniel
DSG LLC
318-267-4255
At 18 NOV 2023 10:37AM mdaniel wrote:
Andrew,
Did I do the wrong thing in trying to debug it that way?
Michael Daniel
DSG LLC
318-267-4255
At 18 NOV 2023 11:44AM Andrew McAuley wrote:
No but your images are not visible to me so I have no clue what your debugging issue is :)
World leaders in all things RevSoft
At 18 NOV 2023 12:49PM mdaniel wrote:
I am so sorry I did not know, I used the link icon at the top here and added it as requested.
It basically states the following:
OI Commuter Module Generator
An error has occurred during the COMPILE
SYS 1223
And a OK button
Nothing else, so the convert to Commuter did not work on either Form with just those simple
QE changes you posed.
I would send screen shots like you did but do not know how you did that.
Michael Daniel
DSG LLC
318-267-4255