In this case remove the New Record/Request line, will stop the duplcate record. The Set Field [Shipping::gshippingID;""] also makes a new record.
thanks for your reply greatgrey. however, that does not solve the problem. i have previously tried that by removing/disabling the New Record/Request and Set Field [Shipping::gshippingID;""] lines. even when you click on the New Record button on the status/toolbar (?) to create a new record, the same problem persist.
in the same file when i first was working with it, i set the gShippingID (global) field to be an auto-enter for serial number; and, related to the ShippingID field in its duplicate occurrence. i don't think that was the correct or proper way to use global fields; but, it wasn't giving me the problem i have now. of course, through all of this i've been using the same scripts found in the attached file above.
1 of 1 people found this helpful
The fields in your Header part come from a self-join via the global gShippingID, allowing creation of records; so when you enter data in those fields, you're creating a new record with a shippingID set to whatever is in that global field – unless the global value is identical to an existing shippingID …
<< i set the gShippingID (global) field to be an auto-enter for serial number>>
and that doesn't work because switching records doesn't trigger the update.
You could/should do several things:
• disallow record creation via the relationship
• change the relationship to a straight self-join by shippingID, or
make sure that both new record creation as well as entering a record sets the global ID to the new/current record's shippingID – as you already intended …
That could simply be done with a one-liner script Set Field [ Table::gShippingID ; Table::shippingID ] and an OnRecordLoad trigger.
First of all.
What's with the field missing?
Second. Please explain how you think this works, we went through all that when you got the original example.
Third. Yes, removing new record DOES fix the problem.
If [ Get( RecordOpenCount ) = 0 ]
Set Field [ Shipping::gShippingID; "" ]
Go to Field [ Shipping_Create::<Field Missing> ] New Record/Request
ShippingTest_modBFR.fmp12.zip 161.1 K
ah, sorry, about that line in the New Record script. just saw it late last night (into the whee hours). the missing field is PN; and BruceRobertson thanks again for the script. i know your original script does not have the New Record/Request step, so i added it just for the initial record creation. other than that everything else works great after creating that very first record.
the intention of this is to not show any related data in the fields, in the above header, when selected in the body. that has been accomplished via the self-join from the gShippingID to ShippingID. this part works great as records are created after the very first record.
removing the New Record/Request does fix the problem, but does not create that first record. once past that everything is fine.
EDIT: thanks, bruce, for the sample file...i didn't see that as i went straight into replying.
wow...that's totally awesome! looking at that script my mind is exploding lol. i really appreciate your assistance to me and to the FM community. when i implement this, i'll give credit where credit is due.
i'm not a fulltime FM developer. i only develop when asked by my team leads or their supervisors. but, i'm learning thanks to you all; and, i'm gonna keep going at it even when i'm not working on new solutions .
may i have you explain the $$newflag variable?