October 13, 200817 yr 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 ?
October 14, 200817 yr Author 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
October 14, 200817 yr 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.
October 14, 200817 yr Author 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.
October 15, 200817 yr Author 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
October 15, 200817 yr 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.
October 15, 200817 yr Author 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 ?
October 15, 200817 yr 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.
October 15, 200817 yr Author 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.
October 15, 200817 yr 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.
October 16, 200817 yr Author 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.
Create an account or sign in to comment