This is version 8.8 build 3127. The screen shot shows it all. I have a FIND that returns 1 record, then next line is a DELETE and if there are only 2 records in the BO it deletes them both. If I have more then it usually works OK.
Any suggestions?
Find 1 record, Delete 2???
Re: Find 1 record, Delete 2???
thats because there are 2 in context.
you've done 2 FINDs
do a LOG2 CONTEXT
you've done 2 FINDs
do a LOG2 CONTEXT
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Find 1 record, Delete 2???
I thought it would only delete the LAST find.
Thanks
Bruce
Thanks
Bruce
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Find 1 record, Delete 2???
Only if you've:
- Used DELETE ThatPermanentSchedule or
- created a sub process that doesn't feed the PermanentSchedule record to it to do the FIND
Code: Select all
IF SEARCH_COUNT = 1 THEN DELETE PermanentSchedule
ELSE IF SEARCH_COUNT < 1 DISPLAY MESSAGE ASYNC " No records found"
ELSE IF SEARCH_COUNT > 1 REPORT ERROR "Process stopped multiple records found"
Eg
TempPermSch with one attribute psPermanentSchedule that you can then pass to a sub process and interact with without having to remember This or That
-
- Posts: 2413
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: Find 1 record, Delete 2???
Another way of doing it which is great when you have more than one instance.....but more applicable when you have 3 or more....
Create a Non Persistent Business Object that has as many Reference Attributes as you need... For example.... assume you need to bring 4 different instances of a BO into context to do some comparison or whatever.
Create NP_My4BOs with ps_Instance_1, ps_Instance_2, ps_Instance_3 and ps_Instance_4. Injected each of your instances into the Reference Attributes and then you can pass the NP BO between any Processes and it takes all of the instances with it.
Create a Non Persistent Business Object that has as many Reference Attributes as you need... For example.... assume you need to bring 4 different instances of a BO into context to do some comparison or whatever.
Create NP_My4BOs with ps_Instance_1, ps_Instance_2, ps_Instance_3 and ps_Instance_4. Injected each of your instances into the Reference Attributes and then you can pass the NP BO between any Processes and it takes all of the instances with it.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Find 1 record, Delete 2???
I've used a similar setup to create quite complex double entry bookkeeping transactions (I.e. transaction plus commission plus tax) using only a few process steps.eagles9999 wrote: ↑Sun Jul 16, 2023 3:47 am Another way of doing it which is great when you have more than one instance.....but more applicable when you have 3 or more....
Create a Non Persistent Business Object that has as many Reference Attributes as you need... For example.... assume you need to bring 4 different instances of a BO into context to do some comparison or whatever.
Create NP_My4BOs with ps_Instance_1, ps_Instance_2, ps_Instance_3 and ps_Instance_4. Injected each of your instances into the Reference Attributes and then you can pass the NP BO between any Processes and it takes all of the instances with it.