Skip to Content

Mass data run on Opportunity

May 12, 2017 at 12:11 PM


avatar image

Hi Experts,

My requirement is to update IdleDays Days every day Opportunity and Lead IdleDays days is KUT field.

I have followed and c4c pdf and this blog

I have created custom BO and created script file.


import AP.Common.GDT as apCommonGDT;

businessobject CustomOppLead {

[AlternativeKey]element Id:ID;

element ZOppID:BusinessTransactionDocumentID;


action UpdateIdleDays;



mport ABSL;

import AP.CRM.Global;

var indicator = true;

var isTrue = false;

var OpptQry = Opportunity.QueryByElements;


isTrue = true;

//var OpptSel = OpptQry.CreateSelectionParams();



var OpptRes = OpptQry.Execute();

var OpprtCount = OpptRes.Count();

if (OpprtCount >= 1){

var OpenOppt_sorted = OpptRes.OrderByDescending(n=>n.ID.content);

foreach( var oppt_tab in OpenOppt_sorted){

var CurrentDateTime = Context.GetCurrentGlobalDateTime();

var changedOnDateTime = oppt_tab.SystemAdministrativeData.LastChangeDateTime;

var CurrentDate = CurrentDateTime.ConvertToDate();

var changedOnDate = changedOnDateTime.ConvertToDate();

var DateDifference = changedOnDate.Delta(CurrentDate).ConvertToDays();

this.IdleDays1 = DateDifference.ToString();

//oppt_tab.ZIdleDays.content = DateDifferenc;

//oppt_tab.ZIdleDays.unitCode = "DAY";



3) created Query.

4) created mass data run object .

5) generate screens for CustomOppLead.xbo and screens enable work center and able to see view in html5

But when I have scheduling UpdateIdleDays script is calling but not executing lines of code.

1)My query is how to update opportunity kut field “ZIdleDays”

oppt_tab.ZIdleDays.content = DateDifferenc;

oppt_tab.ZIdleDays.unitCode = "DAY";

but it is not allowing because it allows only reading not write to object.

Thanks & Regards,


untitled.png (15.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Gayathri Ramachandran Aug 24, 2017 at 10:19 AM

Hello Srinivas,

The reason, you are not able not able to update could be because you might have developed you solution in Foundation Deployment Unit while Opportunity is under CRM deployment Unit, Try to have an integration scenario defined in your current solution, so the BO's of different deployment unit can talk each other or otherwise create your solution in the same deployment unit of Opportunity. So you can edit it.

Hope this helps.



10 |10000 characters needed characters left characters exceeded