Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Help with validateField() logic

(0) ShareShare
ReportReport
Posted on by

 public boolean validateField(FieldId _fieldIdToCheck)
    {
        boolean ret;
        ret = next validateField(_fieldIdToCheck);
        TaxInformationVendTable_IN tax;
        if(_fieldIdToCheck == fieldNUm(TaxInformationVendTable_IN, PanNumber))
        {
            while select RecId , PANNumber , VendTable from tax
                where tax.VendTable != this.VendTable
                && tax.PanNumber == this.PaNNumber
            {
                if(tax)
                {
                    ret = false;
                    Info(strFmt("@OAB:OABPanNumberExist",tax.PANNumber,tax.vendtable,VendTable::find(tax.VendTable).vendorName()));
                }
            }
        }
        return ret;
    }

  1. For a new record, if the PAN Number field is kept blank system shall not check other records.
  2. This pop-up shall only be as a warning and shall allow to create and save record even if the same PAN exist in other records,
  • RE: Help with validateField() logic

    thankyou i used modified field method and it works fine now

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Help with validateField() logic

    It says that you did it wrong - the method you're trying to use doesn't match the method you're extending.

    Please look at modifiedField() method - you'll see that its returned type is void, while you're probably trying to use boolean, but that's not valid for modifiedField().

  • RE: Help with validateField() logic

    for modifed field error is coming not coc method and must be a void method

  • Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Help with validateField() logic

    Why is it in validateField() at all? Will you have the same problem in modifiedField() (which sounds like a better place)?

  • RE: Help with validateField() logic

    when ret was false it was showing info only one time , when ret is true its showing two times

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Help with validateField() logic

    I am not sure why its looping 6 times. Open "TaxInformationVendTable_IN" in table browser and see how many records against that PAN number - On the table "TaxInformationVendTable_IN" - "Vendor" field is unique. So, I don't think data might not be the issue.

    Please review the while select statement you added.

    Thanks,

    Girish S.

  • RE: Help with validateField() logic

    it is looping 6 times

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Help with validateField() logic

    Please debug the code and confirm that the while select you have added is looping 3 times only based on your record.

    Thanks,

    Girish S.

  • RE: Help with validateField() logic

    no , i have also added screenshot inmf9 , inmf7 ,inmf3 is printing two times

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Help with validateField() logic

    Info is not printing 2 times - I guess totally 6 vendors has same PAN number as you have given in the form.

    Thanks,

    Girish S.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans