Color attribute lost in readc/update of subfile record.

235 pts.
Tags:
iSeries V6R1
READC
SFLNXTCHG
Subfile
I have a subfile that displays sales order records. If the order is a direct ship, the order number is displayed in turquoise. The color is controlled by an indicator that is set on when the records are loaded to the subfile. The subfile record is defined with keyword SFLNXTCHG and the user has options that can be entered for each subfile record.

As the option on each changed record is processed, the subfile record is updated to clear the option. The problem is I lose the color attribute in this update process. In researching this, the most recommended solution is to have a hidden field on the subfile rec that I could use to track the status of the color attribute.

I am wondering if this is still the best way or if there is a newer way to handle this issue.

 



Software/Hardware used:
IBM iSeries V6R1
ASKED: May 31, 2011  8:55 PM
UPDATED: June 1, 2011  12:45 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

You need to check every record again to set on or not the indicator.
In the moment you update the subfile the status of all indicators used will be applied, so I think the hidden field is the only solution.

This is the way we are using in the company I work for.
Regards.

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne
    I agree. I have always used Hidden fields for this type of problem.
    39,815 pointsBadges:
    report
  • TomLiotta
    By using a hidden input/output field to hold the type, you get the type back when you read the subfile record. You don't need to perform any extra logic to determine if the subfile record represents a "direct ship" nor any other type. The determination was made before the subfile record was first displayed and can be used again if that record is updated. Of course, if there is no significant complexity to making the determination, then it might just be simpler to make the determination each time to set the indicator on or off. It could reduce the code since it still needs to be done no matter what and there would be no use for a hidden field. Tom
    125,585 pointsBadges:
    report
  • deepu9321
    If we are reloading the subfile, then we should have an indicator for identifying the Record status. It will be fine to have a indicator at each record level(ideally Hidden field in subfile). But, If we are not reloading the subfile and we are using only 'Update' then, Hidden field will not be much useful.
    3,605 pointsBadges:
    report
  • Yorkshireman
    You could just load records with the colour attribute prefixed to the field content. This moves the logic to the RPG, is simple and obvious to anyone subsequently maintaining it. At present, you have something that sets the indicator - just use the same code to prefix the data with the colour byte. That way, there's nowhere for anything to get lost.
    5,520 pointsBadges:
    report
  • Canuhp
    Thanks everybody for your input.
    235 pointsBadges:
    report
  • Canuhp
    [...] Color attribute lost in readc/update of subfile record [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following