Steven,
I know I am kicking a three year old horse, but I have just recently become involved with Maximo. Before me, a new type of business object called a Visit Request was built on top of an SR. A copy button was created using SR.DUPLICATE. The only visible change I saw when hitting the duplicate button was the REPORTEDBYID was updated to the current user. But, when the Save button was hit, it reverted back to the original value. Also there were six other fields that I felt should have been updated, but they were not:
· affectedemail
· affectedperson
· affectedphone
· reportedby
· reportedemail
· reportedphone
I would like to update these fields as well, but I cannot determine how to change the behavior of SR.DUPLICATE and I do not know how to add another function, perhaps SR.COPY or SR.DUPLICATE2
I am an old database guy who has used Java, C, C++, Perl, and others, so perhaps I have got to shed my old ways. But I have not had any Maximo training and am flying by the seat of my pants.
Thanks for any help,
/dave
------------------------------
david reynolds
------------------------------
Original Message:
Sent: Thu October 14, 2021 08:21 AM
From: Steven Shull
Subject: Automation script for duplicate record and then open it directly
The method I showed would not automatically save the new record in a Power App. It duplicates the record and moves to that record to allow the user to edit while also being able to discard.
Your app looks to be a custom version of the Create Service Request (CREATESR) app which is a special type of app. Most apps in Maximo are called Power Apps. For example, SR where you have a list tab, main tab, and then subsequent tabs of information. But there are two other types of apps: Single Page App, like Labor Reporting, and Self Service, like the Create Service Request app. These function differently than a traditional Power App.
You might be able to still do it in the Self Service app. If you can, it's probably going to be more involved. A push button can invoke an automation script and if you're on 7.6.1.X you can interact with the UI bean classes. You might be able to duplicate the record and move to the record in the bean class but I don't know without looking at the code for the start center apps. Can you confirm you're on 7.6.1.X? If you're on 7.6.0.X the hook for the UI for automation scripts doesn't exist and you would need custom java to do.
------------------------------
Steven Shull
Original Message:
Sent: Thu October 14, 2021 04:19 AM
From: Blaz Rakar
Subject: Automation script for duplicate record and then open it directly
Okay I understand what are you saying. So application is mobile, so when I click duplicate in my application in my Language "Kopiraj zahtevek". I see this up here, so the record was duplicated. But Application dont open my record its stays at this window.. New(duplicated) record must not be saved yet, I wanna just copy 3 values from previous record which in this case was already saved.

------------------------------
Blaz Rakar
Original Message:
Sent: Wed October 13, 2021 10:07 AM
From: Steven Shull
Subject: Automation script for duplicate record and then open it directly
Steve's question around whether this is in the self-service app or not is critical.
To expand on what he's saying, your script on SR.DUPLICATE is already in the right place to handle copying the values over. What you're looking for is that a user clicks a button in your app and that causes it to duplicate the record in question. If you're in a standard power app (such as SR), you already have the event you need to duplicate and move to that record out of the box. For example, if you drag a push button control on your SR record and set the event to DUPLICATE (and the signature option to DUPLICATE to hide the button when someone doesn't have security access) when a user clicks the button it will duplicate the record and automatically open it.

------------------------------
Steven Shull
Original Message:
Sent: Mon October 11, 2021 01:57 AM
From: Blaz Rakar
Subject: Automation script for duplicate record and then open it directly
Hello,
I have one requirement that I must create automation script which one will be duplicate created record where I will copy to duplicated record 3 values/attributtes.
I have one idea that I will achieve this after record was created user will get pop up dialog where he decides If he wants duplicate record or not. He will click push button "COPY RECORD" and there I created automation script with objectname and action duplicate --> SR.DUPLICATE.
The problem is, that if I duplicate record how could I make that after click I will duplicate record and at the same time open this duplicated record where user could insert other values? I have to said that this duplicated record is not saved yet is this possible?
Anyone have any idea?
------------------------------
Blaz Rakar
------------------------------
#Maximo
#AssetandFacilitiesManagement