Sound very easy to me , but this specific requirement was not that easy as it sounds.Reason? let me explain.
customer has context sensitive Order Header DFF with the following context
- PkMS etc
- Reference Fields = ORDER_SOURCE
- Synchronize with reference Field = Checked
as per them SETUP step 2 us a MUST for Importing Orders from different Sources and he was not willing to change it.(well ct. is King)
There was nothing wrong with the above setup , but when he copied the Order , the new copied order has values for the Global Attributes , but all the DFF attributes that were based on the Context appears NULL. Isn't that Strange , but no that not.
After doing copy order I have executed query on OE_ORDER_HEADERS_ALL ,and I have found that though the values appear NULL in DFF in Context sensitive DFF attributes , but these attributes has values in database fields.
On further Investigation I have found that , When we creates new order by Copying the existing Order (in my example existing order is Manul Order with ORDER SOURCE colum = "Online") system will Copy all the DFF Values to the newly created Order
In copied order
Context = "Online"
Attribute3 = Copied value from Old Order
Attribute4 = Copied value from Old Order
I have verified that after doing a simple backend query on OE_ORDER_HEADERS_ALL table.
But interestingly , if I open the Order Header DFF of newly copied Order , due to DFF
Set up "Synchronize with reference Field in DFF " , system will copy the ORDER_SOURCE (in this case it is "Copy" ) to the "Context" column of the DFF , and that results in NULL Values apppear for the Context senstive attribute Attribute3 and Attribute4 ( these attributes has value copied from the Original Order with Context = "Online") .Now If user press the Save button in DFF
Context = "Copy"
Attribute3 = NULL
Attribute4 = NULL
will be save in OE_ORDER_HEADERS_ALL table.
And this is very much the expected Behavious with the Setup "Synchronize with reference Field".Now If customer want to copy the values while doing the copy Order , he need to UNCHECK the "Synchronize with reference Field", But if that is not possible they need to do the Customization by means of
- Database Trigger
- Form Personalization.
Blogged with the Flock Browser