Error 1005   Unsafe operation. This operation can only be performed in the BeforeGotFocus or AfterGotFocus events of the target field. The operation could compromise the integrity of the application.

Situation:

You attempted to set the value of a composite field using the ValueSeg method from an event other than the composite field’s BeforeGotFocus or AfterGotFocus events.

Solution:

When setting a composite field using the ValueSeg property, set the composite from only the BeforeGotFocus or AfterGotFocus events for the field. When a composite gains focus, Microsoft Dynamics GP application code validates the value of the composite, segment by segment. Since the accounting system can perform this validation only after segments’ values have been set, you must set segment values using the ValueSeg property in events that precede the validation (the BeforeGotFocus and AfterGotFocus events).


Documentation Feedback