Highlighted
Respected Contributor.
Respected Contributor.
346 views

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

0 Likes
4 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

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

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

 

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

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

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

 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

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

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")

 

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

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

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

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.