Code Monkey home page Code Monkey logo

Comments (4)

jacebenson avatar jacebenson commented on August 14, 2024

Handling the notifications.

Example from ash on slack;

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
    
    function genericResource() {
        var itemGr = new GlideRecord("sc_req_item");
        itemGr.addQuery("sys_id", current.sysapproval);
        itemGr.query();
        
        if (itemGr.next()){
            var service = itemGr.variables.cscr_chooseService; //Providers
            var provChoices = itemGr.variables.cscr_providerChoices; //Create generic provider/resource    
            
            if (service == 'Providers' && provChoices == 'Create generic provider/resource'){
                
                template.print('<table border="1px solid black">');
                template.print( "<tr bgcolor='#ddd'align='center'>" );
                template.print("<td style='text-align:center;font-family:tahoma' colspan='10'><strong>Generic Provider/Resource</strong></td>");
                template.print( "</tr>" );
                
                template.print( "<tr>" );
                template.print( "<td style='font-family:tahoma'><left><b>Department </b></left></td>" );
                template.print( "<td style='font-family:tahoma'><left><b>Visit Type </b></left></td>" );
                template.print( "<td style='font-family:tahoma'><left><b>Block </b></left></td>" );
                template.print( "<td style='font-family:tahoma'><left><b>Duration(Minutes) </b></left></td>" );
                
                template.print( "</tr>" );
                
                
                var mrvs = itemGr.variables.generic_provider_resource;
                var ritm = itemGr.getUniqueValue();
                var rowCount = mrvs.getRowCount();
                for (var i2 = 0; i2 < rowCount; i2++){
                    var row = mrvs.getRow(i2);
                    
                    
                    var deptGenTbl = new GlideRecord('u_mc_sched_dept');
                    deptGenTbl.get("sys_id", row.cscr_generictbl_dept);
                    var deptGen = deptGenTbl.u_display_name;
                    
                    var visitTbl = new GlideRecord('u_mc_sched_sched_visit_type');
                    visitTbl.get("sys_id", row.cscr_generictbl_vsttype);
                    var visitGen = visitTbl.u_display_name;
                    
                    var blockTbl = new GlideRecord('u_mc_sched_blocks');
                    blockTbl.get("sys_id", row.cscr_generictbl_block);
                    var blockGen = blockTbl.u_display_name;
                    
                    
                    template.print( "<tr>" );
                    template.print( "<td style='font-family:tahoma'><left>" +deptGen+ "</left></td>" );
                    template.print( "<td style='font-family:tahoma'><left>" +visitGen+ "</left></td>" );
                    template.print( "<td style='font-family:tahoma'><left>" +blockGen+ "</left></td>" );
                    
                    
                    
                    template.print( "</tr>" );
                }
                template.print('</table>');
            } else {
                return;
            }
        }
    }
    
    genericResource();
})(current, template, email, email_action, event);

from jace.pro.

jacebenson avatar jacebenson commented on August 14, 2024

So in short;
MRVS issues;

MRVS do not access non MRVS content
MRVS do not allow UI Policies to hide variables
MRVS, until NY, were not shown in the summary
MRVS do not allow certain types of variables to be used. This is described better on DOCS
MRVS cascade on Order Guides is not supported (why are you using an order guide, nevermind... it is what it is)
MRVS in emails are weird
Server-side access to the MRVS is weird
MRVS summarizer is only available on Service Portal

from jace.pro.

jacebenson avatar jacebenson commented on August 14, 2024

https://docs.servicenow.com/bundle/newyork-it-service-management/page/product/service-catalog-management/concept/c_ServiceCatalogVariableSets.html

from jace.pro.

jacebenson avatar jacebenson commented on August 14, 2024

Another interesting related from checksumfailed https://gist.github.com/ChecksumFailed/c6e62c133fd2ecefb4affe9f5d675bb6

from jace.pro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.