Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5884 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a simple script to duplicate the current record. But, the record is not duplicated. No error is shown, even with error capturing off. But if I debug, I see it is returning error 3 - “Command is unavailable (for example, wrong operating system, wrong mode, etc.) “.

If I use the duplicate record in the menu, it works fine. Also, the script steps works fine in other files, just not this one..

I have full access rights to the file.

Any ideas ?

Posted

The script is attached. Very simple as you can see.

My colleague has discovered that adding a script step Goto Field before the Duplicate Record / request seems to fix the problem. If I use Goto Layout instead of Goto field, it does not work.

But I really don't see why I should have to do either of those, does not seem to me to make sense. I just want to duplicate the current record.

Duplicate.pdf

Posted

The only way I could produce similar results is when the file is in PREVIEW mode prior to the duplicate record command - this is a "wrong mode" situation.

Don't understand about the go to field or layout.

Posted

Well it does not seem to make any sense that I have to use the goto field step first to make a duplicate record step work, but anyway, it does work. Thanks.

Posted

OK, I deleted most of the tables and layouts.

Go to documents, then record number 13 "This one".

The "use Template" button will appear because the document type contains the word "template".

The "Use Template" button runs the script "Create Document from Template".

If the GOTO Field step before Duplicate Record is disabled, the record will not duplicate.

Admin PW is blank

Dup_Prob.zip

Posted

I don't see any "Use Template" button. If I run the script from the Scripts menu, it duplicates the record just fine. I suspect you have some interference from a plugin.

Posted

The "use Template" Button is just below the notes / comments, to the right of the image. It will only appear if the document type contains "Template".

You are correct - it does indeed run properly when the script is run directly from the scripts menu. But it does not work when I use a button.

You have suggested interference from a plugin... any idea what plugin could cause this ?

Posted

I see no such things in the posted file (the layout is 'Digital Media list'). I suggest you disable all plugins and start from there. Event-triggering is the most likely suspect, but this is purely speculating.

Posted

The layout is digital media DETAIL. I have a LOT of plugins installed, many of them demos of stuff I tried. I guess its time to clean up anyway..

But I would still love to know if you get the same behaviour.

Posted

I do.

Your button is in a portal. When you click on it, you enter a portal row. The script keeps running in that context. If it were allowed to, it would duplicate the related record in that portal row (says so in the help).

You should start your script with Go to Field[] or Commit Records to get out of the portal.

Posted

aha. yes it is indeed in a portal, so that it can be hidden when its not supposed to be available.

Thanks so much for your help.

This topic is 5884 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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