Little direction in getting my feet wet in the P42101

KevinCourtney

Active Member
Hello,

Now that Bryan helped me find some P42101 documentation and as I'm reading through it, I am wondering if someone can give me a real quick and rough outline of what I need to change to achieve this simple modification I've done to the P4210 and do the same in the P42101:

P4210 mod:

On form W4210A, at the end of the "Grid - Row Exit and Changed - Asynch " event I added these lines:

<font class="small">Code:</font><hr /><pre> // Validate the Companies are the same for the Branch/Plant MCU
frm_szTRID_F0006_CompanyCO [CO] = ''
F0006.Fetch Single (index 1)
TK CostCenter [F0006,MCU] = GC Branch/Plant [F4211,MCU]
TK Company [F0006,CO] -> frm_szTRID_F0006_CompanyCO [CO]
If FC Order Company [F4201,KCOO] != frm_szTRID_F0006_CompanyCO [CO]
Set Grid Cell Error(FC Grid, <Currently Selected Row>, GC Branch/Plant, "550053")
EndIf
</pre><hr />

...where would I do the same thing in the P42101 and its various pieces?

Any direction would be great, thanks,
 
The "right" way to do it would be very much opinion based. In fact there probably isn't ONE correct way to do it.


Option A:
Honestly, if you wanted, you could probably do the exact same thing in P42101, just on the detail subform's grid's async event (S421002C).

Option B:
If you wanted, you could mod the S421002C's view controller to do the validation (B4210620). Although, from a pure design pattern standpoint this is probably NOT the right spot, however, when you are modding pristine applications you sometimes have to break those kinds of rules to keep the mod as non-invasive as possible.

Option C:
You could modify F4211FSEditLine. However, since you could have done that on your older release that may not fit your constraints or requirements.

Option D:
You could modify the Sales Order Model functions that call F4211FSEditLine (B4210010 I think).

Option E:
Any combination of the above.


It really all depends on how many mods you have, how they are currently constructed and the nature of your modifications.


I created my own View Controller/Model functions. Mainly just the header and the detail. When the P42101 called either the pristine header view controller function or the pristine detail view controller function, I would call my corresponding custom function and pass our custom values and do any custom validations. This had the following advantages:

1. Kept the modification footprint in P42101 and subform’s as small as possible (easier to retrofit).

2. I could read values from my custom cache or pristine cache or the pristine sales order model session cache to aid in data validations/calculations, etc. For example, we have our own custom header dates that defaulted to custom dates on the detail line. Since I called my custom header view controller and stored the header values in cache, when my custom detail VC function was called I could read the header values from cache and default to the detail lines... I didn't have to pass the values from the header subform to the detail subform and modify the subform interconnects to pass data back and forth.


Again, there is not a "right" answer, it all comes down to what you are comfortable with and the time table to port existing mods over to P42101. I will say that, depending on how extensive your mods are, you may have to mod or write some C code. You might find that mods done in P4210 ER code can't easily be done in P42101 ER code. That’s not a 100% guarantee, just be prepared. For example, lets suppose that you had a P4210 mod that would allways pass a '1' to F4211FSEditLine.cOverridePrice. That would be easy to do in P4210 ER code since it calls F4211FSEditLine directly. This could not be done in P42101 ER code since this parameter is not in the S421002C's VC function.
 
Brian,

Thanks for the great response. Exactly what I was looking for and then some. Very helpful.
 
Back
Top Bottom