Table methods using ValidateWrite() ValidateDelete() initValue() ModifiedField()
Click Here to download the XPO with ID values
initValue()
This method executes while creating new record to initialize a value, here I am assigning user id to the userID field.
public void initValue()
{
super();
this.UserId = curuserid();
}
ValidateDelete()
while deleting a record if we want to put any validation we can use this method. Here once I delete a record populating a info that deleted record.
public boolean validateDelete()
{
boolean ret;
ret = super();
info(this.AccountNum);
return ret;
}
ValidateWrite()
This method will get to fire when we update a record. here I am using to check mandatory field for address AccountNum
public boolean validateWrite()
{
boolean ret;
;
if(this.Address != "")
ret = super();
else
warning(" Please fill the address value");
return ret;
}
ModifiedField()
This method will execute if modified a record value, this works based on the field value.
Here I am using to fill the name field value according to the AccountNum
public void modifiedField(fieldId _fieldId)
{
CustTable ct;
;
super(_fieldId);
switch(_fieldId)
{
case fieldNum(Cust_new,AccountNum) :
{
this.Name = CustTable::find(this.AccountNum).Name;
}
break;
}
}
This blog is for Dynamics AX (AXAPTA) Developers,this will help you for your development issues. This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use.
Subscribe to:
Post Comments (Atom)
Ledger Voucher creation Framework and x++ code to create ledger voucher
Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...
-
{ "Message" : "Please verify that the user is valid and set up correctly." } Sol: System Administration > Se...
-
Please click here to access Custom Workflow step by step process:
-
FormRun formRun = sender.formRun(); Object inventTrans_ds = formRun.dataSource(formDataSourceStr(InventMarking,InventTransO...
this one is also helpful link
ReplyDeletehttp://daynamicsaxaptatutorials.blogspot.com/
Nice Work.........
ReplyDeletegood work
ReplyDelete