Hi,
In one database there are 4 companies say A,B,C and D.
I am writing processing only report to modify "customer Entry Date", which is custom field in Customer table.
I used Customer as dataitem. In the request form I have given the option to select number of companies.
CompanyFilter := A|B
In OnAfterGetRecord of the Customer Data Item , I wrote the code like
CompanyRecord.SETFILTER(Name,CompanyFilter);
If CompanyRecord.Find('-') then
SetCompany(CompanyRecord.Name);
Customer."customer Entry Date" := Workdate;
Customer.Modify;
SetCompany(NewCompany : Text[30]) //Function
Customer.CHANGECOMPANY(NewCompany);
The process what I am doing is correct ?
0
Comments
Do something like this.
IF Company.FIND('-') THEN
REPEAT
Customer.CHANGECOMPANY(Company.Name);
IF Customer.FIND('-') THEN
REPEAT
Customer."customer Entry Date" := Workdate;
Customer.Modify;
UNTIL Customer.NEXT = 0;
UNTIL Company NEXT = 0;
IF Company.FINDSET(FALSE,FALSE) THEN
REPEAT
Customer.CHANGECOMPANY(Company.Name);
{set any filters on Customer}
Customer.MODIFYALL("customer Entry Date", Workdate);
UNTIL Company.NEXT = 0;