Jump to content
Sign in to follow this  
merkaba22

Script inconsistent -- workout improvement

Recommended Posts

I was trying to modify the duplicate portal records of a found set of the original records themselves + the duplicates to distinquish between each other.

I couldn't get the next record, exit after last function to work properly and came up this work around. (see attached)

Does anybody see how this script can be improved?

Script_question.pdf

Edited by Guest

Share this post


Link to post
Share on other sites

That script looks like it may work... I didn't test it but I would suggest actually going to the related records and duplicating them there. The loop you would have to make would be much simpler. Duplicating in portals is definitely not the ideal way of handling this situation. Here is what this script would look like:

GTRR

loop

go to record first

duplicate

//set fields you want to set here

omit record

go to record first

omit record

end loop

This is slightly better but still not ideal. The best way of handling this problem is to create a parameterized create record script. Now your script is much easier to write(and read);)

go to record first

loop

perfrom new script

go to record next, exit after last

end loop

The parameterized script is a little more difficult to tackle but would be worth it in the long run... There are lots of posts around here that would help you with that if you aren't already familiar.

Share this post


Link to post
Share on other sites

Thanks as always -- the script was for use after getting the related records ... I will explore:)

Share this post


Link to post
Share on other sites

I actually realized that a little earlier today... sorry my brain turns to mush at night.

Share this post


Link to post
Share on other sites

Hope you don't mind, but the algoritm could be less clunky:

Sort Records [ Specified Sort Order: Untitled::Record; descending ] [ Restore; No dialog ] 

Go to Record/Request/Page [ Last ] 

Loop 

     Duplicate Record/Request 

     Go to Record/Request/Page [ Previous ] 

     Omit Multiple Records [ 2 ] [ No dialog ] 

     Exit Loop If [  not Get ( FoundCount ) ] 

End Loop 

Put inside the manditory GTRR and Go To Layout[orignal]

--sd

Share this post


Link to post
Share on other sites

That is a cool way of doing it... my brain still can't loop backwards though. It definitely would work better. Thanks Soren.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.