CA Service Management

  • 1.  Get customer.location

    Posted Apr 12, 2016 05:40 PM

    Hi community

     

    I'm trying to get customer.location and customer.location.site but don't work:  var cloc="$args.customer.location"; var csit="$args.customer.location.site";

     

    Any idea?

     

    Thanks for the help



  • 2.  Re: Get customer.location

    Broadcom Employee
    Posted Apr 13, 2016 11:30 AM

    not sure how/where you did this but out of box there are

    many htmpl files that reference $args.customer. For example,

    detail_pr.htmpl has this kind of statements there:

    var old_end_user = "$args.customer";

       alert_banner("$args.customer");

    <input type="hidden" name="SET.customer" value="$args.customer">

    <input type="hidden" name="customer_combo_name" value="$args.customer.combo_name">

    <PDM_MACRO name=button caption="Re Auto Assign" func="re_auto_assign('$args.assignee','$args.group','$args.customer','$a

    rgs.category','$args.auto_assign','$args.persistent_id','$args.affected_resource','$args.category.auto_assign')" hotkey_

    name="Re Auto Assign" id=btn010>

    <PDM_MACRO name=button caption="Quick Profile[Q]" func="profile_browser('$args.customer.persistent_id',void(0),void(0),'

    $args.persistent_id')" hotkey_name="Quick Profile[Q]" id=PROFILE_BROWSER>

    <input type="hidden" name="user_contract" value="$args.customer.organization.owning_contract">

    <input type="hidden" name="org_id" value="$args.customer.organization.id">

    //////

    I added these two lines to the loadActions():

    myvar = "$args.customer.location";

    alert(myvar);

    and I did see the customer location uuid displayed.



  • 3.  Re: Get customer.location

    Posted Apr 13, 2016 11:52 AM

    will help if you give us a little more context

    /J



  • 4.  Re: Get customer.location

    Posted Apr 13, 2016 06:19 PM

    Thanks for the answer

     

    I need to use the customer's location and site in order to fill another field when the tickets is created



  • 5.  Re: Get customer.location

    Posted Apr 15, 2016 05:50 AM

    When you're opening the ticket, there is no $args.customer, not before you save it for the first time. You'll have to dig the customer UUID from the form and do the search based on that. This might get a bit tricky so can you get away with doing this with a SPEL trigger when the ticket is saved?



  • 6.  Re: Get customer.location

    Posted Apr 15, 2016 02:33 PM

    Please review this thread:

     

    MULTIPLE INDIRECT REFERENCES ON SEARCHES

     

    and vote up the Idea because every single client I've had that is large enough to use Locations and Sites, needs this ability.  It should not be custom code, in my opinion.

     

    J.W.



  • 7.  Re: Get customer.location

    Posted Apr 18, 2016 01:37 AM

    I agree, that functionality would be nice to have but as far as I can tell it is not related to this issue, here the issue is reading the value on a detail view instead of sorting by it in a list view.