Skip to content

[Bug]: Verify PC0036 - scenario marked as unsupported is used in the base app #368

Description

@TKapitan

Analyzer

PlatformCop

Issue type

False positive (diagnostic fires when it shouldn't)

Rule ID

PC0036

Description

The rule says "Calling SetRecord on a Page variable with a temporary record is not supported and will cause a runtime error. The Business Central runtime cannot bind a page to a temporary record instance via this method."

However, this approach is used in standard BC by Microsoft in multiple places and also in our apps too. I haven't see any issues with this, is this rule based on recent change or experience?

AL code to reproduce

Check codeunit 5332 "Lookup CRM Tables", the following procedures use this approach for conversion of option to mapping

  • LookupCRMPaymentTerm(SavedCRMOptionId, CRMOptionId, CRMOptionCode, IntTableFilter)
  • LookupCRMFreightTerm(SavedCRMOptionId, CRMOptionId, CRMOptionCode, IntTableFilter)
  • LookupCRMShippingMethod(SavedCRMOptionId, CRMOptionId, CRMOptionCode, IntTableFilter)
Image

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvestigateFurther analysis required before the issue can be classified or resolved

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions