Skip to main content

Notifications

Announcements

No record found.

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

//}

  • a33ik Profile Picture
    a33ik 84,325 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans