Record Prefix Behavior #ria
Darren
Hi Guys So I've migrated a UnipaaS 1.9 project to Magic XPA 3.3 What I've noticed is the record prefix behavior. In UniPaaS, I have virtual variables updated in the record prefix by a value in main source because task has a main source and only 1 record is being modified and form has no table, when I modified a value in the main source that used to update the virtual variable in the record prefix and submit the form and the virtual variable values are still retained. However, in Magic XPA , when I submit the form it seems like it goes to record prefix again and update those virtual variable with the modification I did in the main source.
Best Regards, Darren
|
|
Darren,
Not sure if I understand this correctly, so I’ll outline how Magic’s engine cycle basically works (and has since DOS)
In an Online task (not covering a Batch task here which is slightly different)
So the above is long winded but important. It’s late so I may have missed something (there is more detail but I don’t think it’s relevant here). If so, I’ll go find my diagram and attach it (later) 😊
Hope this clears up why your program is doing what its doing. Again, this logic has not changed since about Magic version 5.x.
Keith Canniff
From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of Darren
Hi Guys So I've migrated a UnipaaS 1.9 project to Magic XPA 3.3 What I've noticed is the record prefix behavior. In UniPaaS, I have virtual variables updated in the record prefix by a value in main source because task has a main source and only 1 record is being modified and form has no table, when I modified a value in the main source that used to update the virtual variable in the record prefix and submit the form and the virtual variable values are still retained. However, in Magic XPA , when I submit the form it seems like it goes to record prefix again and update those virtual variable with the modification I did in the main source.
Best Regards, Darren
|
|
Darren
I understand, but my point is they have exactly the same order properties. I simulated the problem please check attachment,
|
|
Govert Schipper
Hi Darren,
Instead of updating the Virtual in the Record Prefix, you could use an Init Expression on it. Just make sure that the Select Virtual is placed somewhere BEFORE the Select Real column that is used in the Init Expression, otherwise it will be re-evaluated after you update the Real.
Govert Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Darren <darren.jimenez@...>
Verzonden: vrijdag 26 oktober 2018 08:23 Aan: main@magicu-l.groups.io Onderwerp: Re: [magicu-l] Record Prefix Behavior #ria I understand, but my point is they have exactly the same order properties. I simulated the problem please check attachment,
|
|
Darren
Hi Govert, But when I tried it on the actual program, it is still doing the same. Is there some kind of trigger to force it to go to record prefix first?
Regards,
|
|
Govert Schipper
Hi Darren,
The Record Prefix level is automatically executed for each record in the Logic. If there is only one record than it will be executed once, just before user interaction takes place. But if you want to update Virtuals with values from the data record that is being updated, you should put these updates in the Record SUFFIX instead.
Govert Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Darren <darren.jimenez@...>
Verzonden: maandag 29 oktober 2018 04:10 Aan: main@magicu-l.groups.io Onderwerp: Re: [magicu-l] Record Prefix Behavior #ria Hi Govert, But when I tried it on the actual program, it is still doing the same. Is there some kind of trigger to force it to go to record prefix first?
Regards,
|
|
Darren
Hi Govert, What I want is to update the virtual variable before user interaction that's why I placed it in the Record Prefix. But when I clicked Save and Close button, it would still go to Record Prefix as you have seen in the screenshot I sent and update those variables again which I do not want to happen.
|
|
Tim Downie
Just put a block around what you want to execute once in rp...inside it set virtual executed = true....cnd on block not(executed)
From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Darren <darren.jimenez@...>
Sent: Tuesday, 30 October 2018 1:58:56 AM To: main@magicu-l.groups.io Subject: Re: [magicu-l] Record Prefix Behavior #ria Hi Govert, What I want is to update the virtual variable before user interaction that's why I placed it in the Record Prefix. But when I clicked Save and Close button, it would still go to Record Prefix as you have seen in the screenshot I sent and update those variables again which I do not want to happen.
|
|
Hi Darren,
This issue sounds like a pretty dramatic bug to me. So you have to pay for it and report it :) There's however events which would force record prefix for a record another time, like a view refresh I think. So you should enable all logging and look into activity monitor to see the order of events, ... . That will give you much more insight than your test code with the message Best regards, Andreas
|
|
Ulrich Ahrendt
Hi Darren,
you wrote "...But when I clicked Save and Close button, it would still go to Record Prefix..". I gues, that you use an user event. Is this event set to "Post Record Update"? Regards, Ulrich
|
|
Darren
Hi Andreas, Yes I have filed a ticket in magic community and send them a reproducible project, and they are currently investigating it now.
|
|