Highlighted
Absent Member.
Absent Member.
4297 views

File records in Format Control

I am adding a new module to my system called PACR. In this module I am adding activity records. I was able to add activity records to Configuration Management doing a javascript comparison between $file and $file0 inside format control. However in the new module PACR the $file0 is full of null values. I checked "Save Copy" in format control but the record's($file0) properties are all null values.

Is there a place the $file0 is being assigned values in other module Format Controls or is there a location the value should be assigned like in other modules?

0 Likes
16 Replies
Highlighted
Absent Member.
Absent Member.

You can define $file0  manually by adding the initialization expression:

$junk=fduplicate($file0,$file)

 

I have, however, run into some problems with newer releases with this approach, but by moving the expression for the first line of the FC calulations section, then setting it to execute on Initial display only, it worked reliably.

Highlighted
Absent Member.
Absent Member.

I tried that and in RAD debugger the file0 value shows it is full of the current record being displayed. However the issue is once I hit the Save button the values become null.  So I'm thinking it's somewhere between the action, displayoption and process, any ideas where it might be getting wiped?

 

Edit:
I'm calling a subroutine where I call a script.execute and I created a script that uses the file varilables. Is there a way to use these variables in the script? I set it up in device to use a subroutine calling a Scripts that uses this RAD statement and uses the variables correctly $L.rc=jscall("SIConfigActivity.createActivity", $file, $file0, operator())

 

Also inside notifications the $L.file.save is null as well. I am getting the feling I missed a process or a environment variable somewhere?

0 Likes
Highlighted
Absent Member.
Absent Member.

The $file0 file variable is generated in the format.cint RAD Application.

 

Panel: set.up.record.save

 ---> This panel initializes the $file0 file variable

 

Panel: set.up.record.save.1

 ---> This panel populates the $file0 file variable

 

Troubleshooting this issue will require tracing the work-flow backwards to find the "empty" record. Generating a trace and/or using the RAD Debugger will help in this process. Basically, you will need to identify which "parent" RAD Application fails to pass a populated "original" record.

 

Example work-flow when updating a contact:

se.view.engine passes $L.file.save to se.base.method

se.base.method passes $L.file.save to format.cupd

format.cupd passes $db.supd to format.cint

format.cint creates $file0 using $db.supd (technically named $db.srec within format.cint)

 

RAD Debugger excerpts:
|46| RAD: se.view.engine
...
|46|          call.base.method.1
|46| RAD: se.base.method
...
|46|          save.fc
|46| RAD: format.cupd
|46|          start
|46|          start.1
|46|          init.file.variables
|46| RAD: format.cint
|46|          start
|46|          set.up.file.variable
|46|          set.up.file.variable.1
|46|          set.up.record.calc
|46|          decide.record.save
|46|          set.up.record.save
|46|          set.up.record.save.1

Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral

That seems to be a complicated way of going about generating actvities.

 

If you're creating a brand new module, I'm assuming that you're using se.base.method as your RAD application in the Process record you're using to handle and save-type action ("add", "update", etc).  That se.base.method has two parameters ("file" and "second.file") that take two values ($L.file and $L.file.save) to handle before and after checks for activity.

 

Combining that with just the standard activityactions conditions, you should be easily able to generate any kind of activity on the changing of any value.  You shouldn't need to use javascript to do this, or use a formatctrl for $file0.

0 Likes
Highlighted
Absent Member.
Absent Member.

I am using se.list.engine.

 

Correct me if I'm wrong but the way it is determined is the Object record under the tab "Manage Queues" and "Add/open application".I attached the object record image of the location i am talking about That is where I set that. If I use se.base.method it throws a RAD exception as attached.

 

Instead when I use the se.list.engine the error goes away and I dont get the issue I had before when using se.view.engine as I did in this linked previous post.

0 Likes
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral

.... you're calling se.list.engine when you want to save a record?

0 Likes
Highlighted
Absent Member.
Absent Member.

Try the work-flow with the Add/open application (scm.add.appl) field empty to see if default actions take over. It appears this field is only populated for the OOB module files that have pre-defined RAD Applications (e.g. cm3r.main, cc.open.from.menu, etc).

0 Likes
Highlighted
Absent Member.
Absent Member.

@ Yes I am using se.list.engine. As pictured with other ones I get an error.

@ When using scm.add.appl ServiceManager logs me out.

 

If it helps to know I used the book "Service Manager 7 Techniques" by Mike Sanders and the HP Help for Document Engine pdf. My system is Service Manager 9.2x and will be upgraded to 9.30 when that is available in July.

0 Likes
Highlighted
Absent Member.
Absent Member.

The field name in the Object record with the "Add/open application" label is scm.add.appl (it is not a RAD Application). Please try removing the value "se.list.engine" from this field and leave it blank.

 

Note:

Although there might be some exceptions, there should not be a need to call/specify se.list.engine or se.view.engine directly. These are basic components of the Document Engine work-flow and will be called automatically as needed.

0 Likes
Highlighted
Absent Member.
Absent Member.

I removed the paramater and the issue now is when you click "new" on the scm.advanced display-screen(from the to-do list)  it just goes to the search screen instead of the open for my new module.

0 Likes
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral

I haven't read Mike Sander's book.   Everything I know I know because I've tried it and it works.

 

For the places where I have implemented a new Module (including ones that generate activities) I've done the following:

 

Added displayscreens. In most cases, I start by copying the db.search and db.view screens, and renaming them based on the module I'm building.

 

Added displayoption records. In this case, the ones we're concerned with are ones for 'add' and 'save'.

 

Added States records. This is where I can link the displayoption records to the custom Processes for this module's 'add' and 'save'.

 

Added custom Processes. Let's take a look at the Process I have linked to the 'save' action for this module.

 

As the first RAD call in the Process record that gets triggered on the 'save' action, I have the following:

 

RAD Application: se.base.method

Condition: true

Parameter Names | Parameter Values

file | $L.file

prompt | "update"

second.file | $L.file.save

record | $L.fc

second.record | $L.object

text | $L.exit

boolean1 | nullsub($G.bg, false)

 

In the final expressions, I have: if ($L.exit="normal") then ($L.exit="resetrec")

 

With this, when the user clicks the "Save" button for this module, it calls the custom "Save" process; the se.base.method has a built in call to the RAD application that checks for the generation of activity records, so all I had to do was set up activityaction records for this table and the mode (add/save)

 

I don't know how you've done it, but this is the base that I start from, and I've never had any issues with generating activities, getting $L.file.save and $file0 to work like it's supposed to (which doesn't mean that I capture those values in the RAD debugger, unless I turn on tracing and set breakpoints when variables change... some variables don't last long enough for you to see them in the debugger).

 

This may not be the answer you're looking for - I don't know how to get it to work the way you're doing it, since I don't understand why you'd make a cal to the RAD application that handles generating the list view of records when you're trying to save a specific record - but it is what I do to make activities work.

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.