Please tell me the what is the main use of “Casecade+Restrictied” property in DeleteAction.Because i am observe “Restriction” also doing same work.Why we need “Casecade+Restrictied” ? I am changing these 2 options but same away it will be working.
Both are not working in same way, the difference as below.
Restricted - When you are going to delete any record from FORM it will first check the return value of validate delete method if it is false record will not delete.When you delete record by X++ then system will not check the return value of validate method and it will delete the record whether it is false or true.
Cascade+Restricted - Always check the return value of validate delete method whether record deleted from FORM or By X++ .
This explanation is taken from book: Microsoft Dynamics AX 2009 Programming Getting Started (you can find this on the internet.), page 86.
Let’s say you have tables CarTable and RentalTable, there is a one-to-many relationship between CarTable and RentalTable. Then if a record in CarTable is deleted and the delete action is:
None: No action on related records in RentalTable
Cascade: All records in RentalTable related to the record being deleted in CarTable will also be deleted
Restricted: The user will get a warning saying that the record in the CarTable cannot be deleted because transactions exist in table RentalTable. The user will be unable to delete the record in CarTable if one or more related records exist in the RentalTable
Cascade + Restricted: This option is used when deleting records through more than two levels. Let’s say another table existed that had a cascade delete action against CarTable and the CarTable had a Cascade + Restricted delete action against RentalTable. If the record in the top level table was about to be deleted it would also delete the related records in CarTable. In turn, all the records in RentalTable related to the records being deleted from CarTable would also be deleted. If only a record in CarTable was about to be deleted, the user would get the same message when using the Restricted method.
I think what Reyaz described is a bug in the kernel, as the behavior should be the same whether X++ code or form code is executed.
Thank you Fabricio for your Reply , Now I am understood.
nice post,good information
Thanks & Regards
Hi Fabricio ,Thank you for preious Reply .In the same away Example Can you tell me What is use of “FieldFixed,RelatedFieldFixed” properties in realtions…
Hi Fabricio, Thank you for your preious reply.In the same away please tell me What is use of “FieldFixed,RelatedFieldFixed” properties in realtions with 1 example…
field fixed type restrict displaying primary table value, but related field fixed type restricted secondary table vale
ther is a two table
1.Dress item – contains dresscode, Name , maleorfemale(enum – 0 for male , 1 for female) field
2.Shop – contains dressname, male or female(enum - 0 for male , 1 for female) field.
create relation to dress item table from shop
normal relation : shop.Name == dress item.Name;
fieldfixed: maleorfemale ==1;
while enter new item ,its display all the names in the table dressitem ,if we select male or female field is female, otherwise it doesnot display anythng, the name field doesnt enable,
normalrelation: shop.Name == dress item.Name;
relatedfieldfixed: 1 == male or female;
its display all the female dress item name, ( its display all the names from dress item which are all male or female field is selected is female).
Nooo realy nice…it is easily understood…
Hi this is my answer.You have a table like CarTableHeader and CarTableLine.You have a relations with these tables.You have a record like this;
AUDİ - Door
Step -1 Delete Actions is Cascade.
Step-1.1 İN FORM
if you delete the AUDİ record in form The AUDİ record and Door,Windows records are deleted.
Step-1.2 İN X++
if you delete the AUDİ record in x++ The AUDİ record and Door,Windows records are deleted.
Step -2 Delete Actions is Restricted.
Step-2.1 İN FORM
if you delete the AUDİ record in form The AUDİ record and Door,Windows records are not deleted.You give a warning message.
Step-2.2 İN X++
if you delete the AUDİ record in x++ The AUDİ record is deleted.But Door and Windows records are not deleted.
Step -3 Delete Actions is Cascade + Restricted.
Step-3.1 İN FORM
i if you delete the AUDİ record in form The AUDİ record and Door,Windows records are not deleted.You give a warning message.(LİKE RESTRİCTED)
Step-3.2 İN X++
if you delete the AUDİ record in X++ The AUDİ record and Door,Windows records are deleted.(LİKE CASCADE)
try this an example.You understand.