-
Notifications
You must be signed in to change notification settings - Fork 692
[Access Request] codeunit 7201 "CDS Integration Impl.", CompanyId and Owning procedures #24193
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Description
Currently, partners need to copy a lot of the OOTB code if they want to add custom entities to CRM integration and add support for multiple companies and ownership to such entities (for example, purchase orders or work orders)
It would be very helpful to remove the OnPrem scope for the following procedures in codeunit 7201 "CDS Integration Impl."
- HasCompanyIdField()
- CheckCompanyId()
- SetCompanyId()
- CheckCompanyIdNoTelemetry()
- ResetCompanyId()
- CheckOwningTeam()
- CheckOwningUser()
- SetOwningTeam()
- SetOwningUser()
[Scope('OnPrem')]
procedure HasCompanyIdField(TableId: Integer): Boolean
var
HasField: Boolean;
begin
CDSIntegrationMgt.OnHasCompanyIdField(TableId, HasField);
exit(HasField);
end;
[Scope('OnPrem')]
procedure CheckCompanyId(var RecRef: RecordRef): Boolean
begin
exit(TrySetAndCheckCompany(RecRef, true));
end;
[Scope('OnPrem')]
procedure SetCompanyId(var RecRef: RecordRef): Boolean
begin
exit(TrySetAndCheckCompany(RecRef, false));
end;
[Scope('OnPrem')]
procedure CheckCompanyIdNoTelemetry(var RecRef: RecordRef): Boolean
var
CompanyIdFldRef: FieldRef;
ActualCompanyId: Guid;
SavedCompanyId: Guid;
begin
if not FindCompanyIdField(RecRef, CompanyIdFldRef) then
exit(false);
ActualCompanyId := GetCachedCompanyId();
SavedCompanyId := CompanyIdFldRef.Value();
exit(ActualCompanyId = SavedCompanyId);
end;
[Scope('OnPrem')]
procedure ResetCompanyId(var RecRef: RecordRef): Boolean
var
Changed: Boolean;
begin
if TryResetCompanyId(RecRef, Changed) then
exit(Changed);
exit(false);
end;
[Scope('OnPrem')]
procedure CheckOwningTeam(var RecRef: RecordRef): Boolean
begin
exit(CheckOwningTeam(RecRef, false));
end;
[Scope('OnPrem')]
procedure CheckOwningTeam(var RecRef: RecordRef; SkipBusinessUnitCheck: Boolean): Boolean
var
EmptyGuid: Guid;
begin
exit(CheckOwningTeam(RecRef, EmptyGuid, SkipBusinessUnitCheck));
end;
[Scope('OnPrem')]
procedure CheckOwningTeam(var RecRef: RecordRef; TeamId: Guid; SkipBusinessUnitCheck: Boolean): Boolean
var
TempCDSCompany: Record "CDS Company" temporary;
begin
exit(SetAndCheckOwner(RecRef, TempCDSCompany.OwnerIdType::team, TeamId, true, SkipBusinessUnitCheck));
end;
[Scope('OnPrem')]
procedure CheckOwningUser(var RecRef: RecordRef; UserId: Guid): Boolean
begin
exit(CheckOwningUser(RecRef, UserId, false));
end;
[Scope('OnPrem')]
procedure CheckOwningUser(var RecRef: RecordRef; UserId: Guid; SkipBusinessUnitCheck: Boolean): Boolean
var
TempCDSCompany: Record "CDS Company" temporary;
begin
exit(SetAndCheckOwner(RecRef, TempCDSCompany.OwnerIdType::systemuser, UserId, true, SkipBusinessUnitCheck));
end;
[Scope('OnPrem')]
procedure SetOwningTeam(var RecRef: RecordRef): Boolean
var
EmptyGuid: Guid;
begin
exit(SetOwningTeam(RecRef, EmptyGuid, false));
end;
[Scope('OnPrem')]
procedure SetOwningTeam(var RecRef: RecordRef; TeamId: Guid; SkipBusinessUnitCheck: Boolean): Boolean
var
TempCDSCompany: Record "CDS Company" temporary;
begin
exit(SetAndCheckOwner(RecRef, TempCDSCompany.OwnerIdType::team, TeamId, false, SkipBusinessUnitCheck));
end;
[Scope('OnPrem')]
procedure SetOwningUser(var RecRef: RecordRef; UserId: Guid; SkipBusinessUnitCheck: Boolean): Boolean
var
TempCDSCompany: Record "CDS Company" temporary;
begin
exit(SetAndCheckOwner(RecRef, TempCDSCompany.OwnerIdType::systemuser, UserId, false, SkipBusinessUnitCheck));
end;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels