I tried to created 4 methods to lookup table by using C/AL in the Control. All are have the same result (lookup the table, get the value, and put it to field or variable). What is the best way? are they any difference among this 4 methods?
"Test Lookup" is new field in Customer table.
In the form, pull "Test Lookup" and overwrite standard lookup :
"Test Lookup" - Onlookup (VAR Text : Text[1024];) : Boolean
//Method 1
CLEAR(CustForm);
CustTable.SETRANGE("No.",'10000','50000');
CustForm.SETTABLEVIEW(CustTable);
CustForm.SETRECORD(CustTable);
CustForm.LOOKUPMODE(TRUE);
IF CustForm.RUNMODAL = ACTION::LookupOK THEN BEGIN
CustForm.GETRECORD(CustTable);
"Test Lookup" := CustTable."No.";
END;
//Method 2
CLEAR(CustForm);
CustTable.SETRANGE("No.",'10000','50000');
CustForm.SETTABLEVIEW(CustTable);
//CustForm.SETRECORD(CustTable); //REMOVE SETRECORD
CustForm.LOOKUPMODE(TRUE);
IF CustForm.RUNMODAL = ACTION::LookupOK THEN BEGIN
CustForm.GETRECORD(CustTable);
"Test Lookup" := CustTable."No.";
END;
//Method 3
CustTable.SETRANGE("No.",'10000','50000');
IF FORM.RUNMODAL(0,CustTable) = ACTION::LookupOK THEN
"Test Lookup" := CustTable."No.";
//Method 4
CustTable.SETRANGE("No.",'10000','50000');
IF FORM.RUNMODAL(0,CustTable) = ACTION::LookupOK THEN BEGIN
Text := CustTable."No.";
EXIT(TRUE);
END;
Hello,
I have had a few Business Central clients report that they have checked their data Storage Capacity Usage in their admin center and discover that they are over capacity, which they had not anticipated.
There are data retention tools and procedures, which we have helped these clients with, but as far as I am aware, there is currently there is no automated notification of either growth or of exceeding capacity in BC or the admin center, nor any tools or reports to provide growth pace and trends, which they may extrapolate from. These would be very useful as they would allow customers to make better decisions regarding data retention policies for data they can remove as redundant and manage their license budget to buy more capacity for data they must retain.
I wanted to see if some did know of such tools or reporting.
I have searched the forum for previous posts on this but have not found anything. Apologies in advance if I have missed anything in my search.
Thank you