Closed PauliusRudminas closed 4 years ago
@JesperSchulz - can you help with this question?
Hello,
Maybe there is some info on this issue?
This is system table and we cannot add keys here.
Well alright, but then the question remains - if this will be an issue when publishing because of CodeCop, and we should we figure out a workaround, or - if this can be viewed as an exception and will not cause problems publishing?
I don't think a warning will prevent you from publishing to AppSource. But we should probably address the warning anyway. Looping in @MarcHansenMicrosoft.
Only AppSourceCop is required.
Could you send a sample code? I am interested in the exact repro and if would should add the key to the system table.
Thanks Marc
Thanks for the quick reply! Here are the two functions used:
[TryFunction]
procedure GetFieldValueFromID(ReqTableNo: Integer; ReqTableView: Text; ReqFieldNo: Integer; var ResultValue: Variant)
var
RecRef: RecordRef;
FldRef: FieldRef;
begin
RecRef.OPEN(ReqTableNo);
IF ReqTableView <> '' THEN
RecRef.SETVIEW(ReqTableView);
RecRef.FINDFIRST();
FldRef := RecRef.FIELD(ReqFieldNo);
ResultValue := FldRef.VALUE();
end;
[TryFunction]
procedure GetFieldValueFromName(ReqTableName: Text; ReqTableView: Text; ReqFieldName: Text; var ResultValue: Variant)
var
FldRec: Record Field;
begin
FldRec.SETRANGE(TableName, ReqTableName);
FldRec.SETRANGE(FieldName, ReqFieldName);
FldRec.FINDFIRST();
GetFieldValueFromID(FldRec.TableNo, ReqTableView, FldRec."No.", ResultValue);
end;
Thanks for the sample.
AA0210 is not a warning but just a information, meaning you should be aware.
If you have performance issues in this code you should either avoid setting this filter or send us a request to add this key to the system table.
Thanks Marc
Ok, thank you for the reply
Hello, I've created a function, that gets a value from a field, when only the names of the table and the field are known. I use the Field table to get the table and field numbers, but it seems the CodeCop code analyzer gives me a warning: "The table Field does not contain the key with the field TableName.AL(AA0210)". Likewise, a warning on Setrange for field name.
Could you please add a key in this table for table and field names? Or will this warning be irrelevant when publishing the extension to AppStore?