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

Notifications

Announcements

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
    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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 24 Super User 2025 Season 2

#2
TAHER Mehdi Profile Picture

TAHER Mehdi 14

#3
Fameeda Yaseen Profile Picture

Fameeda Yaseen 10

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans