web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

How to restrict related table records

(1) ShareShare
ReportReport
Posted on by 32

HELLO All,

                    KINDLY PLEASE REPLAY ME, 

How to Restrict  if the main record contains the related records, if main record contains one record, then related record also one record must exist, if main record exists two records, then related record also must contain two records. 

I have added Workflow, If the above validation will work then only, we can be able to do submit otherwise It wants to show error ( Please Fill details like)

I wrote  below code, it is validating only first record, not validating for second record.

//while select KTTypeLines
// where KTTypeLines.Dependent == KTDetails.Dependent
// && KTTypeLines.DependentRecId == KTDetails.DependentRecId
// && KTTypeLines.HeaderClaimRefID == KTDetails.HeaderClaimRefID
// && KTTypeLines.EmployeeNumber == KTDetails.EmployeeNumber

//{
// select KTDetails
// where KTDetails.HeaderClaimRefID == ltClaimHeader.ClaimReferenceID
// && KTDetails.EmployeeNumber == ltClaimHeader.EmployeeNumber;

// if(KTDetails.RecId == KTTypeLines.RecId )
// {

// data.submit(args);
// }
// else
// {
// throw error("KT details and  KT lines are required");
// }

//}

I have the same question (0)
  • Krishna4248 Profile Picture
    32 on at

    HELLO All,

                        PLEASE REPLAY ME,

    How to Restrict check if the main record contains the related records, if main record contains one record, then related record also one record must exist, if main record exists two records, then related record also must contain two records. 

    I have added Workflow, If the above validation will work then only, we can be able to do submit otherwise It wants to show error ( Please Fill details like)

    I wrote code below code, it is validating only first record, not validating for second record.

    //while select KTTypeLines
    // where KTTypeLines.Dependent == KTDetails.Dependent
    // && KTTypeLines.DependentRecId == KTDetails.DependentRecId
    // && KTTypeLines.HeaderClaimRefID == KTDetails.HeaderClaimRefID
    // && KTTypeLines.EmployeeNumber == KTDetails.EmployeeNumber

    //{
    // select KTDetails
    // where KTDetails.HeaderClaimRefID == ltClaimHeader.ClaimReferenceID
    // && KTDetails.EmployeeNumber == ltClaimHeader.EmployeeNumber;

    // if(KTDetails.RecId == KTTypeLines.RecId )
    // {

    // data.submit(args);
    // }
    // else
    // {
    // throw error("KT details and  KT lines are required");
    // }

    //}

  • Steve Zhao2 Profile Picture
    Microsoft Employee on at

    Hi Krishna4248,

    It seems that you aren't using D365 Customer Service. Could you tell us which app are you using?

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Please avoid creating duplicated threads.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
NeerajPawar Profile Picture

NeerajPawar 31

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 23 Super User 2026 Season 1

#3
Encore Business Solutions Profile Picture

Encore Business Sol... 14

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans