Results 1 to 3 of 3

Thread: How to change values in parent tables in a DbCJGrid

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,090

    Default Re: How to change values in parent tables in a DbCJGrid

    Bengt,

    Normally you would not allow changing column values in a parent row when creating or editing rows that point to the parent row as it would change the value for all other rows pointing to the same parent row. Because of this you'll find the following line in your parent DD class
    Code:
    Set Foreign_Field_Option DD_DEFAULT DD_DISPLAYONLY to False
    Knowing this makes that when you want to overrule the situation you could change the setting in your parent DDO. To illustrate I used the order.vw (from order entry). The code there is:
    Code:
        Object oVendorDataDictionary is a cVendorDataDictionary
        End_Object
    
        Object oInventoryDataDictionary is a cInventoryDataDictionary
            Set DDO_Server to oVendorDataDictionary
        End_Object
    
        Object oCustomerDataDictionary is a cCustomerDataDictionary
            Set Field_RememberedValue Field Customer.Customer_Number to 18
        End_Object
    
        Object oSalesPersonDataDictionary is a cSalesPersonDataDictionary
        End_Object
    
        Object oOrderHeaderDataDictionary is a cOrderHeaderDataDictionary
            Set DDO_Server to oCustomerDataDictionary
            Set DDO_Server to oSalesPersonDataDictionary       
    
            // this lets you save a new OrderHeader from within OrderDetail.
            Set Allow_Foreign_New_Save_State to True
        End_Object
    
        Object oOrderDetailDataDictionary is a cOrderDetailDataDictionary
            Set DDO_Server to oOrderHeaderDataDictionary
            Set DDO_Server to oInventoryDataDictionary
            Set Constrain_File to OrderHeader.File_Number
        End_Object
    
        Set Main_DD to oOrderHeaderDataDictionary
        Set Server to oOrderHeaderDataDictionary
    and you can change this to:
    Code:
        Object oVendorDataDictionary is a cVendorDataDictionary
        End_Object
    
        Object oInventoryDataDictionary is a cInventoryDataDictionary
            Set DDO_Server to oVendorDataDictionary
            
            Set Foreign_Field_Option DD_DEFAULT DD_DISPLAYONLY to False
            Set Foreign_Field_Option Field Inventory.Description DD_DISPLAYONLY to True
        End_Object
    
        Object oCustomerDataDictionary is a cCustomerDataDictionary
            Set Field_RememberedValue Field Customer.Customer_Number to 18
        End_Object
    
        Object oSalesPersonDataDictionary is a cSalesPersonDataDictionary
        End_Object
    
        Object oOrderHeaderDataDictionary is a cOrderHeaderDataDictionary
            Set DDO_Server to oCustomerDataDictionary
            Set DDO_Server to oSalesPersonDataDictionary       
    
            // this lets you save a new OrderHeader from within OrderDetail.
            Set Allow_Foreign_New_Save_State to True
        End_Object
    
        Object oOrderDetailDataDictionary is a cOrderDetailDataDictionary
            Set DDO_Server to oOrderHeaderDataDictionary
            Set DDO_Server to oInventoryDataDictionary
            Set Constrain_File to OrderHeader.File_Number
        End_Object
    
        Set Main_DD to oOrderHeaderDataDictionary
        Set Server to oOrderHeaderDataDictionary
    This change allows changing the unit price but not the description.
    Last edited by Vincent Oorsprong; 23-Jun-2022 at 02:57 AM.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •