Skip to content

Fields from current record in slash commands? #438

Answered by tomasz-q
RickSeiden asked this question in Q&A
Discussion options

You must be logged in to vote

With javascript: prefix. Here is an example. I use it to open a new update set form while being on the rm_story form. The update set's name is generated based on the current story.

javascript:(function () {
    var initials = 'NN';
    var g_user = window.g_user || window.frames[0].g_user;
    var g_form = window.g_form || window.frames[0].g_form;
    
    if (g_form.tableName != 'rm_story') {
        g_form.addInfoMessage('This slash command works on rm_story form only!');
        return
    }
    
    if (g_user) {
      initials = g_user.firstName[0] + g_user.lastName[0];   
    }

    var number = g_form.getValue('number');
    var name = initials + ' - ' + number + ' - ' + g_form.get…

Replies: 8 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@arnoudkooi
Comment options

Comment options

You must be logged in to vote
3 replies
@tomasz-q
Comment options

Answer selected by RickSeiden
@vedang444
Comment options

@codaroma
Comment options

Comment options

You must be logged in to vote
1 reply
@arnoudkooi
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants