CA Service Management

  • 1.  create a BREL attribute for condition validation

    Posted Aug 22, 2016 08:08 AM

    Hello,

     

    I have created a field that is a BREL to other object and now I need to define this field in a notification condition, but when try to create the attribute is not being recognized:

     

    the attribute is being created like this:

     

    z_cnt_attritute.0.attribute_other_object

     

    could you help me?

    This works in the contact's form and messages templates.

     

    Thank you.

     

    Best Regards,

     

    R.I.



  • 2.  Re: create a BREL attribute for condition validation

    Posted Aug 22, 2016 09:45 AM

    Hi Rita,

    Currently out of the box it is not possible to use a BREL/QREL field in a condition as it returns a list\array of values.  Something like this would be an enhancement, which you can post here on the community as an idea, where folks can vote for it and product management can review it for possible inclusion in future versions of the product.

    Thanks,

    Jon I.



  • 3.  Re: create a BREL attribute for condition validation

    Posted Aug 22, 2016 01:03 PM

    Hi Jon,

     

    Thank you for your reply.

    I think it is possible to do this via a macro condition, where it is possible to write some spell code to get the info that is needed.

     

    I am trying to do it... but I have some doubths about the spell syntax... so it will take some time to get there.

     

    Thank you.

    R.I.



  • 4.  Re: create a BREL attribute for condition validation

    Posted Aug 22, 2016 11:19 PM

    Can you share some more detail about what you are trying to achieve and what led you to choose to use a BREL for this attribute?

    Regards,

    James



  • 5.  Re: create a BREL attribute for condition validation
    Best Answer

    Posted Aug 24, 2016 04:05 AM

    Hi,

    yes you can do by creating your own condition macro and upload it (not supported by CA) you will basically do a send wait with sync_fetch to retrieve the array and etrun false or true based on the value retieve.

    a basic (and quickly written) spl example will be like below (checking If a Ci is attached to a change and return false if not

     

    send_wait(0, top_object(), "call_attr", "lrel_asset_chgnr", "sync_fetch", "RLIST_STATIC", format("chg = %d", this.id), -1, 0);

     

      if(msg[1] == 0)

       return FALSE;

     

    lrel_asset_chgnr been your BREL table

    format("chg = %d", this.id) been your where clause

    Hope this help

    /J



  • 6.  Re: create a BREL attribute for condition validation

    Posted Aug 29, 2016 11:36 AM

    Hello Jerome,

     

    thank you very much for your reply, it was very helpful.

    Now I need to get the value of one of the attributes of the BREL record table.

     

    Could you help me on this?

     

    Thank you very much.

     

    R.I.



  • 7.  Re: create a BREL attribute for condition validation

    Posted Aug 29, 2016 02:12 PM

    Hello Jerome,

     

    For getting the information that I need I only have to do this:

    (the "call_attr" only returns one record)

     

    send_wait(0, top_object(), "call_attr", "lrel_asset_chgnr", "sync_fetch", "RLIST_STATIC", format("chg = %d", this.id), -1, 0);

    if (msg[1] ==1)
    {

    object prp_list = msg[0];
    send_wait(0, prp_list, "dob_by_index","DEFAULT",0,0);

    object prp = msg[0];

     

    string x = prp.[lrel_asset_chgnr_attribute]

    }

     

    Thank you very much for your help.

     

    R.I.



  • 8.  Re: create a BREL attribute for condition validation

    Posted Aug 30, 2016 01:58 AM

    Glad to see that  you find your way before I have either time to reply!

    That always better when we find our self

    /J