Hi,
Im having two tables named Student Information , Student Marks . The Student Information table has two fields , Student Name and Rollno , the Student Marks table contains two fields Rollno and marks . If im Entering Roll no in Student information table the same roll no should be inserted in Student marks table . and also if im modifying the roll no in student infomation table it also updated in student marks table . i need x++ code for that . i am new to AX.
Thanks in Advance .
It looks like the same topic as what's already discussed in your other thread Inserting Data into Two Tables at same time by using Code.
Please check similar job
Student Information -> student Name, RollNo -> StudentInformation
Student Marks -> Roll no, marks -> StudentMarks
public static void main(Args _args)
{
StudentInformation student;
StudentMarks marks;
;
ttsbegin;
//Insertion of new record
student.clear();
student.rollNo = '1';
student.name = "Check";
student.insert();
select marks where
marks.rollNo == student.rollNo;
if(!marks)
marks.rollNo = '1';
marks.marks = '91';
marks.insert();
}
ttscommit;
//for updation
select forupdate student
where student.rollNo == '1';
student.rollNo = 20;
student.update();
update_recordset marks
setting roll = '20'
where roll = '1';
info("done");
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 2,188
André Arnaud de Cal... 868 Super User 2025 Season 2
Sohaib Cheema 593 User Group Leader