Hi all, I'm creating a custom window in GP to record additional data for Project Accounting Inventory lines.
I created a test trigger for a scrolling window on the PA_Budget_Maintenance form, just to see how cross dictionary triggers worked on scrolling windows, the trigger is below.
l_result = Trigger_RegisterFocusByName(258, "'PA Cost Category ID' of window PA_Budget_Maintenance_Scroll2 of form PA_Budget_Maintenance",TRIGGER_FOCUS_PRE, TRIGGER_AFTER_ORIGINAL, script pa_application_codes);
if l_result <> SY_NOERR then
warning "PA User defined focus trigger failed." +str(l_result);
end if;
It registered fine and the trigger fired when it should have.
I then created the trigger below for the paBudgetIVItems form (the form we need to use)
l_result = Trigger_RegisterFocusByName(258, "'PA Forecast Quantity' of window paIVItemsScroll of form paBudgetIVItems",TRIGGER_FOCUS_PRE, TRIGGER_AFTER_ORIGINAL, script pa_application_codes);
if l_result <> SY_NOERR then
warning "PA User defined focus trigger failed." +str(l_result);
end if;
It registered fine but simply will not fire, I have tried loads of things, even tried a database trigger on update from the scrolling window link table but nothing.
Any ideas why it worked on the first window...but not the second?
Ian.
*This post is locked for comments
The script debugger did the trick!
Not sure where I was going wrong, I opened the PA dictionary to find out what form paBudgetIVItems belongs to, and according to dex it was the paBudgetIVItems form, but the script debugger showed it was a window on the PA_Budget_Maintenance form…
Sanity regained.
Thanks a whole bunch.
Ian.
Thanks Dave.
I'll try working off a change etc. and see if it makes any difference. Also check the field is running.
I'll update you if resolved.
Best regards,
Ian.
Ian,
If the trigger is registered, then it should definately run. I guess I would double check and make sure that is the field that you want this script to run on. Sometimes GP stacks fields on top of each other and displays them differently depending on conditions. Maybe the field you are triggering on isn't actually running. Also, you have this trigger on the field pre script. So it will run when you tab into the field. Are you sure that's what you want? Or do you want a change script? To tell what field is actually running, turn the script log on and then go through and try to make the trigger fire. Then look at the script log and see if it is actually the 'PA Forecast Quantity' field.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156