- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
On Save ?
Is there a setting on save() - similar to on close ().
Background: Optimize Sharepoint Integration
A Jmp file doesn't get uploaded to sharepoint as long as it is opened in Jmp.
-> If a user clicks on save Jmp should ask the user if it's OK to close the file - to trigger the upload.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: On Save ?
I'm not sure << Subscribe could work in this case (it does offer On Save)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Subscribe(
"name1"("client"),
On Close(Print("Closing Data Table"))
);
f = Function({dtab, oldname},
Print("oldname", oldname);
Print("new name", dtab << getname());
);
fsave = Function({dtab, newpathname},
Print("new path name", newpathname);
Print("new name", dtab << getname());
);
dt << Subscribe("name1", On Rename(f));
dt << Subscribe("name1", On Save(fsave));
fcols = Function({dtab, b},
n = N Items(b);
dtname = (dtab << getname());
Print(dtname);
Print(n);
For(i = 1, i <= n, i++,
colname = (b[i] << getname());
Print(colname);
);
);
dt << Subscribe("name2", On Delete Columns(fcols));
//Try deleting a column, then close the data table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: On Save ?
I'm not sure << Subscribe could work in this case (it does offer On Save)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Subscribe(
"name1"("client"),
On Close(Print("Closing Data Table"))
);
f = Function({dtab, oldname},
Print("oldname", oldname);
Print("new name", dtab << getname());
);
fsave = Function({dtab, newpathname},
Print("new path name", newpathname);
Print("new name", dtab << getname());
);
dt << Subscribe("name1", On Rename(f));
dt << Subscribe("name1", On Save(fsave));
fcols = Function({dtab, b},
n = N Items(b);
dtname = (dtab << getname());
Print(dtname);
Print(n);
For(i = 1, i <= n, i++,
colname = (b[i] << getname());
Print(colname);
);
);
dt << Subscribe("name2", On Delete Columns(fcols));
//Try deleting a column, then close the data table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: On Save ?
wow, amazing - how do you find these things?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: On Save ?
Usually with I find them using Scripting Index. I either have some idea about which features there are in JMP (I know quite a few of them) which could work or I use some creative searching in scripting index and attempt to narrow down the possible options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: On Save ?
and me:
1)
2)
3)
4) https://www.google.com/search?q=on+save++site%3Acommunity.jmp.com
-> Jarmo will know ...
On Save is even listed in the summary and an example is available - but with my skills I can't find it in Scripting Index.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: On Save ?
For me it was something like:
Search for On Save (nothing useful or rather too many items, Subscribe is there if you scroll down to Prototype matches but I didn't and most likely I wouldn't have even tried it)
Try On Close to see which could be correct category (too many categories to really filter that down quickly)
Notice Subscribe to Data Table List (I'm familiar with that one so I went with that, Subscribe was visible here). Click on that and it selects Row from left (no idea why it is Row and not Data Table)
Remove search term to get only Row related items and check if that would have something useful (found nothing useful).
Update my search term to Subscribe to find more things related to that and notice that there is Subscribe message (for Data Table) and it happens to support On Save
There were few steps where I could have noticed Subscribe earlier but I didn't (this time). Most likely easiest way to find it could have been something like "Search for "On Save", select Data Table from left to find only Data Table related items and hope for best"