New Posts New Posts RSS Feed - Subclass existing property class with object group
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Subclass existing property class with object group

 Post Reply Post Reply
kristof View Drop Down

Joined: 19-June-2012
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote kristof Quote  Post ReplyReply Direct Link To This Post Topic: Subclass existing property class with object group
    Posted: 31-January-2014 at 4:54am
This is what I'm trying to achieve:
  • I have a form containing an object group (TRADEDEF_RF.fmb containing RF_OG_STD).
    The object group contains some property classes (+ other stuff).  One of the property classes is PC_ITEM_DISPLAY
  • I have a form containing property class PC_ITEM_DISPLAY (RFVB1STOCK.fmb)
    The form does not contain an object group.
  • I open both forms via an API Master script.
  • I create an object group in RFVB1STOCK which references the object group from TRADEDEF_RF
  • Since property class PC_ITEM_DISPLAY already exists in RFVB1STOCK, it is not added.
  • Now I want to subclass this property class with the property class from the object group
    (just as if it was added by dragging the object group in the form).

This doesn't really work: in stead of just showing the subclass information, I still have all properties of the property class visible.
This works fine when I first delete the property class, create a new one and subclass it.  But then all items referencing the property class, loose their reference ...

Or am I trying to achieve something which is not possible ?
This is my script:
PROCEDURE Replace_OG_STD(i_form : number);
  v_og_std           : number;
  v_src_og_std       : number;
  v_def_form         : number;
  v_def_form_name    : string;
  v_pc_frm           : number;
  v_pc_og            : number;
  v_def_form_name := 'K:\Centric\Trade\forms10\tradedef_rf.fmb';
  v_def_form      := api_loadmodule(v_def_form_name);
  v_src_og_std    := generic_findobj(v_def_form, 'RF_OG_STD', D2FFO_OBJ_GROUP);
  //Create new OG_STD + subclass with OG_STD from DEF-form
  v_og_std := generic_create(i_form, 'RF_OG_STD', D2FFO_OBJ_GROUP);
  generic_subclass(v_og_std, v_src_og_std);
  v_pc_frm := generic_findobj(i_form    , 'PC_ITEM_DISPLAY', D2FFO_PROP_CLASS);
  //v_pc_frm := generic_create(i_form, 'PC_ITEM_DISPLAY', D2FFO_PROP_CLASS);
  v_pc_og  := generic_findobj(v_def_form, 'PC_ITEM_DISPLAY', D2FFO_PROP_CLASS);
  generic_subclass(v_pc_frm, v_pc_og);
Back to Top
koja View Drop Down

Joined: 13-January-2005
Location: Netherlands
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote koja Quote  Post ReplyReply Direct Link To This Post Posted: 23-March-2015 at 10:12am
Hi Kristof, (colleague btw ;-))

I don't really follow what you are trying to achieve. Usually one creates a reference form or even better an object library with property classes etc. and then subclass the property classes to appropriate objects in your forms, so all objects get the same set of properties applied.
But if you want to know what's going wrong here, then it's the fact that the existing PC cannot be replaced by a subobject from the applied object group.

I answered here, but will try to send you a PM in case you want to discuss this further.


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.