validation in customer/vendor form to mandatory address tab fields input

My issue is when i create new record in customer form, i want user to also enter values in address tab, that is street name, country. what i did was made street and country mandatory using properties. but if we don’t create record in address tab, mandatory option is disable and user can easily save information without inputting values in address tab.

This i want to restrict and it should be compulsory to input record in address tab when new record is created in customer form/vendor form .

I have already used Validate write in custtable,Can Close method in form but nothing happend.

This thread belongs to “Microsoft Dynamics AX / Axapta - Developer Forum”.

The first problem is that you can’t create records in DirPartyAddressRelationship without already having CustTable and DirParty records, because PartyId is mandatory in DirPartyAddressRelationship and it’s normally created when inserting CustTable to database. You would have to change how this works, which could be quite difficult. I don’t recommend it.

Nevertheless you can use another approach - allow creating customers without primary address but block some actions with them (as per your requirements) unless they’re explicitly marked are ready. For example, create customers as Stopped by default and don’t allow to change it unless the primary address is defined.

Its not working as customer.AccountNum is mandatory field and when i try to block default creation of accountNum it’s not allowing me to create adress in address tab

Hi Anyone can rectify and suggest solution for this issue

You completely missed my point. I recommend that you don’t try to limit creating of customers at all (only to limit what users can do with it), so there can’t ever be any problem with AccountNum.