Skip to main content

Notifications

Customer Service forum
Unanswered

How to restrict related table records

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");
// }

//}

  • a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: How to restrict related table records

    Hello,

    Please avoid creating duplicated threads.

  • Steve Zhao2 Profile Picture
    Steve Zhao2 on at
    RE: How to restrict related table records

    Hi Krishna4248,

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

  • Krishna4248 Profile Picture
    Krishna4248 32 on at
    How to restrict Reach Two grids contains minimum one record

    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");
    // }

    //}

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

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,818 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,147 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans