Write below code in your UIBuilder Class
public boolean validatePostingProfile(FormStringControl _control)
{
boolean ret = true;
VendPostingProfile vendPostingProfile;
vendPostingProfile = _control.valueStr();
if(VendLedger::find(vendPostingProfile))
{
if(vendPostingProfile != ' ' )
{
error ('Posting profile does not exist');
ret = false;
}
return ret;
}
call the above method in PostBuild method
dlgpostingProfile.registerOverrideMethod(methodStr(FormStringControl, validate), methodStr(<yourUIBuilderclass>, validatePostingProfile),this);