[progress Communities] [progress Openedge Abl] Forum Post: Re: How Can I Get Calculate...

  • Thread starter Thread starter Shiva Duriseati
  • Start date Start date
Status
Not open for further replies.
S

Shiva Duriseati

Guest
Hi, Create a trigger of type "Object Script" on FullDate Object. Use the below navigation for creating trigger. FullDate->Object definition->Trigger->New Trigger->Select Object script. Under the trigger configuration section include the following code.This will check if the record is already existed in LimitShow object with same name as FullData object.If record already exists then it will update the salary field,if record is not available then a new record is being created. var isRecordExists=rbv_api.selectNumber("SELECT COUNT(1) FROM LimitShow WHERE name=?",'{!name#text}'); //Update if record in FullData already exists.Otherwise create a new record. if(isRecordExists>0){ var id=rbv_api.selectNumber("SELECT id FROM LimitShow WHERE name=?",'{!name#text}'); var sumOfSal= rbv_api.selectNumber("SELECT SUM(Salaray) FROM FullData WHERE name=?",'{!name#text}'); rbv_api.updateRecord("LimitShow", id, {'Salary':sumOfSal}); }else { rbv_api.createRecord("LimitShow", {'name':'{!name#text}','Salary':{!Salaray}}); } Attaching app.xml for your reference. Please let me know in case you need any assistance. Regards, Shiva (Please visit the site to view this file)

Continue reading...
 
Status
Not open for further replies.
Back
Top