Hi All,
I'm trying to find a way to pass data from my 'tempory' business object, used for checking for duplicates and my main BO.
I have created a tempory BO where the data is uploaded via a CSV file. what i tried next was:
Process 1
FIND TempBO WHERE TempBO.PrimaryKey <> MainBO.PrimaryKey IN BATCHES OF 1
Process 2
CREATE MainBO FOR EACH TempBO With MainBO.Att1 = TempBO.att1, MainBO.Att2 = TempBO.att2,... MainBO.AttX = TempBO.attX
I've tried this as a standalone process and wirtten it in the update rules but have had no luck.
Does anyone know why this hasnt worked? Or have a soloution to what im trying to achieve?
Thanks!
Pass data from one BO to another when record not found
-
- Posts: 1457
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Pass data from one BO to another when record not found
Temporary BOs are in context only for the duration of the process that called them. I am not sure that you would have success doing a FIND
If for example you have created 5 instances of TempBO from your import and want to deal with them as singles ie to compare against existing BOs then create a second process to do the the FIND but with an input of TempBO but searching for MainBO
Process 1
Process name: DoesItExistProcess
You could also use NOT(EXISTS MainBO WHERE MainBO.PK=TempBO.PK but I am in the habit of using FIND and SEARCH_COUNT as It results in one less search than if you use EXISTS then FIND
If for example you have created 5 instances of TempBO from your import and want to deal with them as singles ie to compare against existing BOs then create a second process to do the the FIND but with an input of TempBO but searching for MainBO
Process 1
Code: Select all
[your import steps and the create TempBO steps]
DoesItExistProcess
Code: Select all
FIND MainBO WHERE MainBO.PrimaryKey = TempBO.PrimaryKey
IF SEARCH_COUNT = 0 THEN CREATE MainBO WITH ...
Re: Pass data from one BO to another when record not found
Sorry should have specified; The Import used is from the command type not the IMPORT in the process language. I need it so the end users can upload their own files.
I tried using the Doesitexistprocess in the update rules of the MainBO in the hope than when a user updates another record this process would then be triggered to update - no luck unfortunately.
Any ideas how I could perform this check after the user uploads their own CSV file?
Thanks.
I tried using the Doesitexistprocess in the update rules of the MainBO in the hope than when a user updates another record this process would then be triggered to update - no luck unfortunately.
Any ideas how I could perform this check after the user uploads their own CSV file?
Thanks.