How to compare current assignment group and new assignment group through Format control?

Hi Experts,

How to compare each IM’s current assignment group and new assignment group which coming from import descriptor. And this import descriptor have a Format controller.

So how to compare this in FC.

Any suggestion is appreciated.

Thanks in Advance.

Jithisha

  • Format Control let you do that if you open FORM

    just compare 2 fields: current.assignment and import.assignment (example names)

    and as a result of the comparison to perform some action, for example to save the value true / false in a variable

    the comparison itself:

    same(current.assignment in $file, import.assignment in $file)

    or

    not same(current.assignment in $file, import.assignment in $file)

    depending on what result you want to see

     

  • Hi Aarmus,

    Thanks for the reply.

    Actually i need to get current assignmnt group from javascript tab under FC. Please find the below screen shot.

    CompareCurrentAssigmnt.PNG

    Thanks in Advance

    Jithisha

     

  • The best practice to use all from one place - from calculations tab.

    You can use jscall there to call javascript.

    This is example for calculation field in calculations tab (in my login.DEFAULT)

    $lo.hpc.im.coordinatorgroups=jscall("Utils.GetRecordNamesByQuery", "assignment", "hpc.coordinator=contact.name in $G.hpc.contact", "name")
    
    $lo.hpc.companies=jscall("Utils.GetRecordNamesByQuery", "company", "true", "company")
    
    $lo.hpc.im.assignment=jscall("Utils.GetRecordNamesByQuery", "assignment", "hpc.assignees=\"" nullsub(contact.name in $G.hpc.contact, " ") "\"", "name")

     

  • Hello,

    If you need to compare values between current record and new record, you have to enable the Save Copy flag in the format control (main tab). Now you will be able to use the $file0 object in order to access to current values. So you have to use these expressions:

    RAD code

    assignment in $file0 --> Current assignment group

    assignment in $file --> New assignment group

    JavaScript code

    vars.$file0.assignment --> Current assignment group

    vars.$file.assignment --> New assignment group

     

    I hope you can solve the issue.

    Best regards,

    Albert