[adm2-dev] a tricky question about dataAvailable - Forum - OpenEdge Development - Progress Community

[adm2-dev] a tricky question about dataAvailable

 Forum

[adm2-dev] a tricky question about dataAvailable

  • Hi folks,

    Here is the situation,

    We have a SWindow in which we manage orders.

    During the phase of creating a new order, immediatly after filling the

    CustNum field we would like to initialize other order fields according to

    the customer record chosen.

    For that :

    - we created a new procedure in the customer Sdo, that we call :

    InitializeOrder

    - we modified the customer viewer so that on leave of the custNum field we

    call the proc InitializeOrder in the linked Sdo (ie Customer Sdo).

    Inside the InitializeOrder of the Customer Sdo, we have (simplified) :

    ASSIGN

    rowobject.adr1 = "street bla bla"

    rowobject.city = "city Z".

    PUBLISH "dataAvailable" FROM THIS-PROCEDURE ("SAME").

    Results we would like to get :

    - after we leave the custnum field, we would like to get all the viewers

    linked to this Sdo containing these fields (adr1, city) to be refreshed.

    Results :

    - if we exectue this during a modification of an existin order record,

    things work properly (ie DataAvailable does its work).

    - if we execute this during the phase of a creation of an ordre, we go

    through all these procedures but the DataAvailable placed at the end of

    InitOrder has no effect on the viewers.

    Could you explain to me what is happening and a workaround or another way of

    doing that works whatever mode we are in.

    Thanks for your help.

    Sylvestre SEGURON

    Project Manager

    DISTRI INFORMATIQUE

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org

  • dear jean michel,

    I publish the dataAvailable immediately after the ASSIGN in the InitOrder

    procedure that I have writen in the SDO.

    During order record creation, I call the InitOrder immediately after leaving

    the CustNum Field.

    At this point I have not yet saved the record, so it should not be in the Db

    clearly.

    The record only exists in the local version of the rowobject temp-table, I

    suppose.

    But because these actions work properly when I change the CustNum of an

    existing record (update) (even if this in real world does not make any

    sense), I think there is a difference of dataAvailable event behavior

    (published from SDO) when Smart object deal with a new record (instead of

    existing record).

    You gave me as advice to put a Publish "different". Why ?

    Yes, when we select "Add", then the Sdo publish a DataAvailable "different".

    But here we are in the middle of the creation transaction, I think it is

    difficult to justify the publishing of dataAvailable "different" as we are

    dealing with the same record (the one we just created).

    If you have an working example of such a case, I 'll be pleased to see how

    to do.

    Sylvestre

    To unsubscribe, e-mail: dev-unsubscribe@adm2.possenet.org

    For additional commands, e-mail: dev-help@adm2.possenet.org